Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlinks gone in MacOS Electron.app #144

Open
shmulka opened this issue Jan 31, 2023 · 7 comments
Open

Symlinks gone in MacOS Electron.app #144

shmulka opened this issue Jan 31, 2023 · 7 comments

Comments

@shmulka
Copy link

shmulka commented Jan 31, 2023

Beginning with Electron 21, it seems that all symlinks are gone from Darwin Electron.app in the Castlabs releases.

This results in our code signing failing with bundle format unrecognized, when pointing to folders which used to include symlinks.

See below electron/electron compared to castlabs/electron framework directories (release 22.1.0)
node_modules/electron/dist/Electron.app/Contents/Frameworks

22_1_0

@khwaaj
Copy link
Collaborator

khwaaj commented Jan 31, 2023

Ah, this again. We have had an issue around this previously, but the problem isn't actually in the ECS package (if you download and extract the zip manually you should find the symlinks are actually there). That time it only happened for a few packages, and then started working again (without us changing anything), so the culprit was never properly identified.

The actual issues is, unfortunately, rather elusive. IIRC something in the combination of extract-zip/yauzl, which is used to extract the zip when installing Electron, causes a silent abortion for some zip files - leaving the installation incomplete. I also seem to remember successfully trying yauzl directly, using the same zip files outside of the installation context, which makes it even more strange.

Anyway, that was some context. I'll see if I can do some further investigation to maybe find some workaround, at least.

@shmulka
Copy link
Author

shmulka commented Feb 1, 2023

Thanks @khwaaj for all the context :> Manually copying over Electron.app from a downloaded zip could provide a temporary fix. I tested with version 21.4.0 and all symlinks are there. Would be great if you can further investigate, hopefully to find some solution.

@khwaaj
Copy link
Collaborator

khwaaj commented Feb 2, 2023

No real solution yet, but it gets weirder. If I go into node_modules/electron after installing I can remove the dist directory and manually run node install.js, to get a proper install with symlinks and all. This is the same script that npm runs, so there is something in that execution context that affects zip extraction... 🤔

Update: Even running npm run postinstall instead of install.js works fine, the only time it fails is during the project wide install.

@khwaaj
Copy link
Collaborator

khwaaj commented Feb 2, 2023

Using yarn instead of npm also works, so that may be a workaround if you don't mind changing.

@shmulka
Copy link
Author

shmulka commented Feb 5, 2023

Thanks @khwaaj, i'll stick to NPM and use the postinstall option.
It works and keeps the build process automated which is a definite improvement 🎉 .

@saenzramiro
Copy link

Is there an intention to fix this with npm?

@khwaaj
Copy link
Collaborator

khwaaj commented Mar 10, 2023

We have spent some time investigating this, but the reason npm fails on some archives is elusive. It may be related to the caching mechanism employed by npm, but there appears to be no way to disable it to verify that theory. The fact that the npm run postinstall and yarn workarounds are viable suggests something in the npm install/update process is at fault, so maybe reporting this as an issue to npm-project could be worthwhile.

The intention is absolutely to get this fixed somehow, but as there are workarounds available other things have been taking precedence for now.

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

No branches or pull requests

3 participants