Skip to contentSkip to conversation

clang: make sure python3 is used for native builds

PATCH In review Martin Jansa 2 participants 5 messages Sep 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clang: make sure python3 is used for native builds

* with /usr/bin/python -> python2.7 on the host, I was seeing:
CMake Error at work-shared/llvm-project-source-9.0.0-r0/git/lldb/cmake/modules/LLDBConfig.cmake:229 (message):
Found incompatible Python interpreter (2.7) and Python libraries (3.7)
Call Stack (most recent call first):

    work-shared/llvm-project-source-9.0.0-r0/git/lldb/CMakeLists.txt:20 (include)
---
 recipes-devtools/clang/clang_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-devtools/clang/clang_git.bb +2 -1
index 3906ef1..880307f 100644
@@ -17,7 +17,7 @@ BUILD_RANLIB_class-nativesdk = "llvm-ranlib"
 BUILD_NM_class-nativesdk = "llvm-nm"
 LDFLAGS_append_class-nativesdk = " -fuse-ld=gold"
 
-inherit cmake cmake-native python3-dir
+inherit cmake cmake-native python3-dir python3native
 
 OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
 
@@ -102,6 +102,7 @@ EXTRA_OECMAKE_append_class-native = "\
                   -DBOOTSTRAP_LLVM_ENABLE_LLD=ON \
                   -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \
                   -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \
+                  -DPYTHON_EXECUTABLE='${PYTHON}' \
 "
 EXTRA_OECMAKE_append_class-nativesdk = "\
                   -DCMAKE_CROSSCOMPILING:BOOL=ON \
Signature · 1 line
2.17.1
#1 lore raw

Please ignore this one.

Now I've noticed that it was like this before "clang: Let cmake figure out python version for native" so I'll have to find why it doesn't work for me instead of reverting your recent changes.

Quoted 42 lines · Martin Jansa

* with /usr/bin/python -> python2.7 on the host, I was seeing:
CMake Error at
work-shared/llvm-project-source-9.0.0-r0/git/lldb/cmake/modules/LLDBConfig.cmake:229 (message):
Found incompatible Python interpreter (2.7) and Python libraries (3.7)
Call Stack (most recent call first):

    work-shared/llvm-project-source-9.0.0-r0/git/lldb/CMakeLists.txt:20

(include)

---
 recipes-devtools/clang/clang_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-devtools/clang/ renamed from recipes-devtools/clang/clang_git.bb +0 -0

clang_git.bb
index 3906ef1..880307f 100644

recipes-devtools/clang/clang_git.bb +2 -1
@@ -17,7 +17,7 @@ BUILD_RANLIB_class-nativesdk = "llvm-ranlib"
 BUILD_NM_class-nativesdk = "llvm-nm"
 LDFLAGS_append_class-nativesdk = " -fuse-ld=gold"
 
-inherit cmake cmake-native python3-dir
+inherit cmake cmake-native python3-dir python3native
 
 OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
 
@@ -102,6 +102,7 @@ EXTRA_OECMAKE_append_class-native = "\
                   -DBOOTSTRAP_LLVM_ENABLE_LLD=ON \
                   -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \
 
 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}'
 \
+                  -DPYTHON_EXECUTABLE='${PYTHON}' \
 "
 EXTRA_OECMAKE_append_class-nativesdk = "\
                   -DCMAKE_CROSSCOMPILING:BOOL=ON \

--
2.17.1

#2 lore raw
Quoted 7 lines · Martin Jansa

Please ignore this one.

Now I've noticed that it was like this before "clang: Let cmake figure out python version for native" so I'll have to find why it doesn't work for me instead of reverting your recent changes.

this change is fine, there is another problem especially when doing stage2 build where it does not respect python settings from env so I was hoping that it will help to
let it detect python from hosttools which it does but I think this patch makes things better
I would certainly think lets keep it. I am also mulling to disable stage2, it will mean that
we dont use LTO to build the compiler itself it might become a bit slow to compile programs

can you send this as github pull please since CI is triggered on pulls there ?

Quoted 50 lines
Quoted 38 lines · Martin Jansa

* with /usr/bin/python -> python2.7 on the host, I was seeing:
CMake Error at
work-shared/llvm-project-source-9.0.0-r0/git/lldb/cmake/modules/LLDBConfig.cmake:229 (message):
Found incompatible Python interpreter (2.7) and Python libraries (3.7)
Call Stack (most recent call first):

    work-shared/llvm-project-source-9.0.0-r0/git/lldb/CMakeLists.txt:20

(include)

---
 recipes-devtools/clang/clang_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-devtools/clang/ renamed from recipes-devtools/clang/clang_git.bb +0 -0

clang_git.bb
index 3906ef1..880307f 100644

recipes-devtools/clang/clang_git.bb +2 -1
@@ -17,7 +17,7 @@ BUILD_RANLIB_class-nativesdk = "llvm-ranlib"
 BUILD_NM_class-nativesdk = "llvm-nm"
 LDFLAGS_append_class-nativesdk = " -fuse-ld=gold"
 
-inherit cmake cmake-native python3-dir
+inherit cmake cmake-native python3-dir python3native
 
 OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
 
@@ -102,6 +102,7 @@ EXTRA_OECMAKE_append_class-native = "\
                   -DBOOTSTRAP_LLVM_ENABLE_LLD=ON \
                   -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \
 
 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}'
 \
