Skip to content

fix(scripts): each core download uses its own temp directory - #33

Merged
robingenz merged 1 commit into
mainfrom
fix/core-download-temp-directory
Nov 2, 2026
Merged

robingenz merged 1 commit into
mainfrom
fix/core-download-temp-directory

Conversation

@robingenz

Copy link
Copy Markdown
Member

The core download scripts wrote the archive to one shared file, $TMPDIR/<core>-<checksum>.zip, so two packages installing at the same time removed each other's archive (ENOENT on rmSync). Each run now writes into its own directory from mkdtempSync under os.tmpdir(), unpacks from there, and removes the directory in a finally. The checksum is gone from the archive's file name, since the directory is already unique. The rest of the script stays as it was.

Checks

  • node scripts/download-core-android.mjs and node scripts/download-core-ios.mjs, run at the same time as the other bridges' download scripts on a fresh checkout: all exit 0, the core unpacked, no new entries left in $TMPDIR
  • npm run lint: exit 0 (ESLint, Prettier, SwiftLint)

🤖 Generated with Claude Code

The download scripts wrote the archive to one shared file in the system temp directory, so two packages that installed at the same time removed each other's archive. Each run now writes into its own directory from mkdtemp and removes it when the unpack is done or fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 11:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the changes isolating native core downloads in per-run temporary directories.

No open issues 🎉

What changed in this PR

This PR prevents concurrent package installations from interfering with each other’s native core downloads by giving each script run its own temporary directory.

Changes:

  • Create unique temporary directories with mkdtempSync for both core archives.
  • Remove temporary directories in finally, including when writing or extraction fails.
  • Simplify archive filenames while preserving checksum validation and extraction destinations.
File Description
scripts/​download-core-ios.mjs Isolates the iOS core archive per run and ensures temporary-directory cleanup.
scripts/​download-core-android.mjs Isolates the Android core archive per run and ensures temporary-directory cleanup.

Review effort: Balanced

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/hotcodepush-team/react-native-code-push/@hotcodepush/react-native-code-push@9d3b997

commit: 9d3b997

@robingenz
robingenz merged commit fc5b356 into main Nov 2, 2026
15 checks passed
@robingenz
robingenz deleted the fix/core-download-temp-directory branch November 2, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants