diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
commit | a0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch) | |
tree | fc451898ccaf445814e26b46664d78702178101d /compiler/rustc_codegen_cranelift/scripts | |
parent | Adding debian version 1.71.1+dfsg1-2. (diff) | |
download | rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_codegen_cranelift/scripts')
6 files changed, 88 insertions, 68 deletions
diff --git a/compiler/rustc_codegen_cranelift/scripts/cargo-clif.rs b/compiler/rustc_codegen_cranelift/scripts/cargo-clif.rs index e2db7d03a..99b97be24 100644 --- a/compiler/rustc_codegen_cranelift/scripts/cargo-clif.rs +++ b/compiler/rustc_codegen_cranelift/scripts/cargo-clif.rs @@ -12,24 +12,33 @@ fn main() { let mut rustflags = String::new(); rustflags.push_str(" -Cpanic=abort -Zpanic-abort-tests -Zcodegen-backend="); - rustflags.push_str( - sysroot - .join(if cfg!(windows) { "bin" } else { "lib" }) - .join( - env::consts::DLL_PREFIX.to_string() - + "rustc_codegen_cranelift" - + env::consts::DLL_SUFFIX, - ) - .to_str() - .unwrap(), - ); + if let Some(name) = option_env!("BUILTIN_BACKEND") { + rustflags.push_str(name); + } else { + rustflags.push_str( + sysroot + .join(if cfg!(windows) { "bin" } else { "lib" }) + .join( + env::consts::DLL_PREFIX.to_string() + + "rustc_codegen_cranelift" + + env::consts::DLL_SUFFIX, + ) + .to_str() + .unwrap(), + ); + } rustflags.push_str(" --sysroot "); rustflags.push_str(sysroot.to_str().unwrap()); env::set_var("RUSTFLAGS", env::var("RUSTFLAGS").unwrap_or(String::new()) + &rustflags); env::set_var("RUSTDOCFLAGS", env::var("RUSTDOCFLAGS").unwrap_or(String::new()) + &rustflags); - // Ensure that the right toolchain is used - env::set_var("RUSTUP_TOOLCHAIN", env!("TOOLCHAIN_NAME")); + let cargo = if let Some(cargo) = option_env!("CARGO") { + cargo + } else { + // Ensure that the right toolchain is used + env::set_var("RUSTUP_TOOLCHAIN", option_env!("TOOLCHAIN_NAME").expect("TOOLCHAIN_NAME")); + "cargo" + }; let args: Vec<_> = match env::args().nth(1).as_deref() { Some("jit") => { @@ -64,10 +73,10 @@ fn main() { }; #[cfg(unix)] - panic!("Failed to spawn cargo: {}", Command::new("cargo").args(args).exec()); + panic!("Failed to spawn cargo: {}", Command::new(cargo).args(args).exec()); #[cfg(not(unix))] std::process::exit( - Command::new("cargo").args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1), + Command::new(cargo).args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1), ); } diff --git a/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs b/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs index ab496a4a6..33d51bddd 100644 --- a/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs +++ b/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs @@ -19,23 +19,34 @@ fn main() { let mut args = vec![]; args.push(OsString::from("-Cpanic=abort")); args.push(OsString::from("-Zpanic-abort-tests")); - let mut codegen_backend_arg = OsString::from("-Zcodegen-backend="); - codegen_backend_arg.push(cg_clif_dylib_path); - args.push(codegen_backend_arg); - if !passed_args.contains(&OsString::from("--sysroot")) { + if let Some(name) = option_env!("BUILTIN_BACKEND") { + args.push(OsString::from(format!("-Zcodegen-backend={name}"))) + } else { + let mut codegen_backend_arg = OsString::from("-Zcodegen-backend="); + codegen_backend_arg.push(cg_clif_dylib_path); + args.push(codegen_backend_arg); + } + if !passed_args.iter().any(|arg| { + arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true) + }) { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap())); } args.extend(passed_args); - // Ensure that the right toolchain is used - env::set_var("RUSTUP_TOOLCHAIN", env!("TOOLCHAIN_NAME")); + let rustc = if let Some(rustc) = option_env!("RUSTC") { + rustc + } else { + // Ensure that the right toolchain is used + env::set_var("RUSTUP_TOOLCHAIN", option_env!("TOOLCHAIN_NAME").expect("TOOLCHAIN_NAME")); + "rustc" + }; #[cfg(unix)] - panic!("Failed to spawn rustc: {}", Command::new("rustc").args(args).exec()); + panic!("Failed to spawn rustc: {}", Command::new(rustc).args(args).exec()); #[cfg(not(unix))] std::process::exit( - Command::new("rustc").args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1), + Command::new(rustc).args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1), ); } diff --git a/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs b/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs index 545844446..10582cc7b 100644 --- a/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs +++ b/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs @@ -19,23 +19,34 @@ fn main() { let mut args = vec![]; args.push(OsString::from("-Cpanic=abort")); args.push(OsString::from("-Zpanic-abort-tests")); - let mut codegen_backend_arg = OsString::from("-Zcodegen-backend="); - codegen_backend_arg.push(cg_clif_dylib_path); - args.push(codegen_backend_arg); - if !passed_args.contains(&OsString::from("--sysroot")) { + if let Some(name) = option_env!("BUILTIN_BACKEND") { + args.push(OsString::from(format!("-Zcodegen-backend={name}"))) + } else { + let mut codegen_backend_arg = OsString::from("-Zcodegen-backend="); + codegen_backend_arg.push(cg_clif_dylib_path); + args.push(codegen_backend_arg); + } + if !passed_args.iter().any(|arg| { + arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true) + }) { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap())); } args.extend(passed_args); - // Ensure that the right toolchain is used - env::set_var("RUSTUP_TOOLCHAIN", env!("TOOLCHAIN_NAME")); + let rustdoc = if let Some(rustdoc) = option_env!("RUSTDOC") { + rustdoc + } else { + // Ensure that the right toolchain is used + env::set_var("RUSTUP_TOOLCHAIN", option_env!("TOOLCHAIN_NAME").expect("TOOLCHAIN_NAME")); + "rustdoc" + }; #[cfg(unix)] - panic!("Failed to spawn rustdoc: {}", Command::new("rustdoc").args(args).exec()); + panic!("Failed to spawn rustdoc: {}", Command::new(rustdoc).args(args).exec()); #[cfg(not(unix))] std::process::exit( - Command::new("rustdoc").args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1), + Command::new(rustdoc).args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1), ); } diff --git a/compiler/rustc_codegen_cranelift/scripts/rustup.sh b/compiler/rustc_codegen_cranelift/scripts/rustup.sh index 3cbeb6375..e62788f2e 100755 --- a/compiler/rustc_codegen_cranelift/scripts/rustup.sh +++ b/compiler/rustc_codegen_cranelift/scripts/rustup.sh @@ -32,12 +32,10 @@ case $1 in ./clean_all.sh - ./y.rs prepare - - (cd download/sysroot && cargo update && cargo fetch && cp Cargo.lock ../../build_sysroot/) + ./y.sh prepare ;; "commit") - git add rust-toolchain build_sysroot/Cargo.lock + git add rust-toolchain git commit -m "Rustup to $(rustc -V)" ;; "push") diff --git a/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh b/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh index abb09775d..15b16b42b 100644 --- a/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh +++ b/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -./y.rs build --no-unstable-features +./y.sh build --no-unstable-features echo "[SETUP] Rust fork" git clone https://github.com/rust-lang/rust.git || true diff --git a/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh b/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh index 1329d3ea0..a7920cc54 100755 --- a/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh +++ b/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh @@ -10,12 +10,17 @@ pushd rust command -v rg >/dev/null 2>&1 || cargo install ripgrep -# FIXME add needs-asm-support to all tests in tests/ui/asm rm -r tests/ui/{unsized-locals/,lto/,linkage*} || true -for test in $(rg --files-with-matches "lto|// needs-asm-support|// needs-unwind" tests/{codegen-units,ui,incremental}); do +for test in $(rg --files-with-matches "lto|// needs-asm-support" tests/{codegen-units,ui,incremental}); do rm $test done +for test in tests/run-make/**/Makefile; do + if rg "# needs-asm-support" $test >/dev/null; then + rm -r $(dirname $test) + fi +done + for test in $(rg -i --files-with-matches "//(\[\w+\])?~[^\|]*\s*ERR|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" tests/ui); do rm $test done @@ -28,30 +33,20 @@ rm tests/ui/parser/unclosed-delimiter-in-dep.rs # submodule contains //~ERROR # ================ # requires stack unwinding -# FIXME add needs-unwind to these tests -rm tests/incremental/change_crate_dep_kind.rs -rm tests/incremental/issue-80691-bad-eval-cache.rs # -Cpanic=abort causes abort instead of exit(101) -rm -r tests/run-make/c-unwind-abi-catch-lib-panic -rm -r tests/run-make/c-unwind-abi-catch-panic -rm -r tests/run-make/debug-assertions -rm -r tests/run-make/foreign-double-unwind -rm -r tests/run-make/foreign-exceptions -rm -r tests/run-make/foreign-rust-exceptions -rm -r tests/run-make/libtest-json -rm -r tests/run-make/static-unwinding - -# requires compiling with -Cpanic=unwind -rm -r tests/ui/macros/rfc-2011-nicer-assert-messages/ -rm -r tests/run-make/test-benches -rm tests/ui/test-attrs/test-type.rs -rm -r tests/run-make/const_fn_mir -rm -r tests/run-make/intrinsic-unreachable +# FIXME add needs-unwind to this test +rm -r tests/run-make/libtest-junit + +# extra warning about -Cpanic=abort for proc macros +rm tests/ui/proc-macro/crt-static.rs +rm tests/ui/proc-macro/proc-macro-deprecated-attr.rs +rm tests/ui/proc-macro/quote-debug.rs +rm tests/ui/proc-macro/no-missing-docs.rs +rm tests/ui/rust-2018/proc-macro-crate-in-paths.rs +rm tests/ui/proc-macro/allowed-signatures.rs # vendor intrinsics rm tests/ui/sse2.rs # cpuid not supported, so sse2 not detected -rm tests/ui/intrinsics/const-eval-select-x86_64.rs # requires x86_64 vendor intrinsics rm tests/ui/simd/array-type.rs # "Index argument for `simd_insert` is not a constant" -rm tests/ui/simd/intrinsic/float-math-pass.rs # simd_fcos unimplemented # exotic linkages rm tests/ui/issues/issue-33992.rs # unsupported linkages @@ -85,6 +80,7 @@ rm -r tests/run-make/issue-64153 rm -r tests/run-make/codegen-options-parsing rm -r tests/run-make/lto-* rm -r tests/run-make/reproducible-build-2 +rm -r tests/run-make/issue-109934-lto-debuginfo # optimization tests # ================== @@ -120,13 +116,8 @@ rm tests/ui/lint/lint-const-item-mutation.rs # same rm tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs # same rm tests/ui/suggestions/derive-trait-for-method-call.rs # same rm tests/ui/typeck/issue-46112.rs # same - -rm tests/ui/proc-macro/crt-static.rs # extra warning about -Cpanic=abort for proc macros -rm tests/ui/proc-macro/proc-macro-deprecated-attr.rs # same -rm tests/ui/proc-macro/quote-debug.rs # same -rm tests/ui/proc-macro/no-missing-docs.rs # same -rm tests/ui/rust-2018/proc-macro-crate-in-paths.rs # same -rm tests/ui/proc-macro/allowed-signatures.rs # same +rm tests/ui/consts/const_cmp_type_id.rs # same +rm tests/ui/consts/issue-73976-monomorphic.rs # same # rustdoc-clif passes extra args, suppressing the help message when no args are passed rm -r tests/run-make/issue-88756-default-output @@ -142,15 +133,15 @@ rm -r tests/ui/consts/missing_span_in_backtrace.rs # expects sysroot source to b rm tests/incremental/spike-neg1.rs # errors out for some reason rm tests/incremental/spike-neg2.rs # same -rm tests/ui/simd/intrinsic/generic-reduction-pass.rs # simd_reduce_add_unordered doesn't accept an accumulator for integer vectors - -rm tests/ui/simd/simd-bitmask.rs # crash +rm tests/ui/simd/simd-bitmask.rs # simd_bitmask doesn't implement [u*; N] return type rm -r tests/run-make/issue-51671 # wrong filename given in case of --emit=obj rm -r tests/run-make/issue-30063 # same rm -r tests/run-make/multiple-emits # same rm -r tests/run-make/output-type-permutations # same rm -r tests/run-make/used # same +rm -r tests/run-make/no-alloc-shim +rm -r tests/run-make/emit-to-stdout # bugs in the test suite # ====================== |