+                  -DPYTHON_EXECUTABLE='${PYTHON}' \
 "
 EXTRA_OECMAKE_append_class-nativesdk = "\
                   -DCMAKE_CROSSCOMPILING:BOOL=ON \
Quoted 4 lines

--
2.17.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#3 lore raw

OK, will do, README should be updated as well as it says to send individual patches to ML :).

Quoted 81 lines · Khem Raj
Quoted 4 lines · Martin Jansa

Please ignore this one.

Now I've noticed that it was like this before "clang: Let cmake figure

out

Quoted 1 line

python version for native" so I'll have to find why it doesn't work for

me

Quoted 2 lines

instead of reverting your recent changes.

this change is fine, there is another problem especially when doing stage2 build
where it does not respect python settings from env so I was hoping that it will help to
let it detect python from hosttools which it does but I think this patch makes things better
I would certainly think lets keep it. I am also mulling to disable stage2, it will mean that
we dont use LTO to build the compiler itself it might become a bit slow to compile programs

can you send this as github pull please since CI is triggered on pulls there ?

Quoted 6 lines
Quoted 3 lines · Martin Jansa

* with /usr/bin/python -> python2.7 on the host, I was seeing:
CMake Error at

work-shared/llvm-project-source-9.0.0-r0/git/lldb/cmake/modules/LLDBConfig.cmake:229

Quoted 2 lines
Quoted 2 lines

(message):
Found incompatible Python interpreter (2.7) and Python libraries

(3.7)

Quoted 10 lines

Review

Quoted 10 lines

Call Stack (most recent call first):

    work-shared/llvm-project-source-9.0.0-r0/git/lldb/CMakeLists.txt:20

(include)

---
 recipes-devtools/clang/clang_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/recipes-devtools/clang/

Quoted 11 lines
Quoted 11 lines

clang_git.bb
index 3906ef1..880307f 100644

recipes-devtools/clang/clang_git.bb +1 -1
@@ -17,7 +17,7 @@ BUILD_RANLIB_class-nativesdk = "llvm-ranlib"
 BUILD_NM_class-nativesdk = "llvm-nm"
 LDFLAGS_append_class-nativesdk = " -fuse-ld=gold"
 
-inherit cmake cmake-native python3-dir
+inherit cmake cmake-native python3-dir python3native
 
Quoted 7 lines

recipes-devtools/clang/clang_git.bb EXTRA_OECMAKE_append_class-native = "\ · line 105

Quoted 7 lines
recipes-devtools/clang/clang_git.bb +0 -0
 OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
 
@@ -102,6 +102,7 @@ EXTRA_OECMAKE_append_class-native = "\
                   -DBOOTSTRAP_LLVM_ENABLE_LLD=ON \
                   -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \
 
 

-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}'

Quoted 14 lines
Quoted 9 lines
recipes-devtools/clang/clang_git.bb +1 -0
 \
+                  -DPYTHON_EXECUTABLE='${PYTHON}' \
 "
 EXTRA_OECMAKE_append_class-nativesdk = "\
                   -DCMAKE_CROSSCOMPILING:BOOL=ON \

--
2.17.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#4 lore raw
Quoted 2 lines · Martin Jansa

OK, will do, README should be updated as well as it says to send individual patches to ML :).

right. Send another patch to update that

Quoted 74 lines · Khem Raj
Quoted 72 lines · Martin Jansa
Quoted 7 lines

Please ignore this one.

Now I've noticed that it was like this before "clang: Let cmake figure out python version for native" so I'll have to find why it doesn't work for me instead of reverting your recent changes.

this change is fine, there is another problem especially when doing stage2 build where it does not respect python settings from env so I was hoping that it will help to
let it detect python from hosttools which it does but I think this patch makes things better
I would certainly think lets keep it. I am also mulling to disable stage2, it will mean that
we dont use LTO to build the compiler itself it might become a bit slow to compile programs

can you send this as github pull please since CI is triggered on pulls there ?

Quoted 50 lines
Quoted 38 lines · Martin Jansa

* with /usr/bin/python -> python2.7 on the host, I was seeing:
CMake Error at
work-shared/llvm-project-source-9.0.0-r0/git/lldb/cmake/modules/LLDBConfig.cmake:229 (message):
Found incompatible Python interpreter (2.7) and Python libraries (3.7)
Call Stack (most recent call first):

    work-shared/llvm-project-source-9.0.0-r0/git/lldb/CMakeLists.txt:20

(include)

---
 recipes-devtools/clang/clang_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-devtools/clang/ renamed from recipes-devtools/clang/clang_git.bb +0 -0

clang_git.bb
index 3906ef1..880307f 100644

recipes-devtools/clang/clang_git.bb +2 -1
@@ -17,7 +17,7 @@ BUILD_RANLIB_class-nativesdk = "llvm-ranlib"
 BUILD_NM_class-nativesdk = "llvm-nm"
 LDFLAGS_append_class-nativesdk = " -fuse-ld=gold"
 
-inherit cmake cmake-native python3-dir
+inherit cmake cmake-native python3-dir python3native
 
 OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
 
@@ -102,6 +102,7 @@ EXTRA_OECMAKE_append_class-native = "\
                   -DBOOTSTRAP_LLVM_ENABLE_LLD=ON \
                   -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \
 
 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}'
 \
+                  -DPYTHON_EXECUTABLE='${PYTHON}' \
 "
 EXTRA_OECMAKE_append_class-nativesdk = "\
                   -DCMAKE_CROSSCOMPILING:BOOL=ON \
Quoted 4 lines

--
2.17.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel