-
Notifications
You must be signed in to change notification settings - Fork 105
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
[Atom] symlinks stripped from app.asar, leading to larger installer and size on disk #138
Comments
@lptr this is actually an issue with |
For context, the flag in Git's makefile that affects this behaviour is dugite-native/script/build-macos.sh Lines 10 to 16 in 2968933
And the details from the Makefile source for it are:
I'm trying to recall whether I had any issues with symlinks that I had to opt-in for that behaviour, but I can't recall. |
I'm curious about these details, as the // just total up the size on disk
$ du -sh app/node_modules/dugite/git
29M app/node_modules/dugite/git
// find all the files that look like binaries
$ find app/node_modules/dugite/git -type f | perl -lne 'print if -B'
app/node_modules/dugite/git/bin/git
app/node_modules/dugite/git/libexec/git-core/git-lfs
app/node_modules/dugite/git/libexec/git-core/git-http-push
app/node_modules/dugite/git/libexec/git-core/git-imap-send
app/node_modules/dugite/git/libexec/git-core/git-sh-i18n--envsubst
app/node_modules/dugite/git/libexec/git-core/git-credential-store
app/node_modules/dugite/git/libexec/git-core/git-credential-cache
app/node_modules/dugite/git/libexec/git-core/git-daemon
app/node_modules/dugite/git/libexec/git-core/git-credential-cache--daemon
app/node_modules/dugite/git/libexec/git-core/git-remote-http
app/node_modules/dugite/git/libexec/git-core/git-fast-import
app/node_modules/dugite/git/libexec/git-core/git-shell
app/node_modules/dugite/git/libexec/git-core/git-http-fetch
app/node_modules/dugite/git/libexec/git-core/git-http-backend
app/node_modules/dugite/git/libexec/git-core/git |
This is what I get with Atom (installed via $ du -hs `pwd`
302M /Applications/Atom.app/Contents/Resources/app.asar.unpacked/node_modules/dugite/git/libexec/git-core
$ find . -type f | perl -lne 'print if -B'
./git-mailsplit
./git-fetch
./git-lfs
./git-clean
./git-diff
./git-log
./git-http-push
./git-commit
./git-merge-index
./git-merge-recursive
./git-revert
./git-blame
# ... (many more) |
And |
cc @smashwilson for ideas on why this might be happening to Atom |
Digging into it some more, this is related to how Electron and it's ASAR support works. ASAR is a package support format intended to squash things like a complex $ cd /Applications/Atom.app/Contents/Resources
$ npx asar list app.asar | grep dugite
npx: installed 88 in 2.213s
/node_modules/dugite
/node_modules/dugite/build
/node_modules/dugite/build/lib
/node_modules/dugite/build/lib/errors.js
/node_modules/dugite/build/lib/git-environment.js
/node_modules/dugite/build/lib/git-process.js
/node_modules/dugite/build/lib/index.js
/node_modules/dugite/git
/node_modules/dugite/git/bin
/node_modules/dugite/git/bin/git
/node_modules/dugite/git/libexec
/node_modules/dugite/git/libexec/git-core
/node_modules/dugite/git/libexec/git-core/git
/node_modules/dugite/git/libexec/git-core/git-add
/node_modules/dugite/git/libexec/git-core/git-add--interactive
/node_modules/dugite/git/libexec/git-core/git-am
/node_modules/dugite/git/libexec/git-core/git-annotate
/node_modules/dugite/git/libexec/git-core/git-apply
/node_modules/dugite/git/libexec/git-core/git-archimport
/node_modules/dugite/git/libexec/git-core/git-archive
/node_modules/dugite/git/libexec/git-core/git-bisect
/node_modules/dugite/git/libexec/git-core/git-bisect--helper
/node_modules/dugite/git/libexec/git-core/git-blame
/node_modules/dugite/git/libexec/git-core/git-branch
/node_modules/dugite/git/libexec/git-core/git-bundle
/node_modules/dugite/git/libexec/git-core/git-cat-file
/node_modules/dugite/git/libexec/git-core/git-check-attr
/node_modules/dugite/git/libexec/git-core/git-check-ignore
/node_modules/dugite/git/libexec/git-core/git-check-mailmap
/node_modules/dugite/git/libexec/git-core/git-check-ref-format
/node_modules/dugite/git/libexec/git-core/git-checkout
/node_modules/dugite/git/libexec/git-core/git-checkout-index
/node_modules/dugite/git/libexec/git-core/git-cherry
... You enable ASAR support in For reference, GitHub Desktop doesn't have the same issue because we disabled ASAR and manage the embedded Git installation ourselves:
We tried ASAR ages ago and ended up just avoiding it (see desktop/desktop#476 and the linked PR for more info), and I see someone added support for being able to control the symlink behaviour (to opt-out of the default behaviour) in electron/packager#410. Ultimately, this is up to the packaging apps rather than something I have control over. I don't see a |
Thanks for looking into this. Should I report this to Atom, to Electron, or are you going to take further steps here? |
Please have a read of the bug reporting guidelines for |
So, has this been/should this be reported? From the exchange above, it's not 100% clear what the expected steps are here. This issue is the root cause of atom/atom#18452. |
Followup issue filed at atom/atom#18490. |
I only checked this on macOS. The package contains the exact same 2.2 MB binary more than 120 times over. This wastes 270 MB disk space.
Dugite alone is responsible for 500 MB of the Mac installation of Atom for example.
Is there a way to reduce this overhead?
The text was updated successfully, but these errors were encountered: