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

Rollup of 14 pull requests #130133

Merged
merged 49 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3a693f2
Preparing for merge from rustc
Sep 1, 2024
a9477c7
Merge from rustc
Sep 1, 2024
b71297f
fmt
Sep 1, 2024
53451c2
move addr_from_alloc_id logic into its own function
RalfJung Sep 1, 2024
3c0996b
Auto merge of #3854 - rust-lang:rustup-2024-09-01, r=RalfJung
bors Sep 1, 2024
4ee58db
Upgrade CI's mingw-w64 toolchain
mati865 Aug 25, 2024
f2696ab
rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint
its-the-shrimp Aug 4, 2024
6c09243
Preparing for merge from rustc
Sep 2, 2024
9fe4539
Merge from rustc
Sep 2, 2024
747f680
Use sysroot crates maximally in `rustc_codegen_gcc`.
nnethercote Sep 2, 2024
d0f23b4
Auto merge of #3857 - rust-lang:rustup-2024-09-02, r=RalfJung
bors Sep 2, 2024
de96082
Enable native libraries on macOS
jder Sep 1, 2024
989f63b
Auto merge of #3856 - jder:mac-native-libs, r=RalfJung
bors Sep 3, 2024
5f22103
Detect pthread_mutex_t is moved
Mandragorian Jul 27, 2024
18d358c
Auto merge of #3784 - Mandragorian:detect_moved_mutexes, r=RalfJung
bors Sep 5, 2024
81a08bc
Preparing for merge from rustc
Sep 6, 2024
2fccb4b
Merge from rustc
Sep 6, 2024
0903724
Auto merge of #3862 - rust-lang:rustup-2024-09-06, r=RalfJung
bors Sep 6, 2024
2d6489e
miri.bat: use nightly toolchain
RalfJung Sep 6, 2024
72aa65b
Auto merge of #3864 - RalfJung:miri-bat-nightly, r=RalfJung
bors Sep 6, 2024
4dfafb1
Fix comment in mutex_id_offset
Mandragorian Sep 6, 2024
59cb24d
Auto merge of #3865 - Mandragorian:doc_fixes_pthreads, r=RalfJung
bors Sep 6, 2024
c1ff6fd
Fix a typo in the wasm-component-ld README
alexcrichton Sep 6, 2024
c15469a
Fix enabling wasm-component-ld to match other tools
alexcrichton Sep 6, 2024
c788dcc
Test codegen when setting deployment target
madsmtm Sep 7, 2024
c0b0627
Rename variant `AddrOfRegion` of `RegionVariableOrigin` to `BorrowReg…
gurry Sep 7, 2024
f7d4da6
remove 'const' from 'Option::iter'
RalfJung Sep 7, 2024
03e0c8e
make Result::copied unstably const
RalfJung Sep 7, 2024
cfe85a3
Fixes typo in wasm32-wasip2 doc comment
zslayton Sep 7, 2024
3de6838
add some FIXME(const-hack)
RalfJung Sep 8, 2024
ec11001
run-make-support: Add llvm-pdbutil
nebulark Sep 6, 2024
f7b4f4a
Option, Result: put the &mut variants of 'copied' under the same feat…
RalfJung Sep 8, 2024
11d51aa
const: make ptr.is_null() stop execution on ambiguity
RalfJung Sep 8, 2024
5f3fdd1
Remove needless returns detected by clippy in libraries
eduardosm Sep 8, 2024
7626015
added support for GNU/Hurd on x86_64
sthibaul Jul 26, 2024
1ea466b
Rollup merge of #119229 - mati865:update-mingw-toolchain, r=jieyouxu,…
workingjubilee Sep 9, 2024
2cce01e
Rollup merge of #128345 - sthibaul:hurd-amd64, r=Urgau
workingjubilee Sep 9, 2024
4cfb1c3
Rollup merge of #128667 - its-the-shrimp:rustdoc_json_types_rename, r…
workingjubilee Sep 9, 2024
15c7d27
Rollup merge of #129876 - nnethercote:more-sysroot-rustc_codegen_gcc,…
workingjubilee Sep 9, 2024
c21d31a
Rollup merge of #130034 - alexcrichton:fix-some-wasm-component-ld-com…
workingjubilee Sep 9, 2024
97d62ac
Rollup merge of #130048 - nebulark:runmake_llvm_pdbutil, r=jieyouxu
workingjubilee Sep 9, 2024
fd938c7
Rollup merge of #130068 - madsmtm:deployment-target-test, r=jieyouxu
workingjubilee Sep 9, 2024
09373b9
Rollup merge of #130070 - gurry:rename-regionkind-addof-to-ref, r=com…
workingjubilee Sep 9, 2024
38520ae
Rollup merge of #130087 - RalfJung:option-const-iter, r=workingjubilee
workingjubilee Sep 9, 2024
4a26f3b
Rollup merge of #130090 - RalfJung:result-copied, r=Noratrieb
workingjubilee Sep 9, 2024
a7c5797
Rollup merge of #130092 - zslayton:master, r=jieyouxu
workingjubilee Sep 9, 2024
fad44c4
Rollup merge of #130107 - RalfJung:const-ptr-is-null, r=oli-obk
workingjubilee Sep 9, 2024
2f1cf6f
Rollup merge of #130115 - eduardosm:needless-returns-libs, r=workingj…
workingjubilee Sep 9, 2024
3e01a5d
Rollup merge of #130130 - RalfJung:miri-sync, r=RalfJung
workingjubilee Sep 9, 2024
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
Prev Previous commit
Next Next commit
Fix enabling wasm-component-ld to match other tools
It was [pointed out recently][comment] that enabling `wasm-component-ld`
as a host tool is different from other host tools. This commit refactors
the logic to match by deduplicating selection of when to build other
tools and then using the same logic for `wasm-component-ld`.

[comment]: #127866 (comment)
  • Loading branch information
alexcrichton committed Sep 6, 2024
commit c15469a7fec811d1a4f69ff26e18c6f383df41d2
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ impl Step for Assemble {
// 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() {
if builder.tool_enabled("wasm-component-ld") {
let wasm_component_ld_exe =
builder.ensure(crate::core::build_steps::tool::WasmComponentLd {
compiler: build_compiler,
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl Step for Rustc {
);
}
}
if builder.build_wasm_component_ld() {
if builder.tool_enabled("wasm-component-ld") {
let src_dir = builder.sysroot_libdir(compiler, host).parent().unwrap().join("bin");
let ld = exe("wasm-component-ld", compiler.host);
builder.copy_link(&src_dir.join(&ld), &dst_dir.join(&ld));
Expand Down
38 changes: 6 additions & 32 deletions src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,14 +693,7 @@ impl Step for Cargo {

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.path("src/tools/cargo").default_condition(
builder.config.extended
&& builder.config.tools.as_ref().map_or(
true,
// If `tools` is set, search list for this tool.
|tools| tools.iter().any(|tool| tool == "cargo"),
),
)
run.path("src/tools/cargo").default_condition(builder.tool_enabled("cargo"))
}

fn make_run(run: RunConfig<'_>) {
Expand Down Expand Up @@ -772,14 +765,7 @@ impl Step for RustAnalyzer {

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.path("src/tools/rust-analyzer").default_condition(
builder.config.extended
&& builder
.config
.tools
.as_ref()
.map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")),
)
run.path("src/tools/rust-analyzer").default_condition(builder.tool_enabled("rust-analyzer"))
}

fn make_run(run: RunConfig<'_>) {
Expand Down Expand Up @@ -821,12 +807,8 @@ impl Step for RustAnalyzerProcMacroSrv {
run.path("src/tools/rust-analyzer")
.path("src/tools/rust-analyzer/crates/proc-macro-srv-cli")
.default_condition(
builder.config.extended
&& builder.config.tools.as_ref().map_or(true, |tools| {
tools.iter().any(|tool| {
tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv"
})
}),
builder.tool_enabled("rust-analyzer")
|| builder.tool_enabled("rust-analyzer-proc-macro-srv"),
)
}

Expand Down Expand Up @@ -874,16 +856,8 @@ impl Step for LlvmBitcodeLinker {

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.path("src/tools/llvm-bitcode-linker").default_condition(
builder.config.extended
&& builder
.config
.tools
.as_ref()
.map_or(builder.build.unstable_features(), |tools| {
tools.iter().any(|tool| tool == "llvm-bitcode-linker")
}),
)
run.path("src/tools/llvm-bitcode-linker")
.default_condition(builder.tool_enabled("llvm-bitcode-linker"))
}

fn make_run(run: RunConfig<'_>) {
Expand Down
17 changes: 9 additions & 8 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1407,16 +1407,17 @@ 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;
/// Returns whether the specified tool is configured as part of this build.
///
/// This requires that both the `extended` key is set and the `tools` key is
/// either unset or specifically contains the specified tool.
fn tool_enabled(&self, tool: &str) -> bool {
if !self.config.extended {
return false;
}
match &self.config.tools {
Some(set) => set.contains("wasm-component-ld"),
None => false,
Some(set) => set.contains(tool),
None => true,
}
}

Expand Down
Loading