diff options
| author | bors <bors@rust-lang.org> | 2025-01-16 21:31:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-16 21:31:19 +0000 |
| commit | 76a030a6c2dab11760cb08d746fa515e4bce5d39 (patch) | |
| tree | ceeec20150de63fb1829483d0753bc8420284f3d /src | |
| parent | 99db2737c91d1e4b36b2ffc17dcda5878bcae625 (diff) | |
| parent | f4bbe30974c971061778971521bb7935fd944164 (diff) | |
Auto merge of #135592 - matthiaskrgr:rollup-4t69l7i, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #134754 (Implement `use` associated items of traits) - #135481 (coverage: Completely overhaul counter assignment, using node-flow graphs) - #135504 (Allow coercing safe-to-call target_feature functions to safe fn pointers) - #135561 (Update docs for `-Clink-dead-code` to discourage its use) - #135574 (ci: mirror ubuntu:22.04 to ghcr.io) - #135585 (resolve symlinks of LLVM tool binaries before copying them) - #135588 (Add license-metadata.json to rustc-src tarball.) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/compile.rs | 8 | ||||
| -rw-r--r-- | src/bootstrap/src/core/build_steps/dist.rs | 1 | ||||
| -rw-r--r-- | src/bootstrap/src/lib.rs | 8 | ||||
| -rw-r--r-- | src/doc/rustc/src/codegen-options/index.md | 10 |
4 files changed, 21 insertions, 6 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 4c4df922b37..fd9bf47234c 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1777,7 +1777,13 @@ impl Step for Assemble { // When using `download-ci-llvm`, some of the tools // may not exist, so skip trying to copy them. if src_path.exists() { - builder.copy_link(&src_path, &libdir_bin.join(&tool_exe)); + // There is a chance that these tools are being installed from an external LLVM. + // Use `Builder::resolve_symlink_and_copy` instead of `Builder::copy_link` to ensure + // we are copying the original file not the symlinked path, which causes issues for + // tarball distribution. + // + // See https://github.com/rust-lang/rust/issues/135554. + builder.resolve_symlink_and_copy(&src_path, &libdir_bin.join(&tool_exe)); } } } diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index b298f472e0d..afa409aa835 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -1001,6 +1001,7 @@ impl Step for PlainSourceTarball { "README.md", "RELEASES.md", "REUSE.toml", + "license-metadata.json", "configure", "x.py", "config.example.toml", diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index ebe2c332258..482e23cd04c 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -1633,6 +1633,14 @@ Executed at: {executed_at}"#, paths } + /// Copies a file from `src` to `dst`. + /// + /// If `src` is a symlink, `src` will be resolved to the actual path + /// and copied to `dst` instead of the symlink itself. + pub fn resolve_symlink_and_copy(&self, src: &Path, dst: &Path) { + self.copy_link_internal(src, dst, true); + } + /// Links a file from `src` to `dst`. /// Attempts to use hard links if possible, falling back to copying. /// You can neither rely on this being a copy nor it being a link, diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md index e987d06b0f3..f45217c69ff 100644 --- a/src/doc/rustc/src/codegen-options/index.md +++ b/src/doc/rustc/src/codegen-options/index.md @@ -207,14 +207,14 @@ options should be separated by spaces. ## link-dead-code -This flag controls whether the linker will keep dead code. It takes one of -the following values: +Tries to generate and link dead code that would otherwise not be generated or +linked. It takes one of the following values: -* `y`, `yes`, `on`, `true` or no value: keep dead code. +* `y`, `yes`, `on`, `true` or no value: try to keep dead code. * `n`, `no`, `off` or `false`: remove dead code (the default). -An example of when this flag might be useful is when trying to construct code coverage -metrics. +This flag was historically used to help improve some older forms of code +coverage measurement. Its use is not recommended. ## link-self-contained |
