forked from kraj/meta-clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bcc: CMakeLists.txt: don't modify .gitconfig on build host nor try to…
… update git submodules * bitbake fetcher will correctly handle safe.directory issues and blazesym or libbpf submodules are managed by gitsm:// fetcher we don't want to call git from CMake in do_configure * prevents many safe.directory entries in users .gitconfig when bcc was built in many different TMPDIRs added in iovisor/bcc#4186 causing: [safe] directory = /OE/build/oe-core/tmp-glibc/work/cortexa57-oe-linux/bcc/0.28.0+git/git directory = /OE/build/oe-core/tmp-glibc/work/cortexa57-oe-linux/bcc/0.28.0+git/git/libbpf-tools/blazesym to be added for every TMPDIR where it was built Signed-off-by: Martin Jansa <[email protected]>
- Loading branch information
1 parent
09e448e
commit 0bbb4ab
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
.../recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
From 9ee5d9ca2e1ea709571613326b81e8e651fa9f00 Mon Sep 17 00:00:00 2001 | ||
From: Martin Jansa <[email protected]> | ||
Date: Thu, 7 Sep 2023 11:43:25 +0200 | ||
Subject: [PATCH] CMakeLists.txt: don't modify .gitconfig on build host nor try | ||
to update git submodules | ||
|
||
* bitbake fetcher will correctly handle safe.directory issues and | ||
blazesym or libbpf submodules are managed by gitsm:// fetcher | ||
we don't want to call git from CMake in do_configure | ||
|
||
Upstream-Status: Pending | ||
Signed-off-by: Martin Jansa <[email protected]> | ||
--- | ||
CMakeLists.txt | 62 -------------------------------------------------- | ||
1 file changed, 62 deletions(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index dfed06e5..ffd88043 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -26,68 +26,6 @@ endif() | ||
|
||
enable_testing() | ||
|
||
-execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR} | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- RESULT_VARIABLE CONFIG_RESULT) | ||
-if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
- message(WARNING "Failed to add root source directory to safe.directory") | ||
-endif() | ||
- | ||
-# populate submodule blazesym | ||
-if(NOT NO_BLAZESYM) | ||
- execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/libbpf-tools/blazesym | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- RESULT_VARIABLE CONFIG_RESULT) | ||
- if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
- message(WARNING "Failed to add blazesym source directory to safe.directory") | ||
- endif() | ||
- | ||
- execute_process(COMMAND git submodule update --init --recursive -- libbpf-tools/blazesym | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- RESULT_VARIABLE UPDATE_RESULT) | ||
- if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
- message(WARNING "Failed to update submodule blazesym") | ||
- endif() | ||
-endif() | ||
- | ||
-# populate submodules (libbpf) | ||
-if(NOT CMAKE_USE_LIBBPF_PACKAGE) | ||
- execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- RESULT_VARIABLE CONFIG_RESULT) | ||
- if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
- message(WARNING "Failed to add libbpf source directory to safe.directory") | ||
- endif() | ||
- execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/libbpf-tools/bpftool | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- RESULT_VARIABLE CONFIG_RESULT) | ||
- if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
- message(WARNING "Failed to add bpftool source directory to safe.directory") | ||
- endif() | ||
- | ||
- if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src) | ||
- execute_process(COMMAND git submodule update --init --recursive | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- RESULT_VARIABLE UPDATE_RESULT) | ||
- if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
- message(WARNING "Failed to update submodule libbpf") | ||
- endif() | ||
- else() | ||
- execute_process(COMMAND git diff --shortstat ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/ | ||
- OUTPUT_VARIABLE DIFF_STATUS) | ||
- if("${DIFF_STATUS}" STREQUAL "") | ||
- execute_process(COMMAND git submodule update --init --recursive | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- RESULT_VARIABLE UPDATE_RESULT) | ||
- if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
- message(WARNING "Failed to update submodule libbpf") | ||
- endif() | ||
- else() | ||
- message(WARNING "submodule libbpf dirty, so no sync") | ||
- endif() | ||
- endif() | ||
-endif() | ||
- | ||
# It's possible to use other kernel headers with | ||
# KERNEL_INCLUDE_DIRS build variable, like: | ||
# $ cd <kernel-dir> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters