diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch new file mode 100644 index 00000000..1484b6ac --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch @@ -0,0 +1,89 @@ +From 9ee5d9ca2e1ea709571613326b81e8e651fa9f00 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +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 +--- + 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 diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.28.0.bb b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.28.0.bb index 105995d2..230c4dec 100644 --- a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.28.0.bb +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.28.0.bb @@ -30,6 +30,7 @@ SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https \ file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ file://0001-tests-cc-Use-c-14-standard.patch \ + file://0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch \ file://run-ptest \ file://ptest_wrapper.sh \ "