diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-06-23 22:38:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-23 22:38:59 +0200 |
| commit | 4a3863e7e3a6e6c602c6f9c047d4c9a1ad9ea49c (patch) | |
| tree | 1991efa22a5f291f5e024f2f6f28449904ab3611 /src/bootstrap | |
| parent | 0eff9fb05a8a8d2311b8be236ef73699d63699d9 (diff) | |
| parent | 521e707d7acf3f85389bbcfe53670638ef00c32a (diff) | |
| download | rust-4a3863e7e3a6e6c602c6f9c047d4c9a1ad9ea49c.tar.gz rust-4a3863e7e3a6e6c602c6f9c047d4c9a1ad9ea49c.zip | |
Rollup merge of #126616 - onur-ozkan:less-warnings, r=Mark-Simulacrum
less bootstrap warnings
This is how the build logs looks like currently:
```sh
$ x build
Building bootstrap
Compiling bootstrap v0.0.0 (/home/nimda/devspace/onur-ozkan/rust/src/bootstrap)
Finished `dev` profile [unoptimized] target(s) in 3.43s
WARNING: no codegen-backends config matched the requested path to build a codegen backend. HELP: add backend to codegen-backends in config.toml.
WARNING: creating symbolic link `/home/nimda/devspace/.other/rustc-builds/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/rustc-src/rust` to `/home/nimda/devspace/onur-ozkan/rust` failed with File exists (os
error 17)
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
WARNING: creating symbolic link `/home/nimda/devspace/.other/rustc-builds/build/x86_64-unknown-linux-gnu/ci-rustc-sysroot/lib/rustlib/rustc-src/rust` to `/home/nimda/devspace/onur-ozkan/rust` failed with File e
xists (os error 17)
Building tool rustdoc (stage1 -> stage2, x86_64-unknown-linux-gnu)
Compiling rustdoc v0.0.0 (/home/nimda/devspace/onur-ozkan/rust/src/librustdoc)
Compiling rustdoc-tool v0.0.0 (/home/nimda/devspace/onur-ozkan/rust/src/tools/rustdoc)
Finished `release` profile [optimized + debuginfo] target(s) in 13.57s
Build completed successfully in 0:00:17
```
This PR removes artifact linking warnings and only shows the codegen-backend warning if explicitly called or during Dist or Install steps.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/compile.rs | 14 | ||||
| -rw-r--r-- | src/bootstrap/src/utils/helpers.rs | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index cc5b0073213..5b18cb3f7e1 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1290,15 +1290,21 @@ fn needs_codegen_config(run: &RunConfig<'_>) -> bool { pub(crate) const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_"; fn is_codegen_cfg_needed(path: &TaskPath, run: &RunConfig<'_>) -> bool { - if path.path.to_str().unwrap().contains(CODEGEN_BACKEND_PREFIX) { + let path = path.path.to_str().unwrap(); + + let is_explicitly_called = |p| -> bool { run.builder.paths.contains(p) }; + let should_enforce = run.builder.kind == Kind::Dist || run.builder.kind == Kind::Install; + + if path.contains(CODEGEN_BACKEND_PREFIX) { let mut needs_codegen_backend_config = true; for backend in run.builder.config.codegen_backends(run.target) { - if path.path.to_str().unwrap().ends_with(&(CODEGEN_BACKEND_PREFIX.to_owned() + backend)) - { + if path.ends_with(&(CODEGEN_BACKEND_PREFIX.to_owned() + backend)) { needs_codegen_backend_config = false; } } - if needs_codegen_backend_config { + if (is_explicitly_called(&PathBuf::from(path)) || should_enforce) + && needs_codegen_backend_config + { run.builder.info( "WARNING: no codegen-backends config matched the requested path to build a codegen backend. \ HELP: add backend to codegen-backends in config.toml.", diff --git a/src/bootstrap/src/utils/helpers.rs b/src/bootstrap/src/utils/helpers.rs index 4b6dc45b436..59b29eedb79 100644 --- a/src/bootstrap/src/utils/helpers.rs +++ b/src/bootstrap/src/utils/helpers.rs @@ -135,7 +135,7 @@ pub fn symlink_dir(config: &Config, original: &Path, link: &Path) -> io::Result< if config.dry_run() { return Ok(()); } - let _ = fs::remove_dir(link); + let _ = fs::remove_dir_all(link); return symlink_dir_inner(original, link); #[cfg(not(windows))] |
