Skip to content

Commit cec7986

Browse files
authored
Merge branch 'main' into antonis/bump-tmp
2 parents 829b7a6 + 56bef5a commit cec7986

12 files changed

Lines changed: 176 additions & 100 deletions

.github/workflows/buildandtest.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,24 @@ jobs:
144144
- name: Build
145145
run: yarn build
146146
- name: Archive dist
147-
uses: actions/upload-artifact@v6
147+
uses: actions/upload-artifact@v7
148148
with:
149149
name: dist
150150
path: packages/core/dist
151151
- name: Archive ts3.8
152-
uses: actions/upload-artifact@v6
152+
uses: actions/upload-artifact@v7
153153
with:
154154
name: ts3.8
155155
path: packages/core/ts3.8
156156
- name: Archive Expo Plugin
157-
uses: actions/upload-artifact@v6
157+
uses: actions/upload-artifact@v7
158158
with:
159159
name: expo-plugin
160160
path: packages/core/plugin/build
161161
- name: Pack
162162
run: yarn build:tarball
163163
- name: Archive Artifacts
164-
uses: actions/upload-artifact@v6
164+
uses: actions/upload-artifact@v7
165165
with:
166166
name: ${{ github.sha }}
167167
path: |
@@ -186,12 +186,12 @@ jobs:
186186
- name: Install Dependencies
187187
run: yarn install
188188
- name: Download dist
189-
uses: actions/download-artifact@v7
189+
uses: actions/download-artifact@v8
190190
with:
191191
name: dist
192192
path: packages/core/dist
193193
- name: Download ts3.8
194-
uses: actions/download-artifact@v7
194+
uses: actions/download-artifact@v8
195195
with:
196196
name: ts3.8
197197
path: packages/core/ts3.8
@@ -217,12 +217,12 @@ jobs:
217217
- name: Install Dependencies
218218
run: yarn install
219219
- name: Download dist
220-
uses: actions/download-artifact@v7
220+
uses: actions/download-artifact@v8
221221
with:
222222
name: dist
223223
path: packages/core/dist
224224
- name: Download Expo Plugin
225-
uses: actions/download-artifact@v7
225+
uses: actions/download-artifact@v8
226226
with:
227227
name: expo-plugin
228228
path: packages/core/plugin/build

.github/workflows/cancel-pr-workflows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Cancel in-progress workflow runs
13-
uses: actions/github-script@v7
13+
uses: actions/github-script@v8
1414
with:
1515
script: |
1616
const { owner, repo } = context.repo;

.github/workflows/e2e-v2.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,15 @@ jobs:
299299

300300
- name: Upload App
301301
if: matrix.build-type == 'production'
302-
uses: actions/upload-artifact@v6
302+
uses: actions/upload-artifact@v7
303303
with:
304304
name: ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-app-package
305305
path: dev-packages/e2e-tests/RnDiffApp.ap*
306306
retention-days: 1
307307

