-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
electron builder v26.0.0-alpha.2 fails to copy native deps with sym links #8655
electron builder v26.0.0-alpha.2 fails to copy native deps with sym links #8655
Comments
Any chance you'd be willing to provide a minimum repro repo for this? I can definitely look into the |
The native dependency in question is private company library. I tried hard to find a similar public dependency, but couldn't... I can look more, but also I am happy to provide more logs (sanitized), test implementations, etc. Edit: Not that there is much more in the logs other than what I shared above, only the call stack of the failure. |
I think I can just create one via https://jano.dev/apple/mach-o/2024/06/28/Hello-Static-Framework.html Can you share your electron-builder config? |
I think we might be able to reproduce the issue by putting a framework file in a node module. If that doesn't work, it might be related to QtCore.framework file structure, which is open source. @ivanggq Could you provide it to us for testing? |
Hi, I actually managed to create a minimal repo reproducing the issue: sym-link-demo.zip
The project contains a stripped down native dep with a stripped down Qt framework that reproduces the issue. To repro:
Thanks for being so responsive. |
@ivanggq just released a patch version that resolves the bundling issue you were receiving when I tested locally. Since it was a slimmed down app you provided though, can you please try |
Hi @mmaietta , I tested our internal project with The error (sanitized):
I inspected the folder in question and this is what I see: As you can see some folders are missing compared to a previous version we used. And after I wrote this, I tested with |
Thank you for the detailed report! I'll take a look at this asap |
Hmmm, I'm unable to reproduce with the
I'll keep hammering at at investigating as well |
Right, I also did not repro the issue with the demo project but then I noticed that there is no app.asar.unpacked produced. |
It appears to be an issue with electron/asar, where symlink files are placed directly into app.asar without following the asarUnpack rules. https://github.com/electron/asar/blob/4df48cd53e68299db9ebf8f3bf002cc1fc5111f7/src/asar.ts#L144-L166 |
If this is the case, what would be the path forward? Maybe revert the migration to electron/asar for now, or try to fix it? |
The path forward will definitely not be a revert. @beyondkmp, how is it a bug in electron/asar code? We'll need to fix it if so |
Hmmmm, running
|
@ivanggq can you please try out this
|
@mmaietta , this patch fixes the issue for our project. It builds and signs successfully. I compared the produced asar.unpacked and other output files - the produced folders/files are the same as the older electron-builder version v23.6.0 that we use currently. So the fix seems good to me. Good job. |
… previously unpacked directories. This directly fixes unpacking static `.framework` modules on Mac, as otherwise codesigning will fail due to symlink files/directories not being reflected in the app.asar.unpacked directory. Added unit test with Hello.framework, generated from tutorial https://jano.dev/apple/mach-o/2024/06/28/Hello-Static-Framework.html Fixes: electron-userland/electron-builder#8655
@mmaietta We should check if the link is an absolute path.
|
AFAICT links within asars can't be absolute paths, otherwise it'll fail during extraction. |
Version 26.0.0-alpha.2 introduces an issue when copying native deps that contain sym links, e.g.
(Apologies for not sharing the full paths, hiding private names.)
I tracked down the issue to https://github.com/electron-userland/electron-builder/pull/8570/files, specifically I think the change in
copyFileOrData
, and the replacement offileCopier.copy
withfs.copyFile
.As you can see from the log, the issue is when copying sym links (like we find in Mac frameworks).
The text was updated successfully, but these errors were encountered: