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
fix(linux): native modules overwritten with wrong arch #8107
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 702a291 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for car-park-attendant-cleat-11576 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I'm wary of this change as I'm assuming the owner/author of this project had a reason for not having hard links always disabled. |
It's faster to use hardlinks instead of copying. But this change affects only *.node files inside app.asar.unpacked, so it can't impact performance too much. Anyway, it would be nice to ask @develar whether there are some pitfalls or hadrlinks are used only for speed reasons. Sure, I use this env as a workaround. But it took pretty much time for me to find the reason of this issue, so it would be nice to include this fix by default. |
Maybe it makes sense to disable hardlinking on the Linux build only since there is no such issue on macOS build? |
I really need @develar to chime in before moving forward with this PR. I do understand the need to resolve this issue, but I don't have the historical context to understand the reasoning for it to be disabled by default. |
Fixes: #7608
Description
When building an app for multiple Linux architectures, native modules are hardlinked to the modules in
appDir/node_modules/**/*.node
ifCI
env is set.When the builder processes the first arch, it works fine. The second arch overwrites
appDir/node_modules/**/*.node
. Since these files are hardlinked tolinux-*unpacked/resources/app.asar.unpacked/node_modules/**/*.node
it overwrites native modules for all archs, so now the first arch distributive is broken.FileCopier
inbuilder-util/out/fs
copies files by default, but once it detects a CI environment, it switches to hadlinking mode instead.Example package.json which reproduces the issue