fix(studio): copy substrate symlinks verbatim so .app bundles survive install - #504
Merged
KnockOutEZ merged 1 commit intoAug 27, 2026
Conversation
… install cpSync without verbatimSymlinks resolves every symlink it copies and writes an absolute link back into the install source. A desktop substrate is an application bundle whose frameworks are built on relative links (Resources -> Versions/Current/Resources, Current -> A), so the default copy installed a bundle that crashed at launch, executed bytes from outside the substrate root the record's containment rule covers, and dangled entirely once the install source was deleted. The acquire-time verify could not catch it: the top-level executable is a real file, so the probe passed while the framework links underneath pointed elsewhere. Pinned by a framework-shaped fixture whose executable is reachable only through two relative symlinks, with the source-deleted arm as the anti-vacuity check an absolute-link copy cannot pass.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes wigolo-studio-run#170.
What was wrong
cpSync(dir, destDir, { recursive: true })inlocalPathSource().installcopies symlinks withoutverbatimSymlinks, so Node resolves each one and writes an absolute link back into the install SOURCE. A desktop substrate is a macOS application bundle, and its frameworks are built entirely on relative links (Resources -> Versions/Current/Resources,Current -> A). The installed copy therefore:The acquire-time VERIFY cannot catch it: the top-level executable is a real file, so the probe passes while every framework link underneath points elsewhere.
Fix
One flag —
verbatimSymlinks: true— plus the comment explaining why it is the whole copy rather than a tuning knob.Pin
A framework-shaped fixture (
Versions/A/…+Current -> A+Resources -> Versions/Current/Resources) whose manifest executable is reachable only through the relative chain. Two arms:readlinkSync), and address nothing outside the install directory;Windows is skipped: creating a symlink there needs elevation, and this corruption class is a POSIX-symlinked bundle shape.
Verification
Forced-condition proof, not N clean runs. On tip (before the flag), the two new arms fail with exactly the predicted defect:
With the fix:
Test Files 1 passed (1) · Tests 28 passed (28).Real packaged
.appdifferential, same script run against pre-fix and post-fixdist/, acquiring a genuine Electron bundle throughWIGOLO_SUBSTRATE_PATHand launching the installed copy with the source deleted:gate:studiogreen; full unit suite green.