Commit graph

315 commits

Author SHA1 Message Date
KaDiWa
b925031c5f
bootstrap: --help handling 2023-01-30 15:58:37 +01:00
KaDiWa
385dbff9e5
bootstrap script: slight cleanup 2023-01-30 15:58:35 +01:00
chansuke
ac3ec77f07 Fix woriding from rustbuild to bootstrap 2023-01-27 01:21:21 +09:00
J Haigh
1a993611d2
Revert "warn newer available version of the x tool" 2023-01-11 11:11:56 -07:00
DebugSteven
a917308d91 remove commented out old code 2022-12-31 11:38:44 -07:00
DebugSteven
b2cd3374e9 remove leading comma from macro expansion 2022-12-31 11:37:13 -07:00
Marcus Calhoun-Lopez
480297d216 Respect --set=target.platform during build
Avoid quoting targets that do not contain a period.
See 1532fd8cd0

`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.
Undo parts of d1291dc8b4
2022-12-29 12:22:49 -07:00
Joe Neeman
66180dfad8 Run patchelf also on rust-analyzer-proc-macro-srv. 2022-11-29 14:36:52 -06:00
bors
5253b0a0a1 Auto merge of #101949 - matthiaskrgr:rollup-xu5cqnd, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #101093 (Initial version of 1.64 release notes)
 - #101713 (change AccessLevels representation)
 - #101821 (Bump Unicode to version 15.0.0, regenerate tables)
 - #101826 (Enforce "joined()" and "joined_with_noop()" test)
 - #101835 (Allow using vendoring when running bootstrap from outside the source root)
 - #101942 (Revert "Copy stage0 binaries into stage0-sysroot")
 - #101943 (rustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-17 22:04:28 +00:00
Chris Wailes
d1291dc8b4 Improve handing of env vars during bootstrap process
This CL modifies the handing of env vars during the bootstrap process in
two ways:
1. Replaces '-' characters with '_' characters in target names to
   increase compatibility with different shells
2. Passes Stage0 snapshot compiler related env vars to early invocations
   of Cargo
2022-09-16 15:03:11 -07:00
Joshua Nelson
63b8d9b689 Allow using vendoring when running bootstrap from outside the current working directory 2022-09-14 22:02:13 -05:00
Matthias Krüger
b05f97d594
Rollup merge of #100852 - Samyak2:samyak/100459, r=Mark-Simulacrum
Use `getuid` to check instead of `USER` env var in rustbuild

This makes it consistent with `x.py` as changed in #95671

Fixes #100459
2022-09-01 21:37:08 +02:00
Dezhi Wu
b1430fb7ca Fix a bunch of typo
This PR will fix some typos detected by [typos].

I only picked the ones I was sure were spelling errors to fix, mostly in
the comments.

[typos]: https://github.com/crate-ci/typos
2022-08-31 18:24:55 +08:00
Samyak Sarnayak
b9c47f624e
Use getuid to check instead of USER env var in rustbuild
This makes it consistent with `x.py` as changed in #95671

Fixes #100459
2022-08-26 20:14:38 +05:30
Chris Denton
9ac4a4e67a
Fix typo in src/bootstrap/bootstrap.py
Co-authored-by: Marco Colombo <mar.colombo13@gmail.com>
2022-07-05 09:06:43 +01:00
Chris Denton
b1541ff198
bootstrap.py: Always use .exe for Windows
This ensure that it will run the Windows executable if other files in the directory (such as Linux executables) have the same file name minus the extension.
2022-07-04 15:57:10 +01:00
bors
0e21a27075 Auto merge of #98373 - joshtriplett:bootstrap-locking, r=jyn514
Move locking from bootstrap.py to rust bootstrap, using fd-lock

Helps with https://github.com/rust-lang/rust/issues/94829.
2022-07-03 16:29:09 +00:00
Thom Chiovoloni
79f8dc0b89
Add a --build-dir flag to rustbuild 2022-06-30 15:50:48 -07:00
Josh Triplett
5a30316fc1 Move locking from bootstrap.py to rust bootstrap, using fd-lock 2022-06-27 10:57:31 -07:00
Joshua Nelson
028fd634bb Respect --color when building rustbuild itself 2022-06-26 04:44:47 -05:00
Joshua Nelson
345eb14f6c Remove vendoring support when building from git sources
This is difficult to support without submodule handling in bootstrap.py, because cargo will refuse
to vendor sources unless it knows the Cargo.toml files of all tools in tree. Moving vendor support
to rustbuild means that rustbuild will be built without vendoring.

Rather than trying to solve this, just remove support altogether and require
people to use `rustc-src` if they want vendoring (or run `cargo vendor` manually).
2022-06-21 23:42:56 -05:00
Joshua Nelson
9cde0f7877 Fully remove submodule handling from bootstrap.py
These submodules were previously updated in python because Cargo gives a hard error if toml files
are missing from the workspace:

```
error: failed to load manifest for workspace member `/home/jnelson/rust-lang/rust/src/tools/rls`

