Skip to content

Commit f22775b

Browse files
committed
ignore llvm::Lld step if lld is not enabled
People are having trouble when they don't want to build `lld` for their custom distribution tarballs even with `lld = false` in their config.toml. This is because it is not controlled by `lld_enabled` flag. This change ensures that `llvm:Lld` is controlled by lld configuration. Signed-off-by: onur-ozkan <[email protected]>
1 parent 3186d17 commit f22775b

File tree

1 file changed

+9
-7
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+9
-7
lines changed

src/bootstrap/src/core/build_steps/dist.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -2261,9 +2261,6 @@ impl Step for RustDev {
22612261

22622262
builder.ensure(crate::core::build_steps::llvm::Llvm { target });
22632263

2264-
// We want to package `lld` to use it with `download-ci-llvm`.
2265-
builder.ensure(crate::core::build_steps::llvm::Lld { target });
2266-
22672264
let src_bindir = builder.llvm_out(target).join("bin");
22682265
// If updating this, you likely want to change
22692266
// src/bootstrap/download-ci-llvm-stamp as well, otherwise local users
@@ -2280,10 +2277,15 @@ impl Step for RustDev {
22802277
}
22812278
}
22822279

2283-
// We don't build LLD on some platforms, so only add it if it exists
2284-
let lld_path = builder.lld_out(target).join("bin").join(exe("lld", target));
2285-
if lld_path.exists() {
2286-
tarball.add_file(lld_path, "bin", 0o755);
2280+
if builder.config.lld_enabled {
2281+
// We want to package `lld` to use it with `download-ci-llvm`.
2282+
let lld_out = builder.ensure(crate::core::build_steps::llvm::Lld { target });
2283+
2284+
// We don't build LLD on some platforms, so only add it if it exists
2285+
let lld_path = lld_out.join("bin").join(exe("lld", target));
2286+
if lld_path.exists() {
2287+
tarball.add_file(lld_path, "bin", 0o755);
2288+
}
22872289
}
22882290

22892291
tarball.add_file(builder.llvm_filecheck(target), "bin", 0o755);

0 commit comments

Comments
 (0)