Skip to content

Commit fad1b7f

Browse files
authored
Merge branch 'v8' into antonis/v8-sample-ios
2 parents 9d62b3b + bbe7264 commit fad1b7f

14 files changed

Lines changed: 391 additions & 143 deletions

File tree

.github/workflows/sample-application-expo.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,24 @@ jobs:
4343
build-type: ['dev', 'production']
4444
include:
4545
- platform: ios
46-
xcode-version: '16.4'
47-
runs-on: macos-15
46+
runs-on: ["ghcr.io/cirruslabs/macos-sequoia-xcode:16.4", "runner_group_id:12"]
4847
- platform: android
49-
runs-on: ubuntu-latest
48+
runs-on: ["ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04", "runner_group_id:12"]
5049
- platform: web
51-
runs-on: ubuntu-latest
50+
runs-on: ["ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04", "runner_group_id:12"]
5251
exclude:
5352
- platform: 'android'
5453
ios-use-frameworks: 'dynamic-frameworks'
5554
steps:
5655
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5756

5857
- name: Enable Corepack
59-
run: npm i -g corepack
58+
run: corepack enable
59+
60+
- name: Install Ninja
61+
if: ${{ matrix.platform == 'android' }}
62+
run: sudo apt-get update && sudo apt-get install -y ninja-build
63+
6064
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
6165
with:
6266
package-manager-cache: false
@@ -80,9 +84,6 @@ jobs:
8084
- name: Gradle cache
8185
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
8286

83-
- run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
84-
if: ${{ matrix.platform == 'ios' }}
85-
8687
- name: Setup Global Xcode Tools
8788
if: ${{ matrix.platform == 'ios' }}
8889
run: which xcbeautify || brew install xcbeautify
@@ -136,6 +137,7 @@ jobs:
136137
-sdk 'iphonesimulator' \
137138
-destination 'generic/platform=iOS Simulator' \
138139
ONLY_ACTIVE_ARCH=yes \
140+
ARCHS=arm64 \
139141
-derivedDataPath "$derivedData" \
140142
build \
141143
| tee xcodebuild.log \

.github/workflows/sample-application.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ jobs:
5252
build-type: ['dev', 'production']
5353
include:
5454
- platform: ios
55-
xcode-version: '16.4'
56-
runs-on: macos-15
55+
runs-on: ["ghcr.io/cirruslabs/macos-sequoia-xcode:16.4", "runner_group_id:12"]
5756
- platform: macos
58-
runs-on: macos-15
57+
runs-on: ["ghcr.io/cirruslabs/macos-sequoia-xcode:16.4", "runner_group_id:12"]
5958
- platform: android
60-
runs-on: ubuntu-latest
59+
runs-on: ["ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04", "runner_group_id:12"]
6160
exclude:
6261
- platform: 'android'
6362
ios-use-frameworks: 'dynamic-frameworks'
@@ -71,7 +70,12 @@ jobs:
7170
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
7271

7372
- name: Enable Corepack
74-
run: npm i -g corepack
73+
run: corepack enable
74+
75+
- name: Install Ninja
76+
if: ${{ matrix.platform == 'android' }}
77+
run: sudo apt-get update && sudo apt-get install -y ninja-build
78+
7579
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
7680
with:
7781
package-manager-cache: false
@@ -95,11 +99,8 @@ jobs:
9599
- name: Gradle cache
96100
uses: gradle/gradle-build-action@v3
97101

98-
- run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
99-
if: ${{ matrix.platform == 'ios' }}
100-
101102
- name: Setup Global Xcode Tools
102-
if: ${{ matrix.platform == 'ios' }}
103+
if: ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
103104
run: which xcbeautify || brew install xcbeautify
104105

105106
- name: Install SDK Dependencies
@@ -227,6 +228,10 @@ jobs:
227228
with:
228229
version: ${{env.MAESTRO_VERSION}}
229230

231+
- name: Install Ninja
232+
if: ${{ matrix.platform == 'android' }}
233+
run: sudo apt-get update && sudo apt-get install -y ninja-build
234+
230235
- name: Download iOS App Archive
231236
if: ${{ matrix.platform == 'ios' }}
232237
uses: actions/download-artifact@v7
@@ -254,7 +259,8 @@ jobs:
254259
rm app-androidTest.apk
255260
256261
- name: Enable Corepack
257-
run: npm i -g corepack
262+
run: corepack enable
263+
258264
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
259265
with:
260266
package-manager-cache: false

.github/workflows/testflight.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@ jobs:
1414

