Skip to content

Commit e0e9b04

Browse files
committed
ci: preserve Xcode compiler discovery with ccache launchers
1 parent 97668cb commit e0e9b04

6 files changed

Lines changed: 20 additions & 25 deletions

File tree

‎.github/workflows/build-ios-release.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
run: |
3939
set -o pipefail
4040
xcodebuild \
41-
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
4241
-derivedDataPath build -UseModernBuildSystem=YES \
4342
-workspace NitroExample.xcworkspace \
4443
-scheme NitroExample \

‎.github/workflows/build-ios.yml‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ on:
3737
- '**/nitro.json'
3838

3939
env:
40-
USE_CCACHE: 1
4140
XCODE_VERSION: '26.5'
42-
IOS_SIMULATOR_DESTINATION: 'platform=iOS Simulator,arch=arm64,name=iPhone 17 Pro'
41+
IOS_SIMULATOR_DESTINATION: 'generic/platform=iOS Simulator'
4342

4443
jobs:
4544
build:
@@ -58,7 +57,7 @@ jobs:
5857

5958
- name: Set USE_FRAMEWORKS
6059
if: matrix.use_frameworks != ''
61-
run: echo "USE_FRAMEWORKS=${{ matrix.use_frameworks }}" >> $GITHUB_ENV
60+
run: echo "USE_FRAMEWORKS=${{ matrix.use_frameworks }}" >> "$GITHUB_ENV"
6261

6362
- name: Install npm dependencies (bun)
6463
run: bun install
@@ -68,13 +67,14 @@ jobs:
6867
with:
6968
max-size: 1.5G
7069
key: ${{ runner.os }}-${{ runner.arch }}-xcode${{ env.XCODE_VERSION }}-${{ matrix.use_frameworks }}-ccache-example-ios
71-
create-symlink: true
7270
- name: Setup ccache behavior
7371
run: |
74-
echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" >> $GITHUB_ENV
75-
echo "CCACHE_FILECLONE=true" >> $GITHUB_ENV
76-
echo "CCACHE_DEPEND=true" >> $GITHUB_ENV
77-
echo "CCACHE_INODECACHE=true" >> $GITHUB_ENV
72+
{
73+
echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros"
74+
echo "CCACHE_FILECLONE=true"
75+
echo "CCACHE_DEPEND=true"
76+
echo "CCACHE_INODECACHE=true"
77+
} >> "$GITHUB_ENV"
7878
7979
- name: Setup Ruby (bundle)
8080
uses: ruby/setup-ruby@v1
@@ -110,7 +110,8 @@ jobs:
110110
run: |
111111
set -o pipefail
112112
xcodebuild \
113-
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
113+
C_COMPILER_LAUNCHER="$(command -v ccache)" \
114+
CLANG_ENABLE_EXPLICIT_MODULES_WITH_COMPILER_LAUNCHER=YES \
114115
-derivedDataPath build -UseModernBuildSystem=YES \
115116
-workspace NitroExample.xcworkspace \
116117
-scheme NitroExample \
@@ -119,5 +120,6 @@ jobs:
119120
-destination '${{ env.IOS_SIMULATOR_DESTINATION }}' \
120121
-showBuildTimingSummary \
121122
ONLY_ACTIVE_ARCH=YES \
123+
ARCHS=arm64 \
122124
build \
123125
CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions

‎.github/workflows/harness-ios.yml‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ env:
7878
DEVICE_MODEL: ${{ github.event.inputs.device_model || 'iPhone 17 Pro' }}
7979
IOS_VERSION: ${{ github.event.inputs.ios_version || '26.5' }}
8080
XCODE_VERSION: ${{ github.event.inputs.xcode_version || '26.5' }}
81-
USE_CCACHE: 1
8281
DEVELOPER_DIR: /Applications/Xcode_${{ github.event.inputs.xcode_version || '26.5' }}.app/Contents/Developer
8382
HARNESS_DEBUG: 1
8483

