about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-08-19Rollup merge of #129194 - ChrisDenton:detect-src, r=Mark-SimulacrumMatthias Krüger-2/+2
Fix bootstrap test `detect_src_and_out` on Windows Fixes #129188 by making sure it's properly testing the right path for the platform.
2024-08-19fix broken bootstrap documentationonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-19Auto merge of #128722 - tgross35:new-resolver-root, r=Mark-Simulacrumbors-97/+112
Switch to using the v2 resolver in most workspaces Pinning the resolver to v1 was done in 5abff3753a7c ("Explicit set workspace.resolver ...") in order to suppress warnings. Since there is no specific reason not to use the new resolver and since it fixes issues, change to `resolver = "2"` everywhere except library.
2024-08-18Rollup merge of #129116 - Zalathar:compiler-rt, r=Mark-SimulacrumTrevor Gross-1/+14
Include a copy of `compiler-rt` source in the `download-ci-llvm` tarball This will make it possible to experiment with allowing `download-ci-llvm` builds to build `library/profiler_builtins`, without needing to check out the `src/llvm-project` submodule. By itself, this PR just adds the files to the tarball, but doesn't actually do anything with them. The idea is that once this is merged, it will then be much easier to proceed with work on the necessary bootstrap changes (using the real downloaded tarball), without having to rig up weird hacks to simulate downloading a modified tarball. --- Adding these files to the compressed tarballs appears to increase its size by a negligible amount (<1 MB out of 400/800+ MB). The uncompressed size is about 14 MB (out of 2+ GB for the whole tarball). (The excluded test files would have been another 35 MB.)
2024-08-18Run `cargo update` with the new v2 resolverTrevor Gross-96/+111
v2 resolves some dependencies differently, and we adjusted some dependency versions. Run `cargo update` to make sure everything is in sync.
2024-08-18Update some dependency versions that allow better licensingTrevor Gross-1/+1
With the new resolver, a few dependencies get brought in twice with different licenses. For example, all dependencies from `wasm-tools` gained Apache-2.0 and MIT options, and with the v2 resolver we were using one version from before and one version from after this change. This made tidy's license check difficult. Update some minimum versions to remove duplicate dependencies and smooth out license checking.
2024-08-18sync llvm submodule during config parseonur-ozkan-12/+16
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-18bypass `dry_run` if the command is `run_always`onur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-18move `Build::update_submodule` to `Config::update_submodule`onur-ozkan-116/+122
During config parsing, some bootstrap logic (e.g., `download-ci-llvm`) checks certain sources and acts based on their state. This means that if path is a git submodule, bootstrap needs to update it before checking its state. Otherwise it may make incorrect assumptions by relying on outdated sources. To enable submodule updates during config parsing, we need to move the `update_submodule` function from the `Build` to `Config` instance, so we can access to it during the parsing process. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-18bootstrap: fix clean's `remove_dir_all` implementation许杰友 Jieyou Xu (Joe)-78/+15
... by using `std::fs::remove_dir_all`, which handles a bunch of edge cases including read-only files and symlinks which are extremely tricky on Windows.
2024-08-17Fix bootstrap test `detect_src_and_out` on WindowsChris Denton-2/+2
2024-08-16autoformat and remove unit testbinarycat-9/+1
2024-08-16bootstrap: improve error recovery flags to curlbinarycat-1/+38
alternative to #128459 fixes #110178
2024-08-16Auto merge of #129052 - onur-ozkan:better-incompatibility-check, r=Kobzolbors-98/+164
detect incompatible CI rustc options more precisely Previously, the logic here was simply checking whether the option was set in `config.toml`. This approach was not manageable in our CI runners as we set so many options in config.toml. In reality, those values are not incompatible since they are usually the same value used to generate the CI rustc. Now, the new logic compares the configuration values with the values used to generate the CI rustc, so we get more precise results and make the process more manageable. r? Kobzol Blocker for https://github.com/rust-lang/rust/pull/122709
2024-08-16bootstrap: fix trying to modify file times on read-only file on Windows许杰友 Jieyou Xu (Joe)-11/+45
2024-08-15Print more verbose error for commands that capture outputJakub Beránek-4/+32
2024-08-15Include a copy of `compiler-rt` source in the `download-ci-llvm` tarballZalathar-1/+14
2024-08-14disable download-rustc if CI rustc has unsupported optionsonur-ozkan-19/+38
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-14leave a FIXME note for `--set` flags coverageonur-ozkan-0/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-14improve `config::check_incompatible_options_for_ci_rustc` logsonur-ozkan-6/+11
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-14fix the incorrect `unpack`ing logiconur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-14create `const BUILDER_CONFIG_FILENAME` for builder-config fileonur-ozkan-3/+13
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-14do not check incompatibility if `config.toml` isn't presentonur-ozkan-17/+19
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-14print values of incompatible optionsonur-ozkan-6/+9
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-13Ship MinGW-w64 runtime DLLs along with `rust-lld.exe` for `-pc-windows-gnu` ↵Colin Finck-13/+24
targets `rust-lld.exe` built for `x86_64-pc-windows-gnu` depends on `libgcc_s_seh-1.dll` and `libwinpthread-1.dll` from MinGW-w64. Until now, they were not shipped alongside `rust-lld.exe`, and you could not run `rust-lld.exe` on most systems. This problem didn't surface until now because: * Most targets don't use `rust-lld` by default. * Some people had these DLLs in their `PATH` from some other MinGW binary. * `rustup` used to add `bin` to the `PATH`, which contains these DLLs for `rustc.exe`. But it no longer does that: https://github.com/rust-lang/rustup/commit/ce3c09a0cb126e2c65a3bb2a3bbf3f098b4c23a2 Fixes #125809
2024-08-13Fix target triple in bootstrapJakub Beránek-1/+1
2024-08-13detect incompatible CI rustc options more preciselyonur-ozkan-48/+69
Previously, the logic here was simply checking whether the option was set in `config.toml`. This approach was not manageable in our CI runners as we set so many options in config.toml. In reality, those values are not incompatible since they are usually the same value used to generate the CI rustc. Now, the new logic compares the configuration values with the values used to generate the CI rustc, so we get more precise results and make the process more manageable. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-13separate inner function (`get_toml`) of `Config::parse`onur-ozkan-34/+36
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-13copy `builder-config` file into ci-rustc sysrootonur-ozkan-4/+7
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-13Rollup merge of #128983 - Kobzol:bootstrap-target, r=onur-ozkanMatthias Krüger-70/+70
Slightly refactor `TargetSelection` in bootstrap Mostly a drive-by refactoring of `TargetSelection` to reduce some manual "windows-gnu" detection and also accesses to the `triple` field. r? `@onur-ozkan`
2024-08-13Rollup merge of #128841 - lqd:rustc-args, r=onur-ozkanMatthias Krüger-16/+13
bootstrap: don't use rustflags for `--rustc-args` r? `@onur-ozkan` This is going to require a bit of context. https://github.com/rust-lang/rust/pull/47558 has added `--rustc-args` to `./x test` to allow passing flags when building `compiletest` tests. It was made specifically because using `RUSTFLAGS` would rebuild the compiler/stdlib, which would in turn require the flag you want to build tests with to successfully bootstrap. #113178 made the request that it also works for other tests and doctests. This is not trivial to support across the board for `library`/`compiler` unit-tests/doctests and across stages. This issue was closed in #113948 by using `RUSTFLAGS`, seemingly incorrectly since https://github.com/rust-lang/rust/pull/123489 fixed that part to make it work. Unfortunately #123489/#113948 have regressed the goals of `--rustc-args`: - now we can't use rustc args that don't bootstrap, to run the UI tests: we can't test incomplete features. The new trait solver doesn't bootstrap, in-progress borrowck/polonius changes don't bootstrap, some other features are similarly incomplete, etc. - using the flag now rebuilds everything from scratch: stage0 stdlib, stage1 compiler, stage1 stdlib. You don't need to re-do all this to compile UI tests, you only need the latter to run stdlib tests with a new flag, etc. This happens for contributors, but also on CI today. (Not to mention that in doing that it will rebuild things with flags that are not meant to be used, e.g. stdlib cfgs that don't exist in the compiler; or you could also imagine that this silently enables flags that were not meant to be enabled in this way). Since then, https://github.com/rust-lang/rust/pull/125011/commits/bd71c71ea04b4a4f954e579c2a6d44113274846a has started using it to test a stdlib feature, relying on the fact that it now rebuilds everything. So #125011 also regressed CI times more than necessary because it rebuilds everything instead of just stage 1 stdlib. It's not easy for me to know how to properly fix #113178 in bootstrap, but #113948/#123489 are not it since they regress the initial intent. I'd think bootstrap would have to know from the list of test targets that are passed that the `library` or `compiler` paths that are passed could require rebuilding these crates with different rustflags, probably also depending on stages. Therefore I would not be able to fix it, and will just try in this PR to unregress the situation to unblock the initial use-case. It seems miri now also uses `./x miri --rustc-args` in this incorrect meaning to rebuild the `library` paths they support to run with the new args. I've not made any bootstrap changes related to `./x miri` in this PR, so `--rustc-args` wouldn't work there anymore. I'd assume this would need to use rustflags again but I don't know how to make that work properly in bootstrap, hence opening as draft, so you can tell me how to do that. I assume we don't want to break their use-case again now that it exists, even though there are ways to use `./x test` to do exactly that. `RUSTFLAGS_NOT_BOOTSTRAP=flag ./x test library/std` is a way to run unit tests with a new flag without rebuilding everything, while with #123489 there is no way anymore to run tests with a flag that doesn't bootstrap. --- edit: after review, this PR: - renames `./x test --rustc-args` to `./x test --compiletest-rustc-args` as it only applies there, and cannot use rustflags for this purpose. - fixes the regression that using these args rebuilt everything from scratch - speeds up some CI jobs via the above point - removes `./x miri --rustc-args` as only library tests are supported, needs to rebuild libstd, and `./x miri --compiletest-rustc-args` wouldn't work since compiletests are not supported.
2024-08-13Implement `AsRef<Path>` for `TargetSelection`Jakub Beránek-61/+57
2024-08-13Create a `TargetSelection` method for recognizing `*-windows-gnu` targetsJakub Beránek-9/+13
2024-08-12Rollup merge of #129000 - RalfJung:miri-bootstrap-clear, r=onur-ozkanMatthias Krüger-6/+8
bootstrap: clear miri ui-test deps when miri sysroot gets rebuilt Second attempt after https://github.com/rust-lang/rust/pull/128683: seems like it's not the compiler changing that we care about, but the sysroot changing. I did some local testing with sysroot rebuilds and it works fine for at least those cases I checked. r? ``@onur-ozkan``
2024-08-12add change tracker noticeRémy Rakic-0/+5
2024-08-12rename `./x test`'s `--rustc-args` to `--compiletest-rustc-args`Rémy Rakic-7/+7
2024-08-12remove unexpected `--rustc-args` from `./x miri`Rémy Rakic-4/+1
2024-08-12clarify that `--rustc-args` is for compiletest testsRémy Rakic-1/+1
2024-08-12 don't use rustflags for `--rustc-args`Rémy Rakic-5/+0
2024-08-12Rollup merge of #128878 - Kobzol:refactor-flags, r=onur-ozkanGuillaume Gomez-29/+48
Slightly refactor `Flags` in bootstrap The next step for https://github.com/rust-lang/rust/issues/126819 is to track commands executed inside `Config::parse`. This is quite challenging, because (tracked) command execution needs to access some state that is stored inside `Config`, which creates a sort of a chicken-and-egg problem. I would like to first untangle `Config::parse` a little bit, which is what this PR starts with. Tracking issue: https://github.com/rust-lang/rust/issues/126819 r? `@onur-ozkan`
2024-08-12bootstrap: clear miri ui-test deps when miri sysroot gets rebuiltRalf Jung-6/+8
2024-08-11Auto merge of #122362 - Zoxc:rustc_driver_static_std, ↵bors-4/+34
r=oli-obk,lqd,bjorn3,Kobzol Link `std` statically in `rustc_driver` This makes `rustc_driver` statically link to `std`. This is done by not passing `-C prefer-dynamic` when building `rustc_driver`. However building `rustc-main` won't work currently as it tries to dynamically link to both `rustc_driver` and `std` resulting in a crate graph with `std` duplicated. To fix that new command line option `-Z prefer_deps_of_dynamic` is added which prevents linking to a dylib if there's a static variant of it already statically linked into another dylib dependency. The main motivation for this change is to enable `#[global_allocator]` to be used in `rustc_driver` allowing overriding the allocator used in rustc on all platforms. --- Instead of adding `-Z prefer_deps_of_dynamic`, this PR is changed to crate opt-in to the linking change via the `rustc_private` feature instead, as that would be typically needed to link to `rustc_driver` anyway. --- try-job: aarch64-apple try-job: x86_64-msvc try-job: i686-mingw try-job: dist-x86_64-msvc try-job: aarch64-gnu
2024-08-11Rollup merge of #128592 - evelynharthbrooke:master, r=Mark-SimulacrumMatthias Krüger-1/+1
Promote aarch64-apple-darwin to Tier 1 This promotes aarch64-apple-darwin to Tier 1 status as per rust-lang/rfcs#3671 and tracking issue #73908. Not sure what else is necessary for this to impement the aforementioned RFC, however I figured I'd try. I did read in previous issues and PRs that the necessary infrastructure was already in place for the aarch64-apple-darwin target, and the RFC mentions the same. So this should be all thats necessary in order for the target to be promoted. This is a recreation of my previous PR because I accidentally did an incorrect git rebase which caused unnecessary changes to various commit SHAs. So this PR is a recreation of my previous PR without said stumble. My bad.
2024-08-11Keep rustc's std copyJohn Kåre Alsaker-12/+1
2024-08-11Exclude just `std` from rustc depsJohn Kåre Alsaker-9/+5
2024-08-11Don't statically link `std` into `rustc_driver` for `windows-gnu`John Kåre Alsaker-4/+30
2024-08-11Link `std` statically in `rustc_driver`John Kåre Alsaker-5/+24
2024-08-10Distribute rustc_codegen_cranelift for Windowsbjorn3-12/+3
2024-08-09Auto merge of #125642 - khuey:zstd, r=Kobzolbors-4/+21
Enable zstd for debug compression. Set LLVM_ENABLE_ZSTD alongside LLVM_ENABLE_ZLIB so that --compress-debug-sections=zstd is an option. See #120953 try-job: x86_64-gnu-tools
2024-08-09Rollup merge of #128874 - Kobzol:cmd-verbose-logging, r=onur-ozkanMatthias Krüger-5/+14
Disable verbose bootstrap command failure logging by default One of my recent bootstrap command refactoring PRs enabled verbose logging of command failures by default. While this is great for debugging bootstrap, in many situations it's just too verbose and prevents the user from seeing the actual printed stdout/stderr, which usually contains much more useful information. This PR reverts that logic, and only prints a detailed error when `-v` is passed to bootstrap. r? ````@onur-ozkan````