-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[cmake] Pass PYTHON_EXECUTABLE to native builds #163574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
JDevlieghere
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've ran into this too when cross compiling. LGTM.
Please include in the PR description one example of how the user might have specified that Python. So it is a bit more clear and maybe someone grepping through commits trying to solve their own problem in future will recognise the option. |
DavidSpickett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever I cross build lldb I disable Python so I haven't seen this happen myself, but I do see the logic of the change.
The Python the user specified is still a build-host Python, so it makes sense to use it for the build-host compatible build of native tools.
This is not like if I was cross compiling and said "over here is my cross compiled library you should use". We wouldn't use that in the native tools because it's for the other architecture.
This LGTM assuming I didn't misunderstand any of that.
|
Updated. You've not misunderstood. My impression is this was triggered during the great py2/py3 migration disaster, but I can see a number of edge cases where it's a problem. |
|
I don't think there is a review team for general cmake issues, so let's give this a couple of days in case anyone does have comments. |
|
Gentle reminder that this is still open. |
Ensure that the nested native build uses the same python interpreter as the main build, in case the python that CMake detects first is not the python that the user has specified explicitly. Original fix by Anuj Mittal <[email protected]>.
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/18483 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/12761 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/166/builds/3667 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/42/builds/6849 Here is the relevant piece of the build log for the reference |
Ensure that the nested native build uses the same python interpreter as the main build, in case the python that CMake detects first is not the python that the user has specified explicitly.
For example, if the person building LLVM wants to use a different python interpreter to build (eg, testing the build with
python3.14whenpython3is a link topython3.8, or the default python doesn't have development headers available) then they could add-DPYTHON_EXECUTABLE=python3.14when invoking CMake. This should be forwarded to the native CMake build to ensure that the same python is used.Original fix by Anuj Mittal [email protected].