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

Default to running python3 for x.py #95514

Closed
wants to merge 1 commit into from
Closed

Conversation

djc
Copy link
Contributor

@djc djc commented Mar 31, 2022

On my macOS machine, there is no python binary on the PATH. In this day
(15 months after Python 2 has gone EOL), it doesn't seem crazy to
default to Python3. Users who don't have python3 available could
supposedly still run python x.py manually.

This assumes that any environment where python is at version 3,
python3 is also on the PATH.

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2022
On my macOS machine, there is no python binary on the PATH. In this day
and age (15 months after Python 2 has gone EOL), it doesn't seem crazy
to default to Python3. Users who don't have python3 available could
supposedly still run `python x.py` manually.

This assumes that any environment where `python` is at version 3,
`python3` is also on the PATH.
@jyn514
Copy link
Member

jyn514 commented Mar 31, 2022

@djc it's not that simple unfortunately #71818 (comment)

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
error: make failed
status: exit status: 2
command: "make"
--- stdout -------------------------------
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros  src/proc.rs --crate-name foobar_macro --edition=2021 --crate-type proc-macro --emit=dep-info,link
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros  src/lib.rs --crate-name foobar --edition=2021 --crate-type lib --emit=dep-info,link
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc' -L /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib examples/ex.rs --crate-name ex --crate-type bin --output "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros/rustdoc" \
 --extern foobar=/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros/libfoobar.rlib --extern foobar_macro=/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros/libfoobar_macro.so \
 -Z unstable-options --scrape-examples-output-path /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros/ex.calls --scrape-examples-target-crate foobar
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc' -L /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib src/lib.rs --crate-name foobar --crate-type lib --output "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros/rustdoc" \
 -Z unstable-options --with-examples /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros/ex.calls
'/usr/bin/python2.7' '/checkout/src/etc/htmldocck.py' "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/rustdoc-scrape-examples-macros/rustdoc-scrape-examples-macros/rustdoc" src/lib.rs
--- stderr -------------------------------
Traceback (most recent call last):
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 570, in <module>
    check(sys.argv[1], get_commands(rust_test_path))
  File "/checkout/src/etc/htmldocck.py", line 554, in check
    check_command(c, cache)
  File "/checkout/src/etc/htmldocck.py", line 473, in check_command
    tree = cache.get_tree(c.args[0])
  File "/checkout/src/etc/htmldocck.py", line 342, in get_tree
    raise RuntimeError('Cannot parse an HTML file {!r}: {}'.format(path, e))
RuntimeError: Cannot parse an HTML file 'foobar/fn.f.html': u'pr'
make: *** [Makefile:11: all] Error 1



failures:

@ChrisDenton
Copy link
Member

On Windows, the problem is using the official Python installer with a shell that emulates a Linux environment (such as MSYS2 or git bash). This combination doesn't work because the official installer does not create a python3 alias.

@djc
Copy link
Contributor Author

djc commented Apr 4, 2022

Okay, just going to close this then. The Windows situation seems totally broken.

@djc djc closed this Apr 4, 2022
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants