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

Python 2.7 build dependency #59838

Closed
Raatty opened this issue Apr 10, 2019 · 17 comments
Closed

Python 2.7 build dependency #59838

Raatty opened this issue Apr 10, 2019 · 17 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@Raatty
Copy link

Raatty commented Apr 10, 2019

I notice python 2.7 is specified as a dependency to compile rustc. Python2.7 will be end of life next year. Just wondering if anything is actively being done to remove this dependency. This might be something I could work on, just need pointing the right direction.

@hellow554
Copy link
Contributor

hellow554 commented Apr 10, 2019

The complete bootprocess is written in python (2) afaik. Have a look at https://github.com/rust-lang/rust/blob/master/x.py and start working from there on.

@jonas-schievink jonas-schievink added A-build T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 10, 2019
@Raatty
Copy link
Author

Raatty commented Apr 10, 2019

Hmmm a better question, If i was to change all the python related files to python3 most likely breaking python2 compatability completely would that be an acceptable pr?
or is there a specific reason for the python2 choice?

@euclio
Copy link
Contributor

euclio commented Apr 10, 2019

Unfortunately LLVM currently has a hard dependency on Python 2, mostly for debuginfo tests. There's also Mac OS to consider, which doesn't ship Python 3 but ships Python 2.

However, the Rust project is in a pretty good state for Python 3 compatibility, and the project is open to patches that fix Python 3 compatibility while preserving Python 2 compatibility. As far as I know, all scripts in the Rust repository run with both interpreters.

@Raatty
Copy link
Author

Raatty commented Apr 10, 2019

Tbh i havent actually done a test compile yet but if it does acually work on python3 i guess the readme is lieing then, and i checked out llvm the list python >=2.7 as a dependancy. I got but windows and linux i can test on, i gues ill try a test build on both with using python3 and if it does work i think it be pretty safe for me to exit the readme to match llvms req of >=2.7 replcacing what it says about python 3 not working.Because I'm pretty sure 3 is greater than or equal to 2.7

@euclio
Copy link
Contributor

euclio commented Apr 10, 2019

Take a look at these lines from LLVM's CMake configuration:

https://github.com/llvm/llvm-project/blob/827aeb461c227cc5f5fd0e452aa237ae869034bd/llvm/CMakeLists.txt#L668-L682

I wouldn't say the Rust README is lying, it's just that using Python 3 is unsupported. You can try to use Python 3 to build, but there's a caveat that it might not work.

@Raatty
Copy link
Author

Raatty commented Apr 11, 2019

I can confirm that rustc compiles successfully on windows 10 with msvc 2017 python 3.7.3. 166 tests failed tho, all complaining about failing to spawn make. I didn't see any python tracebacks tho.

@jonas-schievink
Copy link
Contributor

Also note that Travis is planning to update the default Python version to 3.6. From #59873:

On April 16th 2019, the default Python version used to run your builds
will be updated from Python 2.7 to Python 3.6
If your builds rely on the current default Python version 2.7, you can
pin your project to continue using this version by specifying it in your
.travis.yml file:

language: python
python: '2.7'

@jonas-schievink jonas-schievink added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Apr 11, 2019
@jonas-schievink
Copy link
Contributor

cc @rust-lang/infra

@pietroalbini
Copy link
Member

That Travis thing shouldn't affect us: they talk about the default language when you use language: python (and we use language: shell), not the preinstalled binaries.

I'll let @Mark-Simulacrum or @alexcrichton comment on ./x.py though.

@jonas-schievink jonas-schievink changed the title python2.7 build dependancy Python 2.7 build dependency Apr 11, 2019
@Mark-Simulacrum
Copy link
Member

We have long held the policy of supporting 3.x in our scripts while keeping backwards compatibility with 2.7.

Do we know what LLVMs plans are for the migration?

@Raatty
Copy link
Author

Raatty commented Apr 11, 2019

to be honest that travis thing is just anouther sign that python3 should be used, its just going to get harder and harder as time goes on to keep using python2.

@jonas-schievink jonas-schievink added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-build labels Apr 21, 2019
@saleemjaffer
Copy link
Contributor

I can pick this up!

@Mark-Simulacrum
Copy link
Member

I don't think we have a concrete plan yet; the next step seems to be to investigate when and how LLVM will be migrating to 3.x python.

@czipperz
Copy link
Contributor

czipperz commented Jul 7, 2019

So should we update the README? It currently says:

python 2.7 (but not 3.x)

Maybe it should be revised to:

python 2.7 (3.x is not supported by the LLVM project for testing)

@h-vetinari
Copy link

h-vetinari commented Jul 29, 2019

Seems that LLVM is supporting python 3 since very recently: cf. https://reviews.llvm.org/D64443 & https://reviews.llvm.org/D64894; the former is part of 9.0.0-rc1 already.

@MatthiasPortzel
Copy link

It seems that this issue is more actively being discussed in issue #65063 and its associated PR, #66605.

@Mark-Simulacrum
Copy link
Member

Closing in favor of #65063.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

10 participants