changed 2 years ago
Linked with GitHub

Running bootstrap without python

  • Add a bootstrap-shim binary + dist component that we package with each nightly. This is just in charge of downloading and running bootstrap itself. In particular, it will:
    • Find and parse the config.toml file, using exactly the Rust logic that the main bootstrap binary uses (i.e. the code is shared).
    • Determine the build directory, from config.toml and flags.
    • Download or build bootstrap as appropriate (based on whether it's been modified since the last bors commit).
    • At no point will python be involved.
  • Change the shell scripts to run rustup component add --toolchain nightly-XXX bootstrap-shim && rustup run nightly-XXX bootstrap-shim "$@", where XXX is a pinned nightly. This shim whould very rarely be updated; downloads don't frequently change. If rustup isn't installed, they should fall back to the current logic that searches for a python version. This should be very little additional code.

Right now the "library" for bootstrap is nearly everything except for a tiny 5-line main function.
I plan to make the "core" code used by both the shim and the main bootstrap binary the library, and only include files like builder.rs and check.rs in the main binary. That will involve:

  • Adding a new bin/bootstrap-shim.rs file
  • Moving the contents of lib.rs to a different file (maybe helpers.rs?)
  • Replacing lib.rs with only mod download; mod config; mod dylib_util; statements

Open questions

  • Q: Doesn't this break the shell wrappers for people without Rustup installed?
    A: Yes. That use case is unsupported; people without rustup will need to keep using x.py.
Select a repo