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 7 pull requests #128017

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9f7e049
Distribute rustc_codegen_cranelift for arm64 macOS
bjorn3 Jun 30, 2024
64ec270
Promote Mac Catalyst targets to tier 2, and ship with rustup
madsmtm Jun 13, 2024
d12d122
rewrite and rename issue-14698 to rmake
Oneirical Jul 16, 2024
5a10ceb
rewrite and rename issue-33329 to ui test
Oneirical Jul 16, 2024
1a0baaa
rewrite and rename issue-107094 to rmake
Oneirical Jul 16, 2024
ead6aad
Make command output capturing more explicit
Kobzol Jul 7, 2024
1984a46
Make it easier to detect when bootstrap tries to read uncaptured stdo…
Kobzol Jul 7, 2024
5b0b4ff
Update wasi-sdk in CI to latest release
alexcrichton Jul 19, 2024
006c884
Fix two new failing tests
alexcrichton Jul 19, 2024
7b19389
rewrite test-benches to rmake
Oneirical Jul 19, 2024
2733494
rewrite c-unwind-abi-catch-panic to rmake
Oneirical Jul 19, 2024
2192a91
rewrite compiler-lookup-paths-2 to rmake
Oneirical Jul 19, 2024
59429e6
Rewrite `test-float-parse` in Rust
tgross35 Jul 20, 2024
51827ce
Move `test-float-parse` to the global workspace
tgross35 Jul 20, 2024
6062059
Expose `test-float-parse` via bootstrap
tgross35 Jul 20, 2024
7f7ec2d
Run `test-float-parse` as part of CI
tgross35 Jul 20, 2024
6c2944d
Rollup merge of #126450 - madsmtm:promote-mac-catalyst, r=Mark-Simula…
matthiaskrgr Jul 20, 2024
ef5b297
Rollup merge of #127177 - bjorn3:arm64_macos_cg_clif, r=Mark-Simulacrum
matthiaskrgr Jul 20, 2024
89049ae
Rollup merge of #127510 - tgross35:test-float-parse-update, r=Mark-Si…
matthiaskrgr Jul 20, 2024
5582a3e
Rollup merge of #127799 - Kobzol:bootstrap-cmd-refactor-7, r=onur-ozkan
matthiaskrgr Jul 20, 2024
f31c7a5
Rollup merge of #127820 - Oneirical:intestellar-travel, r=jieyouxu
matthiaskrgr Jul 20, 2024
863fcea
Rollup merge of #127977 - alexcrichton:update-wasi-sdk, r=Mark-Simula…
matthiaskrgr Jul 20, 2024
7c6d836
Rollup merge of #127985 - Oneirical:testibule-of-hell, r=Kobzol
matthiaskrgr Jul 20, 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
75 changes: 75 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2598,12 +2598,76 @@ dependencies = [
"windows-sys 0.48.0",
]

[[package]]
name = "num"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
dependencies = [
"num-bigint",
"num-complex",
"num-integer",
"num-iter",
"num-rational",
"num-traits",
]

[[package]]
name = "num-bigint"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
]

[[package]]
name = "num-complex"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
dependencies = [
"num-traits",
]

[[package]]
name = "num-conv"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"

[[package]]
name = "num-integer"
version = "0.1.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
dependencies = [
"num-traits",
]

[[package]]
name = "num-iter"
version = "0.1.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
]

[[package]]
name = "num-rational"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
dependencies = [
"num-bigint",
"num-integer",
"num-traits",
]

[[package]]
name = "num-traits"
version = "0.2.19"
Expand Down Expand Up @@ -5630,6 +5694,17 @@ dependencies = [
"std",
]

[[package]]
name = "test-float-parse"
version = "0.1.0"
dependencies = [
"indicatif",
"num",
"rand",
"rand_chacha",
"rayon",
]

[[package]]
name = "textwrap"
version = "0.16.1"
Expand Down
13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"compiler/rustc",
"library/std",
"library/sysroot",
"src/etc/test-float-parse",
"src/rustdoc-json-types",
"src/tools/build_helper",
"src/tools/cargotest",
Expand Down Expand Up @@ -109,6 +110,18 @@ strip = true
debug = 0
strip = true

# Bigint libraries are slow without optimization, speed up testing
[profile.dev.package.test-float-parse]
opt-level = 3

# Speed up the binary as much as possible
[profile.release.package.test-float-parse]
opt-level = 3
codegen-units = 1
# FIXME: LTO cannot be enabled for binaries in a workspace
# <https://github.com/rust-lang/cargo/issues/9330>
# lto = true

