Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionally build wasm-component-ld #127866

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@
# "rust-analyzer-proc-macro-srv",
# "analysis",
# "src",
# "wasm-component-ld",
#]

# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation
Expand Down
12 changes: 7 additions & 5 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1820,12 +1820,14 @@ impl Step for Assemble {
&self_contained_lld_dir.join(exe(name, target_compiler.host)),
);
}
}

// In addition to `rust-lld` also install `wasm-component-ld` when
// LLD is enabled. This is a relatively small binary that primarily
// delegates to the `rust-lld` binary for linking and then runs
// logic to create the final binary. This is used by the
// `wasm32-wasip2` target of Rust.
// In addition to `rust-lld` also install `wasm-component-ld` when
// LLD is enabled. This is a relatively small binary that primarily
// delegates to the `rust-lld` binary for linking and then runs
// logic to create the final binary. This is used by the
// `wasm32-wasip2` target of Rust.
if builder.build_wasm_component_ld() {
let wasm_component_ld_exe =
builder.ensure(crate::core::build_steps::tool::WasmComponentLd {
compiler: build_compiler,
Expand Down
13 changes: 13 additions & 0 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,19 @@ Executed at: {executed_at}"#,
None
}

/// Returns whether it's requested that `wasm-component-ld` is built as part
/// of the sysroot. This is done either with the `extended` key in
/// `config.toml` or with the `tools` set.
fn build_wasm_component_ld(&self) -> bool {
if self.config.extended {
return true;
}
match &self.config.tools {
Some(set) => set.contains("wasm-component-ld"),
None => false,
}
}

/// Returns the root of the "rootfs" image that this target will be using,
/// if one was configured.
///
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "`debug-logging` option has been removed from the default `tools` profile.",
},
ChangeInfo {
change_id: 127866,
severity: ChangeSeverity::Info,
summary: "the `wasm-component-ld` tool is now built as part of `build.extended` and can be a member of `build.tools`",
},
];
Loading