308308
- name: Upload logs
309309
if: ${{ always() }}
310-
uses: actions/upload-artifact@v6
310+
uses: actions/upload-artifact@v7
311311
with:
312312
name: rn-build-logs-${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}
313313
path: dev-packages/e2e-tests/react-native-versions/${{ matrix.rn-version }}/RnDiffApp/ios/*.log
@@ -357,7 +357,7 @@ jobs:
357357

358358
- name: Download App Package
359359
if: matrix.build-type == 'production'
360-
uses: actions/download-artifact@v7
360+
uses: actions/download-artifact@v8
361361
with:
362362
name: ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-app-package
363363
path: dev-packages/e2e-tests
@@ -423,7 +423,7 @@ jobs:
423423
if: ${{ matrix.platform == 'ios' }}
424424
run: xcrun simctl list devices available
425425

426-
- uses: futureware-tech/simulator-action@dab10d813144ef59b48d401cd95da151222ef8cd # pin@v4
426+
- uses: futureware-tech/simulator-action@e89aa8f93d3aec35083ff49d2854d07f7186f7f5 # pin@v5
427427
if: ${{ matrix.platform == 'ios' }}
428428
with:
429429
model: ${{ env.IOS_DEVICE }}
@@ -438,7 +438,7 @@ jobs:
438438

439439
- name: Upload logs
440440
if: ${{ always() }}
441-
uses: actions/upload-artifact@v6
441+
uses: actions/upload-artifact@v7
442442
with:
443443
name: ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-logs
444444
path: |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
163163
- name: Upload logs
164164
if: ${{ always() }}
165-
uses: actions/upload-artifact@v6
165+
uses: actions/upload-artifact@v7
166166
with:
167167
name: build-sample-expo-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
168168
path: samples/expo/${{ matrix.platform }}/*.log

.github/workflows/sample-application.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,23 +184,23 @@ jobs:
184184
185185
- name: Upload iOS APP
186186
if: ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }}
187-
uses: actions/upload-artifact@v6
187+
uses: actions/upload-artifact@v7
188188
with:
189189
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-${{ matrix.platform }}
190190
path: ${{ env.IOS_APP_ARCHIVE_PATH }}
191191
retention-days: 1
192192

193193
- name: Upload Android APK
194194
if: ${{ matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }}
195-
uses: actions/upload-artifact@v6
195+
uses: actions/upload-artifact@v7
196196
with:
197197
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.platform }}
198198
path: ${{ env.ANDROID_APP_ARCHIVE_PATH }}
199199
retention-days: 1
200200

201201
- name: Upload logs
202202
if: ${{ always() }}
203-
uses: actions/upload-artifact@v6
203+
uses: actions/upload-artifact@v7
204204
with:
205205
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
206206
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/${{ matrix.platform }}/*.log
@@ -236,14 +236,14 @@ jobs:
236236

237237
- name: Download iOS App Archive
238238
if: ${{ matrix.platform == 'ios' }}
239-
uses: actions/download-artifact@v7
239+
uses: actions/download-artifact@v8
240240
with:
241241
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-${{ matrix.platform }}
242242
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
243243

244244
- name: Download Android APK
245245
if: ${{ matrix.platform == 'android' }}
246-
uses: actions/download-artifact@v7
246+
uses: actions/download-artifact@v8
247247
with:
248248
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.platform }}
249249
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
@@ -294,7 +294,7 @@ jobs:
294294
sudo udevadm trigger --name-match=kvm
295295
296296
- name: Boot ${{ env.IOS_DEVICE }} with iOS ${{ env.IOS_VERSION }}
297-
uses: futureware-tech/simulator-action@dab10d813144ef59b48d401cd95da151222ef8cd # pin@v4
297+
uses: futureware-tech/simulator-action@e89aa8f93d3aec35083ff49d2854d07f7186f7f5 # pin@v5
298298
if: ${{ matrix.platform == 'ios' }}
299299
with:
300300
model: ${{ env.IOS_DEVICE }}

.github/workflows/testflight.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
bundle exec fastlane ios upload_react_native_sample_to_testflight
7272
7373
- name: Upload Xcode Archive
74-
uses: actions/upload-artifact@v6
74+
uses: actions/upload-artifact@v7
7575
with:
7676
name: sentry-react-native-sample-xcode-archive-for-testflight
7777
path: samples/react-native/sentryreactnativesample.xcarchive

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
99
## Unreleased
1010

11+
### Fixes
12+
13+
- Resolve relative `SOURCEMAP_FILE` paths against the project root in the Xcode build script ([#5730](https://github.com/getsentry/sentry-react-native/pull/5730))
14+
1115
### Dependencies
1216

1317
- Bump JavaScript SDK from v10.39.0 to v10.40.0 ([#5715](https://github.com/getsentry/sentry-react-native/pull/5715))

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@
6060
],
6161
"resolutions": {
6262
"appium-chromedriver@npm:5.6.73/@xmldom/xmldom": "0.8.10",
63+
"express@npm:4.19.2/path-to-regexp": "0.1.12",
64+
"axios": "^1.13.5",
6365
"fast-xml-parser": "^5.3.6",
64-
"form-data": "4.0.4",
66+
"form-data": "4.0.5",
6567
"qs": "^6.14.2",
6668
"lodash": "^4.17.23",
6769
"tar-fs": "^3.1.1",
70+
"on-headers": "^1.1.0",
6871
"diff": "^5.2.2",
6972
"tar": "^7.5.7"
7073
"tmp": "^0.2.4"

packages/core/scripts/sentry-xcode.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ RN_PROJECT_ROOT="${PROJECT_DIR}/.."
1515
[ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
1616
[ -z "$SENTRY_DOTENV_PATH" ] && [ -f "$RN_PROJECT_ROOT/.env.sentry-build-plugin" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"
1717
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"
18+
# Resolve relative SOURCEMAP_FILE to absolute. The script runs from `ios/` (Xcode's PWD),
19+
# but users typically specify paths relative to the project root. Without this, sentry-cli
20+
# would resolve relative paths against `ios/` and fail to find the file.
21+
# See: https://github.com/getsentry/sentry-react-native/issues/3889
22+
if [[ "$SOURCEMAP_FILE" != /* ]]; then
23+
export SOURCEMAP_FILE="$(cd "$RN_PROJECT_ROOT" && pwd)/${SOURCEMAP_FILE#./}"
24+
fi
1825

1926
if [ -z "$SENTRY_CLI_EXECUTABLE" ]; then
2027
# Try standard resolution safely

packages/core/test/scripts/sentry-xcode-scripts.test.ts

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,81 @@ describe('sentry-xcode.sh', () => {
454454
expect(result.stdout).toContain('SENTRY_DISABLE_AUTO_UPLOAD=true');
455455
expect(result.stdout).toContain('skipping sourcemaps upload');
456456
});
457+
458+
describe('SOURCEMAP_FILE path resolution', () => {
459+
// Returns a mock sentry-cli that prints the SOURCEMAP_FILE env var it received.
460+
const makeSourcemapEchoScript = (dir: string): string => {
461+
const scriptPath = path.join(dir, 'mock-sentry-cli-echo-sourcemap.js');
462+
fs.writeFileSync(
463+
scriptPath,
464+
`
465+
const sourcemapFile = process.env.SOURCEMAP_FILE || 'not-set';
466+
console.log('SOURCEMAP_FILE=' + sourcemapFile);
467+
process.exit(0);
468+
`,
469+
);
470+
return scriptPath;
471+
};
472+
473+
it('leaves an absolute SOURCEMAP_FILE unchanged', () => {
474+
const absolutePath = path.join(tempDir, 'absolute', 'main.jsbundle.map');
475+
const echoScript = makeSourcemapEchoScript(tempDir);
476+
477+
const result = runScript({
478+
SENTRY_CLI_EXECUTABLE: echoScript,
479+
SOURCEMAP_FILE: absolutePath,
480+
});
481+
482+
expect(result.exitCode).toBe(0);
483+
expect(result.stdout).toContain(`SOURCEMAP_FILE=${absolutePath}`);
484+
});
485+
486+
it('resolves a relative SOURCEMAP_FILE against the project root, not ios/', () => {
487+
// PROJECT_DIR is tempDir (simulates the ios/ folder).
488+
// RN_PROJECT_ROOT = PROJECT_DIR/.. = parent of tempDir.
489+
// A user setting SOURCEMAP_FILE=relative/path.map expects it relative to the project root.
490+
const echoScript = makeSourcemapEchoScript(tempDir);
491+
492+
const result = runScript({
493+
SENTRY_CLI_EXECUTABLE: echoScript,
494+
SOURCEMAP_FILE: 'relative/path.map',
495+
});
496+
497+
const projectRoot = path.dirname(tempDir); // PROJECT_DIR/.. = RN_PROJECT_ROOT
498+
const expectedPath = path.join(projectRoot, 'relative/path.map');
499+
500+
expect(result.exitCode).toBe(0);
501+
expect(result.stdout).toContain(`SOURCEMAP_FILE=${expectedPath}`);
502+
});
503+
504+
it('resolves a ./prefixed SOURCEMAP_FILE against the project root', () => {
505+
const echoScript = makeSourcemapEchoScript(tempDir);
506+
507+
const result = runScript({
508+
SENTRY_CLI_EXECUTABLE: echoScript,
509+
SOURCEMAP_FILE: './maps/main.jsbundle.map',
510+
});
511+
512+
// The leading ./ is stripped via ${SOURCEMAP_FILE#./} before concatenation,
513+
// so the result is a clean absolute path without any ./ component.
514+
const projectRoot = path.dirname(tempDir);
515+
const expectedPath = path.join(projectRoot, 'maps/main.jsbundle.map');
516+
517+
expect(result.exitCode).toBe(0);
518+
expect(result.stdout).toContain(`SOURCEMAP_FILE=${expectedPath}`);
519+
});
520+
521+
it('uses the absolute default SOURCEMAP_FILE when not set by the user', () => {
522+
const echoScript = makeSourcemapEchoScript(tempDir);
523+
524+
const result = runScript({
525+
SENTRY_CLI_EXECUTABLE: echoScript,
526+
// SOURCEMAP_FILE intentionally not set — script should default to $DERIVED_FILE_DIR/main.jsbundle.map
527+
DERIVED_FILE_DIR: tempDir,
528+
});
529+
530+
expect(result.exitCode).toBe(0);
531+
expect(result.stdout).toContain(`SOURCEMAP_FILE=${tempDir}/main.jsbundle.map`);
532+
});
533+
});
457534
});

0 commit comments

Comments
 (0)