diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 019daf80df..526a4c21bd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1068,13 +1068,12 @@ jobs: run: | cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache - # This is ci/actions-templates/macos-builds-template.yaml # Do not edit this file in .github/workflows build-macos-x86_64: # job-name skip-aarch64 - runs-on: macos-13 # skip-aarch64 env: # skip-aarch64 MACOSX_DEPLOYMENT_TARGET: 10.12 # skip-aarch64 + runs-on: macos-latest permissions: id-token: write contents: read @@ -1143,6 +1142,7 @@ jobs: - name: Run a full build and test env: BUILD_PROFILE: ${{ matrix.mode }} + shell: arch -x86_64 bash -e {0} # skip-aarch64 run: bash ci/run.bash - name: Dump dynamic link targets if: matrix.mode == 'release' @@ -1200,13 +1200,12 @@ jobs: # https://github.com/actions/cache/issues/403 and # https://github.com/rust-lang/cargo/issues/8603. run: sudo /usr/sbin/purge - # This is ci/actions-templates/macos-builds-template.yaml # Do not edit this file in .github/workflows build-macos-aarch64: # job-name skip-x86_64 - runs-on: macos-latest # skip-x86_64 env: # skip-x86_64 MACOSX_DEPLOYMENT_TARGET: 11.0 # skip-x86_64 + runs-on: macos-latest permissions: id-token: write contents: read diff --git a/ci/actions-templates/macos-builds-template.yaml b/ci/actions-templates/macos-builds-template.yaml index 9f642ed3a4..34fb7f4734 100644 --- a/ci/actions-templates/macos-builds-template.yaml +++ b/ci/actions-templates/macos-builds-template.yaml @@ -1,15 +1,13 @@ jobs: # skip-x86_64 skip-aarch64 - # This is ci/actions-templates/macos-builds-template.yaml # Do not edit this file in .github/workflows build-macos-aarch64: # job-name skip-x86_64 - runs-on: macos-latest # skip-x86_64 env: # skip-x86_64 MACOSX_DEPLOYMENT_TARGET: 11.0 # skip-x86_64 build-macos-x86_64: # job-name skip-aarch64 - runs-on: macos-13 # skip-aarch64 env: # skip-aarch64 MACOSX_DEPLOYMENT_TARGET: 10.12 # skip-aarch64 + runs-on: macos-latest permissions: id-token: write contents: read @@ -79,6 +77,7 @@ jobs: # skip-x86_64 skip-aarch64 - name: Run a full build and test env: BUILD_PROFILE: ${{ matrix.mode }} + shell: arch -x86_64 bash -e {0} # skip-aarch64 run: bash ci/run.bash - name: Dump dynamic link targets if: matrix.mode == 'release' diff --git a/rustup-init.sh b/rustup-init.sh index e8da63b196..6a50beacb5 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -348,7 +348,7 @@ get_architecture() { # See: # Avoid `sysctl: unknown oid` stderr output and/or non-zero exit code. - if sysctl hw.optional.x86_64 2> /dev/null || true | grep -q ': 1'; then + if (sysctl hw.optional.x86_64 2> /dev/null || true) | grep -q ': 1'; then _cputype=x86_64 fi elif [ "$_cputype" = x86_64 ]; then @@ -357,7 +357,7 @@ get_architecture() { # Rosetta 2 is built exclusively for x86-64 and cannot run i386 binaries. # Avoid `sysctl: unknown oid` stderr output and/or non-zero exit code. - if sysctl hw.optional.arm64 2> /dev/null || true | grep -q ': 1'; then + if (sysctl hw.optional.arm64 2> /dev/null || true) | grep -q ': 1'; then _cputype=arm64 fi fi diff --git a/src/cli/common.rs b/src/cli/common.rs index 031d149c95..12bdad7dbd 100644 --- a/src/cli/common.rs +++ b/src/cli/common.rs @@ -630,6 +630,11 @@ pub(crate) fn check_non_host_toolchain( /// Warns if rustup is running under emulation, such as macOS Rosetta pub(crate) fn warn_if_host_is_emulated(process: &Process) { + // In rustup's own CI, we wouldn't want host emulation warnings to mess up the + // end-to-end test results. + if process.var("RUSTUP_CI").is_ok() { + return; + } if TargetTriple::is_host_emulated() { warn!( "Rustup is not running natively. It's running under emulation of {}.", diff --git a/src/test/clitools.rs b/src/test/clitools.rs index 4501e1db8a..5e9a98590e 100644 --- a/src/test/clitools.rs +++ b/src/test/clitools.rs @@ -277,6 +277,11 @@ impl Config { "/bogus-config-file.toml", ); + // Pass `RUSTUP_CI` over to the test process in case it is required downstream + if let Some(ci) = env::var_os("RUSTUP_CI") { + cmd.env("RUSTUP_CI", ci); + } + if let Some(root) = self.rustup_update_root.as_ref() { cmd.env("RUSTUP_UPDATE_ROOT", root); }