[patch.crates-io]
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on
# here
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ For more docs on how to build and test see [build_system/usage.txt](build_system
|FreeBSD|✅[^no-rustup]|❓|❓|❓|
|AIX|❌[^xcoff]|N/A|N/A|❌[^xcoff]|
|Other unixes|❓|❓|❓|❓|
|macOS|✅|✅[^no-rustup]|N/A|N/A|
|macOS|✅|✅|N/A|N/A|
|Windows|✅[^no-rustup]|❌|N/A|N/A|

✅: Fully supported and tested
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/mk/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ check-aux:
$(Q)$(BOOTSTRAP) test --stage 2 \
src/tools/cargo \
src/tools/cargotest \
etc/etc/test-float-parse \
$(BOOTSTRAP_ARGS)
# Run standard library tests in Miri.
$(Q)BOOTSTRAP_SKIP_TARGET_SANITY=1 \
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ tool_check_step!(CargoMiri, "src/tools/miri/cargo-miri", SourceType::InTree);
tool_check_step!(Rls, "src/tools/rls", SourceType::InTree);
tool_check_step!(Rustfmt, "src/tools/rustfmt", SourceType::InTree);
tool_check_step!(MiroptTestTools, "src/tools/miropt-test-tools", SourceType::InTree);
tool_check_step!(TestFloatParse, "src/etc/test-float-parse", SourceType::InTree);

tool_check_step!(Bootstrap, "src/bootstrap", SourceType::InTree, false);

Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/build_steps/clippy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,5 @@ lint_any!(
Rustfmt, "src/tools/rustfmt", "rustfmt";
RustInstaller, "src/tools/rust-installer", "rust-installer";
Tidy, "src/tools/tidy", "tidy";
TestFloatParse, "src/etc/test-float-parse", "test-float-parse";
);
6 changes: 3 additions & 3 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ pub fn compiler_file(
let mut cmd = command(compiler);
cmd.args(builder.cflags(target, GitRepo::Rustc, c));
cmd.arg(format!("-print-file-name={file}"));
let out = cmd.capture_stdout().run(builder).stdout();
let out = cmd.run_capture_stdout(builder).stdout();
PathBuf::from(out.trim())
}

Expand Down Expand Up @@ -1844,7 +1844,7 @@ impl Step for Assemble {
builder.ensure(llvm::Llvm { target: target_compiler.host });
if !builder.config.dry_run() && builder.config.llvm_tools_enabled {
let llvm_bin_dir =
command(llvm_config).capture_stdout().arg("--bindir").run(builder).stdout();
command(llvm_config).arg("--bindir").run_capture_stdout(builder).stdout();
let llvm_bin_dir = Path::new(llvm_bin_dir.trim());

// Since we've already built the LLVM tools, install them to the sysroot.
Expand Down Expand Up @@ -2170,7 +2170,7 @@ pub fn strip_debug(builder: &Builder<'_>, target: TargetSelection, path: &Path)
}

let previous_mtime = t!(t!(path.metadata()).modified());
command("strip").capture().arg("--strip-debug").arg(path).run(builder);
command("strip").arg("--strip-debug").arg(path).run_capture(builder);

let file = t!(fs::File::open(path));

Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ fn make_win_dist(
//Ask gcc where it keeps its stuff
let mut cmd = command(builder.cc(target));
cmd.arg("-print-search-dirs");
let gcc_out = cmd.capture_stdout().run(builder).stdout();
let gcc_out = cmd.run_capture_stdout(builder).stdout();

let mut bin_path: Vec<_> = env::split_paths(&env::var_os("PATH").unwrap_or_default()).collect();
let mut lib_path = Vec::new();
Expand Down Expand Up @@ -1060,7 +1060,7 @@ impl Step for PlainSourceTarball {
cmd.arg("--sync").arg(manifest_path);
}

let config = cmd.capture().run(builder).stdout();
let config = cmd.run_capture(builder).stdout();

let cargo_config_dir = plain_dst_src.join(".cargo");
builder.create_dir(&cargo_config_dir);
Expand Down Expand Up @@ -2068,7 +2068,7 @@ fn maybe_install_llvm(
let mut cmd = command(llvm_config);
cmd.arg("--libfiles");
builder.verbose(|| println!("running {cmd:?}"));
let files = cmd.capture_stdout().run(builder).stdout();
let files = cmd.run_capture_stdout(builder).stdout();
let build_llvm_out = &builder.llvm_out(builder.config.build);
let target_llvm_out = &builder.llvm_out(target);
for file in files.trim_end().split(' ') {
Expand Down
10 changes: 4 additions & 6 deletions src/bootstrap/src/core/build_steps/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn get_rustfmt_version(build: &Builder<'_>) -> Option<(String, PathBuf)> {
});
cmd.arg("--version");

let output = cmd.capture().allow_failure().run(build);
let output = cmd.allow_failure().run_capture(build);
if output.is_failure() {
return None;
}
Expand Down Expand Up @@ -160,25 +160,23 @@ pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
}
}
let git_available =
helpers::git(None).capture().allow_failure().arg("--version").run(build).is_success();
helpers::git(None).allow_failure().arg("--version").run_capture(build).is_success();

let mut adjective = None;
if git_available {
let in_working_tree = helpers::git(Some(&build.src))
.capture()
.allow_failure()
.arg("rev-parse")
.arg("--is-inside-work-tree")
.run(build)
.run_capture(build)
.is_success();
if in_working_tree {
let untracked_paths_output = helpers::git(Some(&build.src))
.capture_stdout()
.arg("status")
.arg("--porcelain")
.arg("-z")
.arg("--untracked-files=normal")
.run(build)
.run_capture_stdout(build)
.stdout();
let untracked_paths: Vec<_> = untracked_paths_output
.split_terminator('\0')
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ impl Step for Llvm {
builder.ensure(Llvm { target: builder.config.build });
if !builder.config.dry_run() {
let llvm_bindir =
command(&llvm_config).capture_stdout().arg("--bindir").run(builder).stdout();
command(&llvm_config).arg("--bindir").run_capture_stdout(builder).stdout();
let host_bin = Path::new(llvm_bindir.trim());
cfg.define(
"LLVM_TABLEGEN",
Expand Down Expand Up @@ -522,7 +522,7 @@ impl Step for Llvm {
// Helper to find the name of LLVM's shared library on darwin and linux.
let find_llvm_lib_name = |extension| {
let version =
command(&res.llvm_config).capture_stdout().arg("--version").run(builder).stdout();
command(&res.llvm_config).arg("--version").run_capture_stdout(builder).stdout();
let major = version.split('.').next().unwrap();

match &llvm_version_suffix {
Expand Down Expand Up @@ -578,7 +578,7 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
return;
}

let version = command(llvm_config).capture_stdout().arg("--version").run(builder).stdout();
let version = command(llvm_config).arg("--version").run_capture_stdout(builder).stdout();
let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
if major >= 17 {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Step for BuildManifest {
panic!("\n\nfailed to specify `dist.upload-addr` in `config.toml`\n\n")
});

let today = command("date").capture_stdout().arg("+%Y-%m-%d").run(builder).stdout();
let today = command("date").arg("+%Y-%m-%d").run_capture_stdout(builder).stdout();

cmd.arg(sign);
cmd.arg(distdir(builder));
Expand Down
11 changes: 4 additions & 7 deletions src/bootstrap/src/core/build_steps/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl Step for Link {
}

fn rustup_installed(builder: &Builder<'_>) -> bool {
command("rustup").capture_stdout().arg("--version").run(builder).is_success()
command("rustup").arg("--version").run_capture_stdout(builder).is_success()
}

fn stage_dir_exists(stage_path: &str) -> bool {
Expand Down Expand Up @@ -313,10 +313,9 @@ fn attempt_toolchain_link(builder: &Builder<'_>, stage_path: &str) {

fn toolchain_is_linked(builder: &Builder<'_>) -> bool {
match command("rustup")
.capture_stdout()
.allow_failure()
.args(["toolchain", "list"])
.run(builder)
.run_capture_stdout(builder)
.stdout_if_ok()
{
Some(toolchain_list) => {
Expand All @@ -341,9 +340,8 @@ fn toolchain_is_linked(builder: &Builder<'_>) -> bool {

fn try_link_toolchain(builder: &Builder<'_>, stage_path: &str) -> bool {
command("rustup")
.capture_stdout()
.args(["toolchain", "link", "stage1", stage_path])
.run(builder)
.run_capture_stdout(builder)
.is_success()
}

Expand Down Expand Up @@ -481,9 +479,8 @@ impl Step for Hook {
// install a git hook to automatically run tidy, if they want
fn install_git_hook_maybe(builder: &Builder<'_>, config: &Config) -> io::Result<()> {
let git = helpers::git(Some(&config.src))
.capture()
.args(["rev-parse", "--git-common-dir"])
.run(builder)
.run_capture(builder)
.stdout();
let git = PathBuf::from(git.trim());
let hooks_dir = git.join("hooks");
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/src/core/build_steps/suggest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ pub fn suggest(builder: &Builder<'_>, run: bool) {
let git_config = builder.config.git_config();
let suggestions = builder
.tool_cmd(Tool::SuggestTests)
.capture_stdout()
.env("SUGGEST_TESTS_GIT_REPOSITORY", git_config.git_repository)
.env("SUGGEST_TESTS_NIGHTLY_BRANCH", git_config.nightly_branch)
.run(builder)
.run_capture_stdout(builder)
.stdout();

let suggestions = suggestions
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/synthetic_targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn create_synthetic_target(
// we cannot use nightly features. So `RUSTC_BOOTSTRAP` is needed here.
cmd.env("RUSTC_BOOTSTRAP", "1");

let output = cmd.capture().run(builder).stdout();
let output = cmd.run_capture(builder).stdout();
let mut spec: serde_json::Value = serde_json::from_slice(output.as_bytes()).unwrap();
let spec_map = spec.as_object_mut().unwrap();

Expand Down
Loading
Loading