Skip to content

Commit 8a75c5a

Browse files
committed
Auto merge of rust-lang#104650 - BlackHoleFox:stuck-with-xcode-13, r=Mark-Simulacrum
Build macOS distribution artifacts with XCode 13 After all of the `rust-lang/rust` Apple runners started using macOS 12, the builds created by CI began to use XCode 14.0.1. Due to this (as far as we can tell), XCode's build tools started to ignore the `MACOSX_DEPLOYMENT_TARGET` being defined by us for the distributed builds that let both `rustc` and `libstd` work on older versions. The current idea is that since XCode 14's macOS SDK doesn't support deployment targets before 10.13, it uses some default of its own. You can see the difference between stable's and the most recent nighty's supported versions [here](rust-lang#104570 (comment)). I wasn't able to confirm my SDK versioning hypothesis locally since I think there's something jammed with my XCode installation, but hopefully this should still fix it for releases. Closes rust-lang#104570 r? `@Mark-Simulacrum`
2 parents 41e0363 + cda219e commit 8a75c5a

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

.github/workflows/ci.yml

+13
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ jobs:
9696
- name: install sccache
9797
run: src/ci/scripts/install-sccache.sh
9898
if: success() && !env.SKIP_JOB
99+
- name: select Xcode
100+
run: src/ci/scripts/select-xcode.sh
101+
if: success() && !env.SKIP_JOB
99102
- name: install clang
100103
run: src/ci/scripts/install-clang.sh
101104
if: success() && !env.SKIP_JOB
@@ -301,6 +304,7 @@ jobs:
301304
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
302305
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
303306
MACOSX_DEPLOYMENT_TARGET: 10.7
307+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
304308
NO_LLVM_ASSERTIONS: 1
305309
NO_DEBUG_ASSERTIONS: 1
306310
NO_OVERFLOW_CHECKS: 1
@@ -312,6 +316,7 @@ jobs:
312316
RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
313317
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
314318
MACOSX_DEPLOYMENT_TARGET: 10.7
319+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
315320
NO_LLVM_ASSERTIONS: 1
316321
NO_DEBUG_ASSERTIONS: 1
317322
NO_OVERFLOW_CHECKS: 1
@@ -322,6 +327,7 @@ jobs:
322327
RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
323328
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
324329
MACOSX_DEPLOYMENT_TARGET: 10.7
330+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
325331
NO_LLVM_ASSERTIONS: 1
326332
NO_DEBUG_ASSERTIONS: 1
327333
NO_OVERFLOW_CHECKS: 1
@@ -353,6 +359,7 @@ jobs:
353359
SCRIPT: "./x.py dist bootstrap --include-default-paths --stage 2"
354360
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --disable-docs --set rust.jemalloc --set llvm.ninja=false"
355361
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
362+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
356363
USE_XCODE_CLANG: 1
357364
MACOSX_DEPLOYMENT_TARGET: 11.0
358365
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
@@ -503,6 +510,9 @@ jobs:
503510
- name: install sccache
504511
run: src/ci/scripts/install-sccache.sh
505512
if: success() && !env.SKIP_JOB
513+
- name: select Xcode
514+
run: src/ci/scripts/select-xcode.sh
515+
if: success() && !env.SKIP_JOB
506516
- name: install clang
507517
run: src/ci/scripts/install-clang.sh
508518
if: success() && !env.SKIP_JOB
@@ -615,6 +625,9 @@ jobs:
615625
- name: install sccache
616626
run: src/ci/scripts/install-sccache.sh
617627
if: success() && !env.SKIP_JOB
628+
- name: select Xcode
629+
run: src/ci/scripts/select-xcode.sh
630+
if: success() && !env.SKIP_JOB
618631
- name: install clang
619632
run: src/ci/scripts/install-clang.sh
620633
if: success() && !env.SKIP_JOB

src/ci/github-actions/ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ x--expand-yaml-anchors--remove:
153153
run: src/ci/scripts/install-sccache.sh
154154
<<: *step
155155

156+
- name: select Xcode
157+
run: src/ci/scripts/select-xcode.sh
158+
<<: *step
159+
156160
- name: install clang
157161
run: src/ci/scripts/install-clang.sh
158162
<<: *step
@@ -466,6 +470,7 @@ jobs:
466470
RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
467471
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
468472
MACOSX_DEPLOYMENT_TARGET: 10.7
473+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
469474
NO_LLVM_ASSERTIONS: 1
470475
NO_DEBUG_ASSERTIONS: 1
471476
NO_OVERFLOW_CHECKS: 1
@@ -478,6 +483,7 @@ jobs:
478483
RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
479484
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
480485
MACOSX_DEPLOYMENT_TARGET: 10.7
486+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
481487
NO_LLVM_ASSERTIONS: 1
482488
NO_DEBUG_ASSERTIONS: 1
483489
NO_OVERFLOW_CHECKS: 1
@@ -489,6 +495,7 @@ jobs:
489495
RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false
490496
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
491497
MACOSX_DEPLOYMENT_TARGET: 10.7
498+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
492499
NO_LLVM_ASSERTIONS: 1
493500
NO_DEBUG_ASSERTIONS: 1
494501
NO_OVERFLOW_CHECKS: 1
@@ -527,6 +534,7 @@ jobs:
527534
--set rust.jemalloc
528535
--set llvm.ninja=false
529536
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
537+
SELECT_XCODE: /Applications/Xcode_13.4.1.app
530538
USE_XCODE_CLANG: 1
531539
MACOSX_DEPLOYMENT_TARGET: 11.0
532540
MACOSX_STD_DEPLOYMENT_TARGET: 11.0

src/ci/scripts/select-xcode.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# This script selects the Xcode instance to use.
3+
4+
set -euo pipefail
5+
IFS=$'\n\t'
6+
7+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
8+
9+
if isMacOS; then
10+
if [[ -s "${SELECT_XCODE-}" ]]; then
11+
sudo xcode-select -s "${SELECT_XCODE}"
12+
fi
13+
fi

0 commit comments

Comments
 (0)