@@ -111,13 +110,14 @@ jobs:
111110
with:
112111
max-size: 1.5G
113112
key: ${{ runner.os }}-${{ runner.arch }}-xcode${{ env.XCODE_VERSION }}-${{ matrix.sanitizer.name }}-ccache-example-ios
114-
create-symlink: true
115113
- name: Setup ccache behavior
116114
run: |
117-
echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" >> $GITHUB_ENV
118-
echo "CCACHE_FILECLONE=true" >> $GITHUB_ENV
119-
echo "CCACHE_DEPEND=true" >> $GITHUB_ENV
120-
echo "CCACHE_INODECACHE=true" >> $GITHUB_ENV
115+
{
116+
echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros"
117+
echo "CCACHE_FILECLONE=true"
118+
echo "CCACHE_DEPEND=true"
119+
echo "CCACHE_INODECACHE=true"
120+
} >> "$GITHUB_ENV"
121121
122122
- name: Setup Ruby (bundle)
123123
uses: ruby/setup-ruby@v1
@@ -152,11 +152,10 @@ jobs:
152152
working-directory: apps/example/ios
153153
run: |
154154
set -o pipefail
155-
CLANG="$(xcrun -f clang)"
156-
CLANGXX="$(xcrun -f clang++)"
157155
SANITIZER_FLAGS="${{ matrix.sanitizer.xcodebuild_flags }}"
158156
xcodebuild \
159-
CC="${CLANG}" CPLUSPLUS="${CLANGXX}" LD="${CLANG}" LDPLUSPLUS="${CLANGXX}" \
157+
C_COMPILER_LAUNCHER="$(command -v ccache)" \
158+
CLANG_ENABLE_EXPLICIT_MODULES_WITH_COMPILER_LAUNCHER=YES \
160159
-derivedDataPath build -UseModernBuildSystem=YES \
161160
-workspace NitroExample.xcworkspace \
162161
-scheme NitroExample \

‎apps/benchmark/ios/NitroBenchmark.xcodeproj/project.pbxproj‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@
287287
OTHER_LDFLAGS = (
288288
"$(inherited)",
289289
"-ObjC",
290-
"-lc++",
291290
);
292291
PRODUCT_BUNDLE_IDENTIFIER = com.margelo.nitrobenchmark;
293292
PRODUCT_NAME = NitroBenchmark;
@@ -326,7 +325,6 @@
326325
OTHER_LDFLAGS = (
327326
"$(inherited)",
328327
"-ObjC",
329-
"-lc++",
330328
);
331329
PRODUCT_BUNDLE_IDENTIFIER = com.margelo.nitrobenchmark;
332330
PRODUCT_NAME = NitroBenchmark;
@@ -398,7 +396,6 @@
398396
);
399397
LIBRARY_SEARCH_PATHS = (
400398
"\"$(SDKROOT)/usr/lib/swift\"",
401-
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
402399
"\"$(inherited)\"",
403400
);
404401
MTL_ENABLE_DEBUG_INFO = YES;
@@ -473,7 +470,6 @@
473470
);
474471
LIBRARY_SEARCH_PATHS = (
475472
"\"$(SDKROOT)/usr/lib/swift\"",
476-
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
477473
"\"$(inherited)\"",
478474
);
479475
MTL_ENABLE_DEBUG_INFO = NO;

‎apps/example/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"pods": "cd ios && bundle exec pod install",
1616
"build:android": "cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
1717
"build:android-release": "cd android && ./gradlew assembleRelease --no-daemon",
18-
"build:ios": "cd ios && xcodebuild -workspace NitroExample.xcworkspace -scheme NitroExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
18+
"build:ios": "cd ios && xcodebuild -workspace NitroExample.xcworkspace -scheme NitroExample -configuration Debug -sdk iphonesimulator GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
1919
"test:harness": "react-native-harness"
2020
},
2121
"dependencies": {

‎scripts/performance/build-ios.sh‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ bundle install
77
bun pods
88
cd ios
99
xcodebuild \
10-
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
1110
-derivedDataPath build-benchmark \
1211
-workspace NitroBenchmark.xcworkspace \
1312
-scheme NitroBenchmark \

0 commit comments

Comments
 (0)