Closed
Description
Running the command: fd --extension py -E src/llvm-project
gives a list of python files in rust-lang/rust
:
compiler/rustc_codegen_gcc/tools/check_intrinsics_duplicates.py
compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
library/core/src/unicode/printable.py
src/bootstrap/bootstrap.py
src/bootstrap/bootstrap_test.py
src/bootstrap/configure.py
src/ci/cpu-usage-over-time.py
src/ci/docker/host-x86_64/test-various/uefi_qemu_test/run.py
src/ci/docker/scripts/android-sdk-manager.py
src/ci/docker/scripts/fuchsia-test-runner.py
src/ci/github-actions/calculate-job-matrix.py
src/ci/scripts/upload-build-metrics.py
src/etc/dec2flt_table.py
src/etc/gdb_load_rust_pretty_printers.py
src/etc/gdb_lookup.py
src/etc/gdb_providers.py
src/etc/generate-deriving-span-tests.py
src/etc/generate-keyword-tests.py
src/etc/htmldocck.py
src/etc/lldb_batchmode.py
src/etc/lldb_lookup.py
src/etc/lldb_providers.py
src/etc/rust_types.py
src/tools/cargo/ci/generate.py
src/tools/cargo/publish.py
src/tools/clippy/util/versions.py
src/tools/miri/ci/scrape-targets.py
src/tools/miri/test-cargo-miri/run-test.py
src/tools/publish_toolstate.py
tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.py
tests/debuginfo/embedded-visualizer-point.py
tests/debuginfo/embedded-visualizer.py
tests/run-make/debugger-visualizer-dep-info/my_gdb_script.py
tests/run-make/libtest-junit/validate_junit.py
x.py
While there will (probably) always be a need for a little bit of Python in bootstrap
, we should aim to replace misc scripts that really should be Written In Rust. Especially relevant are files like src/etc/htmldocck.py
which is the rustdoc
UI test harness(!); we should rewrite this in Rust.
Extra points:
- I wonder if CI scripts do actually need to be Python?
- Longer term, I wonder if we can require a host installation of Rust (we just download one anyway) and use that for
bootstrap
?
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Ezrashaw commentedon Apr 18, 2023
cc @jyn514 am I crazy about getting rid of Python from bootstrap?
jyn514 commentedon Apr 18, 2023
I don't see the point in rewriting all this code. The main goal of #94829 is so we don't make people deal with python before they start working on the repo; but half the scripts you mentioned are for CI only. What do we get from rewriting them?
Ezrashaw commentedon Apr 18, 2023
I guess maintainability in a way. I mean, why is
compiletest
not written in Python? It then makes sense to have therustdoc
part of it written in the same language, possiblysrc/etc/htmldocck.py
could be rewritten and moved intocompiletest
itself. I'm not saying that this is important, just that it's something that should happen at some point.jyn514 commentedon Apr 18, 2023
I don't think this is worth spending contributor time on. There are other ways people can get started contributing (https://rustc-dev-guide.rust-lang.org/#what-should-i-work-on).
Ezrashaw commentedon Apr 18, 2023
I agree, I think it's just good to have this here as a long-term goal.
compiler-errors commentedon Apr 18, 2023
It's probably worthwhile to first step back and characterize the existing python that we have. I think only once it's clear what python actually can be rewritten should we actually discuss whether it should be rewritten.
e.g. those gdb and llvm scripts can't be rewritten in rust afaict.
Ezrashaw commentedon Apr 18, 2023
Yeah, perhaps CI scripts as well might not be rewritable?
I do think there is some low-hanging fruit here which could have tangible benefits.
thomcc commentedon Apr 18, 2023
I have a rewrite of library/core/src/unicode/printable.py on another machine, moving it into the rest of the table generation code. I'll try to get it up when I'm more easily able to contribute.
thomcc commentedon Jun 4, 2023
Assigning to myself to do this for the unicode tables because @jyn514 indicated it might be the only one that's worth doing (no strong opinions from me, although I don't like that one being python)
tests/run-make/sysroot-crates-are-unstable
from Python to rmake #126231sysroot-crates-are-unstable
Python script to rmake #129111Auto merge of rust-lang#129111 - Zalathar:python-sysroot, r=<try>
Rollup merge of rust-lang#129111 - Zalathar:python-sysroot, r=jieyouxu
16 remaining items