1515
upload_to_testflight:
1616
name: Build and Upload React Native Sample to Testflight
17-
runs-on: macos-15
17+
runs-on: ["ghcr.io/cirruslabs/macos-sequoia-xcode:16.4", "runner_group_id:12"]
1818
needs: [diff_check]
1919
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
2020
steps:
2121
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
22-
- run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
2322
- uses: ruby/setup-ruby@v1
2423
with:
2524
working-directory: samples/react-native
2625
ruby-version: '3.3.0' # based on what is used in the sample
2726
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
2827
cache-version: 1 # cache the installed gems
29-
- run: npm i -g corepack
28+
- run: corepack enable
3029
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
3130
with:
3231
package-manager-cache: false

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@
3232
- Bump Cocoa SDK from v9.3.0 to v9.4.0 ([#5619](https://github.com/getsentry/sentry-react-native/pull/5619))
3333
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#940)
3434
- [diff](https://github.com/getsentry/sentry-cocoa/compare/9.3.0...9.4.0)
35+
- Bump Bundler Plugins from v4.9.0 to v4.9.1 ([#5649](https://github.com/getsentry/sentry-react-native/pull/5649))
36+
- [changelog](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/main/CHANGELOG.md#491)
37+
- [diff](https://github.com/getsentry/sentry-javascript-bundler-plugins/compare/4.9.0...4.9.1)
38+
39+
## 7.12.1
40+
41+
### Fixes
42+
43+
- Revert inputPaths to fix circular dependency build errors on iOS ([#5644](https://github.com/getsentry/sentry-react-native/pull/5644))
3544

3645
## 8.0.0-beta.0
3746

@@ -138,6 +147,10 @@ See our [migration docs](https://docs.sentry.io/platforms/react-native/migration
138147

139148
## 7.12.0
140149

150+
> [!WARNING]
151+
> This release contains an issue that can cause iOS builds to fail with circular dependency errors.
152+
> See issue [#5641](https://github.com/getsentry/sentry-react-native/issues/5641) for more details.
153+
141154
### Features
142155

143156
- Extends the experimental support of UI profiling to iOS ([#5611](https://github.com/getsentry/sentry-react-native/pull/5611))

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
"performance-tests/*"
99
],
1010
"npmClient": "yarn"
11-
}
11+
}

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"react-native": ">=0.65.0"
6969
},
7070
"dependencies": {
71-
"@sentry/babel-plugin-component-annotate": "4.9.0",
71+
"@sentry/babel-plugin-component-annotate": "4.9.1",
7272
"@sentry/browser": "10.38.0",
7373
"@sentry/cli": "3.2.0",
7474
"@sentry/core": "10.38.0",

packages/core/plugin/src/withSentryIOS.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ export const withSentryIOS: ConfigPlugin<{ sentryProperties: string; useNativeIn
2828
xcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Upload Debug Symbols to Sentry', null, {
2929
shellPath: '/bin/sh',
3030
shellScript: `/bin/sh ${SENTRY_REACT_NATIVE_XCODE_DEBUG_FILES_PATH}`,
31-
inputPaths: [
32-
'"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Resources/DWARF/$(PRODUCT_NAME)"',
33-
'"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)"',
34-
],
3531
});
3632
}
3733

packages/core/scripts/expo-upload-sourcemaps.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
const { execSync } = require('child_process');
2+
const { spawnSync } = require('child_process');
33
const fs = require('fs');
44
const path = require('path');
55
const process = require('process');
@@ -16,8 +16,11 @@ function getEnvVar(varname) {
1616

1717
function getSentryPluginPropertiesFromExpoConfig() {
1818
try {
19-
const stdOutBuffer = execSync('npx expo config --json');
20-
const config = JSON.parse(stdOutBuffer.toString());
19+
const result = spawnSync('npx', ['expo', 'config', '--json'], { encoding: 'utf8' });
20+
if (result.error || result.status !== 0) {
21+
throw result.error || new Error(`expo config exited with status ${result.status}`);
22+
}
23+
const config = JSON.parse(result.stdout);
2124
const plugins = config.plugins;
2225
if (!plugins) {
2326
return null;
@@ -217,8 +220,15 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) {
217220
}
218221

219222
const isHermes = assets.find(asset => asset.endsWith('.hbc'));
220-
const windowsCallback = process.platform === 'win32' ? 'node ' : '';
221-
execSync(`${windowsCallback}${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')}`, {
223+
224+
// Build arguments array for spawnSync (no shell interpretation needed)
225+
const args = ['sourcemaps', 'upload'];
226+
if (isHermes) {
227+
args.push('--debug-id-reference');
228+
}
229+
args.push(...assets);
230+
231+
const result = spawnSync(sentryCliBin, args, {
222232
env: {
223233
...process.env,
224234
[SENTRY_PROJECT]: sentryProject,
@@ -227,6 +237,15 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) {
227237
},
228238
stdio: 'inherit',
229239
});
240+
241+
if (result.error) {
242+
console.error('Failed to upload sourcemaps:', result.error);
243+
process.exit(1);
244+
}
245+
if (result.status !== 0) {
246+
console.error(`sentry-cli exited with status ${result.status}`);
247+
process.exit(result.status);
248+
}
230249
numAssetsUploaded++;
231250
}
232251

packages/core/test/expo-plugin/modifyXcodeProject.test.ts

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -77,101 +77,3 @@ describe('Configures iOS native project correctly', () => {
7777
expect(warnOnce).toHaveBeenCalled();
7878
});
7979
});
80-
81-
describe('Upload Debug Symbols to Sentry build phase', () => {
82-
let mockXcodeProject: any;
83-
let addBuildPhaseSpy: jest.Mock;
84-
const expectedShellScript =
85-
"/bin/sh `${NODE_BINARY:-node} --print \"require('path').dirname(require.resolve('@sentry/react-native/package.json')) + '/scripts/sentry-xcode-debug-files.sh'\"`";
86-
87-
const getOptions = () => {
88-
const callArgs = addBuildPhaseSpy.mock.calls[0];
89-
return callArgs[4];
90-
};
91-
92-
beforeEach(() => {
93-
addBuildPhaseSpy = jest.fn();
94-
mockXcodeProject = {
95-
pbxItemByComment: jest.fn().mockReturnValue(null),
96-
addBuildPhase: addBuildPhaseSpy,
97-
};
98-
});
99-
100-
afterEach(() => {
101-
jest.clearAllMocks();
102-
});
103-
104-
it('creates Upload Debug Symbols build phase with correct shell script', () => {
105-
mockXcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Upload Debug Symbols to Sentry', null, {
106-
shellPath: '/bin/sh',
107-
shellScript: expectedShellScript,
108-
});
109-
110-
expect(addBuildPhaseSpy).toHaveBeenCalledWith(
111-
[],
112-
'PBXShellScriptBuildPhase',
113-
'Upload Debug Symbols to Sentry',
114-
null,
115-
{
116-
shellPath: '/bin/sh',
117-
shellScript: expectedShellScript,
118-
},
119-
);
120-
});
121-
122-
it('does not include inputPaths in options before fix', () => {
123-
mockXcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Upload Debug Symbols to Sentry', null, {
124-
shellPath: '/bin/sh',
125-
shellScript: expectedShellScript,
126-
});
127-
128-
const options = getOptions();
129-
130-
expect(options.inputPaths).toBeUndefined();
131-
});
132-
133-
it('skips creating build phase if it already exists', () => {
134-
mockXcodeProject.pbxItemByComment = jest.fn().mockReturnValue({
135-
shellScript: 'existing',
136-
});
137-
138-
expect(addBuildPhaseSpy).not.toHaveBeenCalled();
139-
});
140-
141-
it('includes inputPaths with escaped quotes to avoid pbxproj serialization issues', () => {
142-
mockXcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Upload Debug Symbols to Sentry', null, {
143-
shellPath: '/bin/sh',
144-
shellScript: expectedShellScript,
145-
inputPaths: [
146-
'"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Resources/DWARF/$(PRODUCT_NAME)"',
147-
'"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)"',
148-
],
149-
});
150-
151-
const options = getOptions();
152-
153-
expect(options.inputPaths).toBeDefined();
154-
expect(options.inputPaths).toHaveLength(2);
155-
});
156-
157-
it('inputPaths values are wrapped in escaped quotes', () => {
158-
mockXcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Upload Debug Symbols to Sentry', null, {
159-
shellPath: '/bin/sh',
160-
shellScript: expectedShellScript,
161-
inputPaths: [
162-
'"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Resources/DWARF/$(PRODUCT_NAME)"',
163-
'"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)"',
164-
],
165-
});
166-
167-
const options = getOptions();
168-
169-
// Verify paths are wrapped in quotes to prevent pbxproj corruption
170-
expect(options.inputPaths[0]).toMatch(/^".*"$/);
171-
expect(options.inputPaths[1]).toMatch(/^".*"$/);
172-
expect(options.inputPaths[0]).toBe(
173-
'"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Resources/DWARF/$(PRODUCT_NAME)"',
174-
);
175-
expect(options.inputPaths[1]).toBe('"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)"');
176-
});
177-
});

0 commit comments

Comments
 (0)