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

Port rust python scripts to python3 #65063

Closed
GuillaumeGomez opened this issue Oct 3, 2019 · 7 comments · Fixed by #66605
Closed

Port rust python scripts to python3 #65063

GuillaumeGomez opened this issue Oct 3, 2019 · 7 comments · Fixed by #66605
Assignees
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. 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

@GuillaumeGomez
Copy link
Member

Since python2 support will stop at the end of the year, I think it's time to move on. Will send the PR tomorrow.

@GuillaumeGomez GuillaumeGomez self-assigned this Oct 3, 2019
@jonas-schievink jonas-schievink added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 3, 2019
@Mark-Simulacrum
Copy link
Member

We will want to also track LLVM pretty closely here.

@cuviper
Copy link
Member

cuviper commented Oct 3, 2019

AFAIK they all work with python3 already, so this would mostly be a matter of defaults, like the #! line in x.py and the try commands in the configure script. Plus CI updates to install python3 at all.

Installed scripts like rust-gdb and rust-lldb need to match whatever is used by that debugger on the target system -- it's best IMO if we can keep those bilingual for python 2/3. For example, while RHEL 7.7 does have python3 now, its gdb is built against libpython2.7, and that won't change.

@Mark-Simulacrum
Copy link
Member

So we probably want to switch our CI and such to use python 3 by default but be careful when accepting patches to ensure compat with python 2, right? Is that a correct read of the situation?

@cuviper
Copy link
Member

cuviper commented Oct 4, 2019

Yep -- maybe even leave one CI deliberately on python2.7 to be sure.

@GuillaumeGomez
Copy link
Member Author

@cuviper We still have some __future imports so not sure we're fully compatible with python3. In any case, we can enforce it.

@cuviper
Copy link
Member

cuviper commented Oct 4, 2019

The __future__ module still exists in 3:
https://docs.python.org/3.7/library/__future__.html

@GuillaumeGomez
Copy link
Member Author

Oh? I didn't know this, thanks for the info! Anyway, doesn't hurt to get rid of it in full python3 source code. :)

tmandry added a commit to tmandry/rust that referenced this issue Nov 14, 2019
Make a test compatible across python versions.

Progress on rust-lang#65063

This PR allows this test to work on both python2 and python3, and it also allows `./x.py test` to fully complete on my system without python2 installed at all.
tmandry added a commit to tmandry/rust that referenced this issue Nov 14, 2019
Make a test compatible across python versions.

Progress on rust-lang#65063

This PR allows this test to work on both python2 and python3, and it also allows `./x.py test` to fully complete on my system without python2 installed at all.
bors added a commit that referenced this issue Nov 18, 2019
Make a test compatible across python versions.

Progress on #65063

This PR allows this test to work on both python2 and python3, ~~and it also allows `./x.py test` to fully complete on my system without python2 installed at all.~~
@bors bors closed this as completed in 9682f0e Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. 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

Successfully merging a pull request may close this issue.

4 participants