Skip to content
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

Closed
brson opened this issue Jun 25, 2012 · 9 comments
Closed

Detect python 3 and abort during build #2720

brson opened this issue Jun 25, 2012 · 9 comments

Comments

@brson
Copy link
Contributor

brson commented Jun 25, 2012

LLVM cannot build with python 3 but tries anyway. This has caused confusion a number of times.

bstrie added a commit to bstrie/rust that referenced this issue Jun 26, 2012
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.
@graydon
Copy link
Contributor

graydon commented Jun 27, 2012

This was fixed by the pull req. Closing.

@graydon graydon closed this as completed Jun 27, 2012
@bstrie
Copy link
Contributor

bstrie commented Jul 17, 2012

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.

@benbrittain
Copy link

(I'm bbrittain)
LLVM assumes, and has hardcoded, that python means a python2.x. Bleeding-edge linux distros, such as arch, now have 'python' mean python3. It's easy to symlink around, but it really would be better to just fix it.

@brson brson reopened this Sep 29, 2012
@brson
Copy link
Contributor Author

brson commented Sep 29, 2012

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.

@brson
Copy link
Contributor Author

brson commented Sep 29, 2012

This does continue to come up. Would be nice to fix definitively.

@benbrittain
Copy link

LLVM has not fixed it upstream.
frankly, I couldn't find a way to submit the bug fix due to them using SVN...

@brson
Copy link
Contributor Author

brson commented Sep 29, 2012

erickt has rebased us onto LLVM HEAD and I rebased your patch on top of that. Hopefully this will get in today.

@benbrittain
Copy link

sweet, thanks!

@brson
Copy link
Contributor Author

brson commented Oct 1, 2012

The fix is on incoming.

@brson brson closed this as completed Oct 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants