-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Detect python 3 and abort during build #2720
Comments
This addresses issue rust-lang#2720. According to LLVM's documentation, it requires a version of Python between 2.4 and 2.7. Without the proper version, LLVM fails to build with cryptic errors. Prior to this commit, the configure script checked for the `python` command in the environment, but didn't actually check the version, which can cause problems e.g. on Linux distros where the default is Python 3. Now the configure script always prefers to select a more specific version of Python when available, in the order `python2.7` > `python2.6` > `python2` > `python`, and will always check to ensure that the interpreter's version is in the correct range.
This was fixed by the pull req. Closing. |
Turns out this didn't actually fix the problem. At the time I had (wrongly) assumed that the Python version detected during Rust's configure phase was being somehow communicated to LLVM. Looking a bit more closely, I'm not sure that Rust does anything at all with the detected version of Python; perhaps an artifact of an era when Rust had a Python dependency? bbrittain (who rediscovered this bug) and I discussed some hacky workarounds and finally decided that the best thing to do is to send a patch upstream to LLVM (which, despite having a hard dependency on Python 2, never bothers to check for Python 3 and just fails with cryptic errors). Once the fix is accepted we can integrate it into Rust's fork of LLVM. |
(I'm bbrittain) |
Reopening. @cavedweller you have a pull request on brson/llvm that I completely forgot about. Is it still appropriate to merge? Do you know if llvm has the fix upstream yet? Sorry I lost your patch. Feel free to contact me privately if that happens again. |
This does continue to come up. Would be nice to fix definitively. |
LLVM has not fixed it upstream. |
erickt has rebased us onto LLVM HEAD and I rebased your patch on top of that. Hopefully this will get in today. |
sweet, thanks! |
The fix is on incoming. |
LLVM cannot build with python 3 but tries anyway. This has caused confusion a number of times.
The text was updated successfully, but these errors were encountered: