|
2 | 2 | set -euo pipefail |
3 | 3 | echo "The build architecture is ${ImageOS}" |
4 | 4 |
|
5 | | -echo "================ TOOLCHAIN DIAGNOSTICS (BEGIN) ================" |
6 | | - |
7 | | -echo "ImageOS=${ImageOS}" |
8 | | -echo "INTEL=${INTEL}" |
9 | | -echo "RUNNER_ARCH=${RUNNER_ARCH:-<unset>}" |
10 | | -echo "uname -m: $(uname -m)" |
11 | | -echo |
12 | | - |
13 | | -echo "--- xcode-select ---" |
14 | | -xcode-select -p || echo "xcode-select -p FAILED" |
15 | | - |
16 | | -echo "--- available Xcodes ---" |
17 | | -ls -d /Applications/Xcode*.app 2>/dev/null || echo "No Xcode apps found in /Applications" |
18 | | - |
19 | | -echo "--- DEVELOPER_DIR ---" |
20 | | -echo "DEVELOPER_DIR=${DEVELOPER_DIR:-<unset>}" |
21 | | - |
22 | | -echo "--- clang ---" |
23 | | -clang --version || echo "clang not found or failed" |
24 | | - |
25 | | -echo "--- xcrun sdk path ---" |
26 | | -xcrun --sdk macosx --show-sdk-path || echo "xcrun failed" |
27 | | - |
28 | | -echo "--- cc ---" |
29 | | -which cc || echo "cc not found" |
30 | | -cc --version || echo "cc failed" |
31 | | - |
32 | | -echo "--- make ---" |
33 | | -which make || echo "make not found" |
34 | | -make --version || echo "make failed" |
35 | | - |
36 | | -echo "================ TOOLCHAIN DIAGNOSTICS (END) ==================" |
37 | | -echo |
38 | | - |
39 | | - |
40 | 5 | # macOS 15 runner setup (arm64 host). We support both: |
41 | 6 | # - INTEL=true => x86_64 portable Ruby (Rosetta) + x86_64 Homebrew (/usr/local) |
42 | 7 | # - INTEL=false => arm64 portable Ruby (native) + arm64 Homebrew (/opt/homebrew) |
|
56 | 21 | # sudo rvm implode --force # rvm PATH rewriting interferes with portable Ruby. |
57 | 22 | if [ "${ImageOS}" == "macos15" ]; then |
58 | 23 |
|
| 24 | + # ---- Make sure Xcode toolchain is actually usable for building native gems ---- |
| 25 | + echo "---- Xcode sanity ----" |
| 26 | + sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer || true |
| 27 | + sudo xcodebuild -license accept || true |
| 28 | + sudo xcodebuild -runFirstLaunch || true |
| 29 | + |
| 30 | + export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" |
| 31 | + export CC=clang |
| 32 | + export CXX=clang++ |
| 33 | + # Pin this to something reasonable for Ruby 3.2 on GH runners |
| 34 | + export MACOSX_DEPLOYMENT_TARGET=14.0 |
| 35 | + |
| 36 | + echo "SDKROOT=$SDKROOT" |
| 37 | + echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" |
| 38 | + echo "CC=$(which $CC) ; $CC --version | head -n 1" |
| 39 | + |
| 40 | + |
59 | 41 | brew update > $GITHUB_WORKSPACE/spec/files/logs/brew-update.log |
60 | 42 | brew install pv tree coreutils shared-mime-info |
61 | 43 |
|
|
0 commit comments