diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2023-09-07 11:45:47 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-09-07 10:39:05 -0700 |
commit | 0bbb4abf18108c456913c8ad7c25af5bf835bb4a (patch) | |
tree | 7885ca7cf2a63e04826ad9e4c2e74093b1da1a0d /dynamic-layers/meta-python | |
parent | 09e448e13853e8bce535967454cf08e62e76c6c0 (diff) | |
download | meta-clang-0bbb4abf18108c456913c8ad7c25af5bf835bb4a.tar.gz |
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 https://github.com/iovisor/bcc/pull/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 <martin.jansa@gmail.com>
Diffstat (limited to 'dynamic-layers/meta-python')
2 files changed, 90 insertions, 0 deletions
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 0000000..1484b6a --- /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 @@ | |||
1 | From 9ee5d9ca2e1ea709571613326b81e8e651fa9f00 Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Jansa <martin.jansa@gmail.com> | ||
3 | Date: Thu, 7 Sep 2023 11:43:25 +0200 | ||
4 | Subject: [PATCH] CMakeLists.txt: don't modify .gitconfig on build host nor try | ||
5 | to update git submodules | ||
6 | |||
7 | * bitbake fetcher will correctly handle safe.directory issues and | ||
8 | blazesym or libbpf submodules are managed by gitsm:// fetcher | ||
9 | we don't want to call git from CMake in do_configure | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
13 | --- | ||
14 | CMakeLists.txt | 62 -------------------------------------------------- | ||
15 | 1 file changed, 62 deletions(-) | ||
16 | |||
17 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
18 | index dfed06e5..ffd88043 100644 | ||
19 | --- a/CMakeLists.txt | ||
20 | +++ b/CMakeLists.txt | ||
21 | @@ -26,68 +26,6 @@ endif() | ||
22 | |||
23 | enable_testing() | ||
24 | |||
25 | -execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR} | ||
26 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
27 | - RESULT_VARIABLE CONFIG_RESULT) | ||
28 | -if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
29 | - message(WARNING "Failed to add root source directory to safe.directory") | ||
30 | -endif() | ||
31 | - | ||
32 | -# populate submodule blazesym | ||
33 | -if(NOT NO_BLAZESYM) | ||
34 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/libbpf-tools/blazesym | ||
35 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
36 | - RESULT_VARIABLE CONFIG_RESULT) | ||
37 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
38 | - message(WARNING "Failed to add blazesym source directory to safe.directory") | ||
39 | - endif() | ||
40 | - | ||
41 | - execute_process(COMMAND git submodule update --init --recursive -- libbpf-tools/blazesym | ||
42 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
43 | - RESULT_VARIABLE UPDATE_RESULT) | ||
44 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
45 | - message(WARNING "Failed to update submodule blazesym") | ||
46 | - endif() | ||
47 | -endif() | ||
48 | - | ||
49 | -# populate submodules (libbpf) | ||
50 | -if(NOT CMAKE_USE_LIBBPF_PACKAGE) | ||
51 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf | ||
52 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
53 | - RESULT_VARIABLE CONFIG_RESULT) | ||
54 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
55 | - message(WARNING "Failed to add libbpf source directory to safe.directory") | ||
56 | - endif() | ||
57 | - execute_process(COMMAND git config --global --add safe.directory ${CMAKE_CURRENT_SOURCE_DIR}/libbpf-tools/bpftool | ||
58 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
59 | - RESULT_VARIABLE CONFIG_RESULT) | ||
60 | - if(CONFIG_RESULT AND NOT CONFIG_RESULT EQUAL 0) | ||
61 | - message(WARNING "Failed to add bpftool source directory to safe.directory") | ||
62 | - endif() | ||
63 | - | ||
64 | - if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src) | ||
65 | - execute_process(COMMAND git submodule update --init --recursive | ||
66 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
67 | - RESULT_VARIABLE UPDATE_RESULT) | ||
68 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
69 | - message(WARNING "Failed to update submodule libbpf") | ||
70 | - endif() | ||
71 | - else() | ||
72 | - execute_process(COMMAND git diff --shortstat ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/ | ||
73 | - OUTPUT_VARIABLE DIFF_STATUS) | ||
74 | - if("${DIFF_STATUS}" STREQUAL "") | ||
75 | - execute_process(COMMAND git submodule update --init --recursive | ||
76 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
77 | - RESULT_VARIABLE UPDATE_RESULT) | ||
78 | - if(UPDATE_RESULT AND NOT UPDATE_RESULT EQUAL 0) | ||
79 | - message(WARNING "Failed to update submodule libbpf") | ||
80 | - endif() | ||
81 | - else() | ||
82 | - message(WARNING "submodule libbpf dirty, so no sync") | ||
83 | - endif() | ||
84 | - endif() | ||
85 | -endif() | ||
86 | - | ||
87 | # It's possible to use other kernel headers with | ||
88 | # KERNEL_INCLUDE_DIRS build variable, like: | ||
89 | # $ cd <kernel-dir> | ||
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 105995d..230c4de 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 \ | |||
30 | file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ | 30 | file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ |
31 | file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ | 31 | file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ |
32 | file://0001-tests-cc-Use-c-14-standard.patch \ | 32 | file://0001-tests-cc-Use-c-14-standard.patch \ |
33 | file://0001-CMakeLists.txt-don-t-modify-.gitconfig-on-build-host.patch \ | ||
33 | file://run-ptest \ | 34 | file://run-ptest \ |
34 | file://ptest_wrapper.sh \ | 35 | file://ptest_wrapper.sh \ |
35 | " | 36 | " |