Skip to content
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
7 changes: 3 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions ci/actions-templates/macos-builds-template.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ get_architecture() {
# See: <https://support.apple.com/en-us/HT208436>

# 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
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}.",
Expand Down
5 changes: 5 additions & 0 deletions src/test/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Loading