about summary refs log tree commit diff
path: root/src/bootstrap/download.rs
AgeCommit message (Collapse)AuthorLines
2023-07-30bootstrap: inline format!() argsMatthias Krüger-4/+4
2023-07-15Rollup merge of #113643 - jyn514:try-run, r=ozkanonurjyn-18/+15
bootstrap: Clean up try_run r? `@ozkanonur` since you reviewed `@GuillaumeGomez's` PR i recommend reviewing commit-by-commit
2023-07-15Rollup merge of #113644 - jyn514:bootstrap-cleanups, r=albertlarsan68Matthias Krüger-1/+1
misc bootstrap cleanups - rename `detail_exit_macro` to `exit` - remove unnecessary `Builder::new_standalone` function - support `x suggest` with build-metrics
2023-07-15Deduplicate `Builder::try_run` and mark `Config::try_run` as deprecatedjyn-18/+15
This does three things: 1. Remove `forward!(Build, fn try_run())`. Having `try_run` behave differently as a free function than an associated function is confusing, and `Builder::try_run` is a very desirable name. 2. Move `test::try_run` and `run::try_run` to `Builder::try_run`. These functions are different than `Config::try_run` - they delay the failure and print it out at the end of the build. 3. Mark `Config::try_run` as deprecated to encourage people to use `Builder::try_run` instead.
2023-07-14put configure behind a groupjyn-1/+1
2023-07-14don't print download progress in CIjyn-2/+7
2023-07-13Rename `detail_exit_macro` to `exit`jyn-1/+1
`detail` and `macro` weren't adding any info.
2023-07-12Auto merge of #113214 - GuillaumeGomez:try-run-fix, r=ozkanonur,jyn514bors-1/+1
Don't fail early if `try_run` returns an error Fixes https://github.com/rust-lang/rust/issues/113208. Follow-up of #112962. r? `@jyn514`
2023-07-11Move `ci_rustc_dir` to Config and use it consistentlyjyn-1/+1
2023-07-11Don't fail early if `try_run` returns an errorGuillaume Gomez-1/+1
2023-07-05allow mixing `llvm.assertions` and `download-rustc`jyn-8/+22
by using `rustc-builds-alt` if download-rustc is set this also changes the download code to use a separate build/cache/ directory and .rustc-stamp stamp file depending on whether assertions are enabled.
2023-07-05Make `--dry-run` more useful when download-rustc is enabledjyn-0/+4
Previously, it would always treat download-rustc as set to false, which made bootstrap issues with download-rustc hard to debug.
2023-06-23Make `try_run` return a `Result<(), ()>` instead of a booleanGuillaume Gomez-10/+12
2023-06-04Rollup merge of #110701 - jyn514:test-core, r=Mark-SimulacrumMatthias Krüger-8/+25
Fix `x test core` when download-rustc is enabled Fix `x test --stage 2 core` when download-rustc is enabled This works by building std from source instead of downloading it, for library tests only. This was somewhat complicated because of the following requirements: 1. Unconditionally downloading libstd breaks `x test core`, because `coretests` requires the std loaded from the sysroot to match the std that's currently being tested. 2. Unconditionally rebuilding libstd breaks `x test ui-fulldeps librustdoc`, because anything loading `rustc_private` needs to use the same libstd that rustc was built with. Break the knot by introducing a new `stage2-test-sysroot`, used only for testing `std` itself. This holds a freshly compiled std, while `stage2` and `ci-rustc-sysroot` still hold the downloaded std. This also extends the existing `cp_filtered` in Sysroot to apply to the `rust-std` component, not just the `rustc-dev` component, to avoid having both versions of std in `stage2-test-sysroot`. Fixes #110352.
2023-05-30Fix `x test --stage 2 core` when download-rustc is enabledjyn-8/+25
This works by building std from source unconditionally instead of downloading it, for library tests only. This was somewhat complicated because of the following requirements: 1. Unconditionally downloading libstd breaks `x test std`, because `coretests` requires the std loaded from the sysroot to match the std that's currently being tested. 2. Unconditionally rebuilding libstd breaks `x test ui-fulldeps librustdoc`, because anything loading `rustc_private` needs to use the same libstd that rustc was built with. Break the knot by introducing a new `stage2-test-sysroot`, used only for testing `std` itself. This holds a freshly compiled std, while `stage2` and `ci-rustc-sysroot` still hold the downloaded std. This also extends the existing `cp_filtered` in Sysroot to apply to the `rust-std` component, not just the `rustc-dev` component.
2023-05-30create `build_helper/src/util` modozkanonur-2/+3
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-25Generate docs for bootstrap itselfjyn-1/+1
This verifies the intra-doc links are correct, and hopefully makes things easier for new contributors.
2023-05-19Set the timestamp of downloaded stage0 files ...Ximin Luo-1/+1
... using server-reported timestamp. This allows us to track changes to the downloaded artifact more easily and in a more reproducible manner. Co-authored-by: Zixing Liu <zixing.liu@canonical.com>
2023-05-01remove pointless `FIXME` in `bootstrap::download`ozkanonur-1/+0
The suggestion given by `FIXME` to use `CompilerMetadata` for `download_toolchain` in `bootstrap::download` can result in more confusion. This is because `stamp_key` is not always a date; it can also be a commit hash. Additionally, unlike in `download_beta_toolchain`, in the `download_ci_rustc` function, `version` and `commit` values are calculated separately. Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-30Rollup merge of #110999 - clubby789:bootstrap-stderr, r=Mark-SimulacrumMatthias Krüger-4/+4
Output some bootstrap messages on stderr Fixes #110995
2023-04-29Output some bootstrap messages on stderrclubby789-4/+4
2023-04-29download-rustc: Give a better error message if artifacts can't be downloadedJoshua Nelson-1/+12
Before: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds/bf5cad8e775fb326465e5c1b98693e5d259da156/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz curl: (22) The requested URL returned error: 404 ``` After: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds/bf5cad8e775fb326465e5c1b98693e5d259da156/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz curl: (22) The requested URL returned error: 404 error: failed to download pre-built rustc from CI note: old builds get deleted after a certain time help: if trying to compile an old commit of rustc, disable `download-rustc` in config.toml: [rust] download-rustc = false ```
2023-04-18Fix no_std tests that load libc when download-rustc is enabledJoshua Nelson-3/+26
There were a series of unfortunate interactions here. Here's an MCVE of the test this fixes (committed as `tests/ui/meta/no_std-extern-libc.rs`): ```rust #![crate_type = "lib"] #![no_std] #![feature(rustc_private)] extern crate libc; ``` Before, this would give an error about duplicate versions of libc: ``` error[E0464]: multiple candidates for `rlib` dependency `libc` found --> fake-test-src-base/allocator/no_std-alloc-error-handler-default.rs:15:1 | LL | extern crate libc; | ^^^^^^^^^^^^^^^^^^ | = note: candidate #1: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-358db1024b7d9957.rlib = note: candidate #2: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-ebc478710122a279.rmeta ``` Both these versions were downloaded from CI, but one came from the `rust-std` component and one came from `rustc-dev`: ``` ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rust-std-nightly-x86_64-unknown-linux-gnu/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68a2d9e195dd6ed2.rlib ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rustc-dev-nightly-x86_64-unknown-linux-gnu/rustc-dev/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f226c9fbdd92a0fd.rmeta ``` The fix was to only copy files from `rust-std` unless a Step explicitly requests for the `rustc-dev` components to be available by calling `builder.ensure(compile::Rustc)`. To avoid having to re-parse the `rustc-dev.tar.xz` tarball every time, which is quite slow, this adds a new `build/host/ci-rustc/.rustc-dev-contents` cache file which stores only the names of files we need to copy into the sysroot. This also allows reverting the hack in https://github.com/rust-lang/rust/pull/110121; now that we only copy rustc-dev on-demand, we can correctly add the `Rustc` check artifacts into the sysroot, so that this works correctly even when `download-rustc` is forced to `true`. --- See https://github.com/rust-lang/rust/issues/108767#issuecomment-1501217657 for why `no_std` is required for the MCVE test to fail; it's complicated and not particularly important. Fixes https://github.com/rust-lang/rust/issues/108767.
2023-04-07Auto merge of #109448 - ozkanonur:download-beta-compiler-toolchain, ↵bors-10/+54
r=Mark-Simulacrum Download beta compiler toolchain in bootstrap if it doesn't yet exist Blocker for #107812 and #99989 See: https://github.com/rust-lang/rust/pull/107812#discussion_r1143492202 r? `@jyn514`
2023-04-08download beta compiler toolchain in bootstrap if it doesn't yet existozkanonur-10/+54
This is needed for when the shell scripts bypass python altogether and run the downloaded bootstrap directly. Changes are mainly provided from @jyn514, I just fixed the review notes. Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-24Rename 'src/bootstrap/native.rs' to llvm.rsRobin Hafid-1/+1
Renamed 'native.rs' to 'llvm.rs', also moved `TestHelpers` to `test.rs`.Replaced all the `native.rs` ocurrences at `src/bootstrap` files to `llvm.rs`
2023-02-21Revert "port over symlink_file function from Build to Config and create ↵Jakub Beránek-18/+1
symlink for legacy rustfmt path" This reverts commit 41c6c5d4996728b5a635319ef9b077a3d0ccc480.
2023-02-12Rollup merge of #107842 - fee1-dead-contrib:patch_rustfmt_nixos, ↵Matthias Krüger-2/+8
r=Mark-Simulacrum Patch `build/rustfmt/lib/*.so` for NixOS fixes #107676.
2023-02-10Rollup merge of #107876 - zephaniahong:issue-107547-fix, r=albertlarsan68Matthias Krüger-3/+6
create symlink only for non-windows operating systems Follow up on #107834 It's my first time using the #cfg attribute. Did I use it correctly? Thank you!
2023-02-10create symlink only for non-windows operating systemsZephaniah Ong-3/+6
2023-02-10Rollup merge of #107841 - tharunsuresh-code:snap_curl, r=ozkanonurMatthias Krüger-2/+2
Handled snap curl issue inside Rust
2023-02-09Patch `build/rustfmt/lib/*.so` for NixOSDeadbeef-2/+8
fixes #107676.
2023-02-09Handled snap curl issue inside Rust #107722Tharun Suresh-2/+2
2023-02-09port over symlink_file function from Build to Config and create symlink for ↵Zephaniah Ong-1/+15
legacy rustfmt path
2023-02-01Rollup merge of #107470 - kadiwa4:bootstrap_cleanup, r=albertlarsan68Matthias Krüger-55/+77
Small bootstrap improvements - i/o-less check for `xz` availability - cache result of NixOS detection - load correct `bootstrap` module even when a package of that name is installed - no `-W semicolon_in_expressions_from_macros` – it is warn-by-default - one type per variable (making dynamic typing less confusing) - integrate python-side `--help` flag into the argument parser (makes `-hv` work as a short form of `--help --verbose`) I even checked that it works with Python 2.
2023-01-31assert that `should_fix_bins_and_dylibs` has been runKaDiWa-3/+4
2023-01-31Download rustc component for rustfmt toolchain as wellMark Rousskov-4/+16
2023-01-30bootstrap script: slight cleanupKaDiWa-55/+76
2022-11-29Run patchelf also on rust-analyzer-proc-macro-srv.Joe Neeman-0/+1
2022-11-26Revert "Don't set `is_preview` for clippy and rustfmt"Joshua Nelson-2/+0
This reverts commit fb3e724d7602675f147a9b80e70fb6bd6512738c, which broke `rustup update` for anyone with clippy or rustfmt installed.
2022-11-24Don't set `is_preview` for clippy and rustfmtJoshua Nelson-0/+2
These have been shipped on stable for many years now and it would be very disruptive to ever remove them. Remove the `-preview` suffix from their dist components.
2022-11-13Make all download functions need only Config, not BuilderJoshua Nelson-0/+519
This also adds a new `mod download` instead of scattering the download code across `config.rs` and `native.rs`.