Caused by:
  failed to read `/home/jnelson/rust-lang/rust/src/tools/rls/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
failed to run: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /home/jnelson/rust-lang/rust/src/bootstrap/Cargo.toml
```

However, bootstrap doesn't actually need to be part of the workspace.
Remove it so we can move submodule handling fully to Rust, avoiding duplicate code between Rust and Python.

Note that this does break `cargo run`; it has to be `cd src/bootstrap && cargo run` now.
Given that we're planning to make the main entrypoint a shell script (or rust binary),
I think this is a good tradeoff for reduced complexity in bootstrap.py.
2022-06-21 22:55:43 -05:00
Pietro Albini
c1a0f49e9f
keep the same config values in stage0 between invocations
This commit allows users to change the contents of the "config" key in
src/stage0.json without having it overridden the next time the
bump-stage0 tool is executed.
2022-06-09 17:54:11 +02:00
Joshua Nelson
81f511cc2b Move beta rustfmt downloads to rustbuild 2022-06-07 10:16:55 -05:00
bors
6dadfc06fe Auto merge of #93717 - pietroalbini:pa-ci-profiler, r=Mark-Simulacrum
Add build metrics to rustbuild

This PR adds a new module of rustbuild, `ci_profiler`, whose job is to gather as much information as possible about the CI build as possible and store it in a JSON file uploaded to `ci-artifacts`. Right now for each step it collects:

* Type name and debug representation of the `Step` object.
* Duration of the step (excluding child steps).
* Systemwide CPU stats for the duration of the step (both single core and all cores).
* Which child steps were executed.

This is capable of replacing both the scripts to collect CPU stats and the `[TIMING]` lines in build logs (not yet removed, until we port our tooling to use the CI profiler). The format is also extensible to be able in the future to collect more information.

r? `@Mark-Simulacrum`
2022-06-05 01:35:03 +00:00
binggh
c0f18f9412 Re-add help_on_error for download-ci-llvm
Remove dead code

Missing }

./x.py fmt

Remove duplicate check

Recursively remove all usage of help_on_error
2022-05-29 23:16:10 +08:00
Joshua Nelson
00bb4df1fb Remove download-rustc handling from bootstrap.py 2022-05-25 17:32:53 -05:00
Joshua Nelson
53bf24c82b Move download-rustc from bootstrap.py to rustbuild
- Remove download-rustc handling from bootstrap.py
- Allow a custom `pattern` in `builder.unpack()`
- Only download rustc once another part of bootstrap depends on it.

  This is somewhat necessary since the download functions rely on having a full
  `Builder`, which isn't available until after config parsing finishes.
2022-05-25 17:32:31 -05:00
Yuki Okushi
9845a41233
Rollup merge of #97290 - jyn514:fast-submodules, r=Mark-Simulacrum
Turn on `fast_submodules` unconditionally

I don't know why anyone would turn this off; doing so makes builds much slower (nearly a 60x slowdown according to #49057).
Remove the option to do so, which makes bootstrap a little easier to maintain.

Bootstrap continues to allow you to manage submodules manually by setting `submodules = false`.
2022-05-24 12:18:32 +09:00
Joshua Nelson
5df276eef5 Turn on fast_submodules unconditionally
I don't know why anyone would turn this off; doing so makes builds much slower (nearly a 60x slowdown according to #49057).
Remove the option to do so, which makes bootstrap a little easier to maintain.

Bootstrap continues to allow you to manage submodules manually by setting `submodules = false`.
2022-05-23 21:17:09 -05:00
Jack Huey
b4c17d43a6
Rollup merge of #97277 - jyn514:no-unstable-for-bootstrap, r=Mark-Simulacrum
Avoid accidentally enabling unstable features in compilers (take 2)

This allows rustbuild to control whether crates can use nightly features or not.
It also prevents rustbuild from using nightly features itself.

This is #92261, but I fixed the CI error.
2022-05-22 11:37:42 -04:00
Joshua Nelson
b0ea4e74cb Avoid accidentally enabling unstable features in compilers (take 2)
This allows rustbuild to control whether crates can use nightly features or not.
It also prevents rustbuild from using nightly features itself.
2022-05-22 08:31:50 -05:00
bors
0be8768323 Auto merge of #96602 - TApplencourt:patch-1, r=Mark-Simulacrum
boostrap.py use curl by default

Fixes #61611
2022-05-15 04:52:16 +00:00
bors
30046ce1fe Auto merge of #96457 - yungkneez:fix-bootstrap, r=Mark-Simulacrum
Initialize rust-analyzer submodule on bootstrap

Fixes #96456
2022-05-08 06:22:21 +00:00
Pietro Albini
53965d3daf
add build metrics, to gather ci stats from x.py
This tool will generate a JSON file with statistics about each
individual step to disk. It will be used in rust-lang/rust's CI to
replace the mix of scripts and log scraping we currently have to gather
this data.
2022-05-02 21:33:01 +02:00
Thomas Applencourt
ad7dbe18da Use curl by default 2022-05-01 21:43:12 -05:00
yungkneez
2878f98672 Initialize rust-analyzer submodule on bootstrap 2022-05-01 17:36:39 -07:00
Joshua Nelson
93c1a941bb Move download-ci-llvm to rustbuild
This attempts to keep the logic as close to the original python as possible.
`probably_large` has been removed, since it was always `True`, and UTF-8 paths are no longer supported when patching files for NixOS.
I can readd UTF-8 support if desired.

Note that this required making `llvm_link_shared` computed on-demand,
since we don't know whether it will be static or dynamic until we download LLVM from CI.
2022-04-24 19:40:13 -05:00
Dylan DPC
9a2d14c39a
Rollup merge of #95809 - ytmimi:llvm_stamp_typo, r=Mark-Simulacrum
Fix typo in bootstrap.py
2022-04-19 14:43:15 +02:00
Dylan DPC
d449a63e93
Rollup merge of #95885 - gimbles:patch-1, r=Mark-Simulacrum
Improve error message in case of missing checksum

# Fixes
#94217
2022-04-13 17:35:32 +02:00
gimbles
71ad003bf6 Improve error message when there's no checksum 2022-04-13 13:54:22 +05:30
fee1-dead
ae068e78c0
Rollup merge of #95671 - gimbles:master, r=Mark-Simulacrum
feat: Allow usage of sudo [while not accessing root] in x.py

# Fixes
This PR should fix #93344
# Info
Allows usage of sudo (while not accessing root) in x.py
2022-04-12 22:44:41 +10:00
bors
90ca44752a Auto merge of #95796 - bzEq:bzEq/curl-redirect, r=Dylan-DPC
[bootstrap.py] Instruct curl to follow redirect

Some mirror RUSTUP_DIST_SERVER (like https://mirrors.sjtug.sjtu.edu.cn/rust-static) perform redirection when downloading
stage0 compiler. Curl should be able to follow that.
2022-04-11 18:59:40 +00:00
gimbles
386ca6acc3 Allow usage of sudo while not accessing root 2022-04-10 20:51:11 +05:30
Eric Huss
ca9ef27ed1 Check for git submodules in non-git source tree. 2022-04-09 08:10:34 -07:00
Yacin Tmimi
1433bfd745 Fix typo in bootstrap.py 2022-04-08 16:47:34 -04:00
Kai Luo
95b1d71a1b [bootstrap.py] Instruct curl to follow redirect
Some RUSTUP_DIST_SERVER perform redirection when downloading
stage0 compiler. Curl should be able to follow that.
2022-04-08 14:51:05 +08:00
Benjamin Herr
76756ccb3a bootstrap.py: nixos check in /etc/os-release with quotes
Per https://www.freedesktop.org/software/systemd/man/os-release.html,

> Variable assignment values must be enclosed in double or single quotes
> if they include spaces, semicolons or other special characters outside
> of A–Z, a–z, 0–9. (Assignments that do not include these special
> characters may be enclosed in quotes too, but this is optional.)

So, past `ID=nixos`, let's also check for `ID='nixos'` and `ID="nixos"`.

One of these is necessary between nixos/nixpkgs#162168 and
nixos/nixpkgs#164068, but this seems more correct either way.
2022-03-23 13:00:38 -07:00
Joshua Nelson
4d56f09650 Fallback to top-level config.toml if not present in current directory
This also preserves the behavior where x.py will only give a hard error on a missing config file
if it was configured through `--config` or RUST_BOOTSTRAP_CONFIG.
It also removes the top-level fallback for everything except the default path.
2022-03-09 22:35:43 -06:00
Joshua Nelson
62b522ec3a Don't depend on python for RUST_BOOTSTRAP_CONFIG 2022-03-07 17:06:11 -05:00