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

Require Python 3 in bootstrap.py #110439

Closed
wants to merge 1 commit into from
Closed

Conversation

Noratrieb
Copy link
Member

If x.py was executed with Python 2, it tries to reexecute itself with Python 3 if that is available. If it isn't, we now raise an error.

This may break people who have Python 3 in a nonstandard location under a nonstandard name. These people will now be forced to use their-python3 x.py instead of ./x.py.

#110427 (comment)

@rustbot
Copy link
Collaborator

rustbot commented Apr 17, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 17, 2023
@rust-log-analyzer

This comment has been minimized.

If x.py was executed with Python 2, it tries to reexecute itself with
Python 3 if that is available. If it isn't, we now raise an error.

This may break people who have Python 3 in a nonstandard location under
a nonstandard name. These people will now be forced to use
`their-python3 x.py` instead of `./x.py`.
@kadiwa4
Copy link
Contributor

kadiwa4 commented Apr 17, 2023

You can remove the python2 attempts from ./configure and the python from __future__ import ... statements now.

@Mark-Simulacrum
Copy link
Member

I'm pretty sure I recently saw evidence of distributions that don't ship python 3 by default to this day, so I'm not sure this is the right step, particularly given that (as far as I know) python compatibility isn't costing us much, and we expect that in the relatively near term we'll be able to fully remove it.

At minimum, I think I would feel better if we soft-deprecated: issue an error that can be ignored only when setting an environment variable or so, and don't actually remove support for several cycles. I think that would give plenty of opportunity for folks who'd be affected to speak up and help us understand timelines.

Ultimately I tend to feel that we shouldn't bump minimums when it doesn't cost us much to maintain the existing ones, especially for rustc bootstrap.

@Noratrieb
Copy link
Member Author

That's fair. It is a little annoying but probably nothing worth worrying about too much

@Noratrieb Noratrieb closed this Apr 17, 2023
@Noratrieb Noratrieb deleted the python++ branch April 17, 2023 12:09
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 10, 2023
…imulacrum

Add deprecation warning to python versions <3.6 in x.py

Introduced based on conversation on Zulip. This is a repeat of rust-lang#110439 with two changes:

- Warning rather than exit
- Can be suppressed via an environment variable

The min to not get the warning is set to 3.6 because that's a fairly recent "old" version (went EOL in 2021) and it's the first version to support useful modern features like f-strings and type hints.

cc `@Nilstrieb` (author of rust-lang#110439) and `@Mark-Simulacrum` (reviewer of that PR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants