Skip to content
This repository was archived by the owner on Apr 7, 2023. It is now read-only.

Make OS X package 2x smaller #12

Merged
merged 1 commit into from
Mar 23, 2016
Merged

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented Mar 23, 2016

I found that OS X package had lost its symbolic links.

So I added --symlinks option to zip command. It preserves symbolic link in an archive.

  • Before

2016-03-23 14 48 48

- After

2016-03-23 14 52 07

Now darwin package gets 2x smaller 😄

@rhysd
Copy link
Contributor Author

rhysd commented Mar 23, 2016

Currently, size of Nocturn.app being archived in zip is 380 MB+. But after this PR merged, it will be reduced to 160MB.

@rhysd
Copy link
Contributor Author

rhysd commented Mar 23, 2016

One more thing.

I noticed that packages include devDependencies npm packages. I think we should run npm prune --production before packaging Nocturn. It'll save 20+MB.

@k0kubun
Copy link
Owner

k0kubun commented Mar 23, 2016

🆒 I was totally unaware of this.

So we have many duplicated symlinks only in darwin package directory.

$ find . -type l
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Electron Framework.framework/Electron Framework
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Electron Framework.framework/Libraries
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Electron Framework.framework/Resources
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Electron Framework.framework/Versions/Current
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Mantle.framework/Headers
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Mantle.framework/Mantle
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Mantle.framework/Modules
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Mantle.framework/Resources
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Mantle.framework/Versions/Current
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/ReactiveCocoa.framework/Headers
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/ReactiveCocoa.framework/Modules
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/ReactiveCocoa.framework/ReactiveCocoa
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/ReactiveCocoa.framework/Resources
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Squirrel.framework/Headers
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Squirrel.framework/Modules
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Squirrel.framework/Resources
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Squirrel.framework/Squirrel
./Nocturn-darwin-x64/Nocturn.app/Contents/Frameworks/Squirrel.framework/Versions/Current

I confirmed that current Nocturn.app has many duplicated binaries. It's terrible...
Since all targets are in package, we can safely preserve symlinks.

$ find . -type l | xargs readlink
Versions/Current/Headers
Versions/Current/Mantle
Versions/Current/Modules
Versions/Current/Resources
A
Versions/Current/Headers
Versions/Current/Modules
Versions/Current/ReactiveCocoa
Versions/Current/Resources
A
Versions/Current/Headers
Versions/Current/Modules
Versions/Current/Resources
Versions/Current/Squirrel
A

Looks great to me! Merging.

I noticed that packages include devDependencies npm packages. I think we should run npm prune --production before packaging Nocturn. It'll save 20+MB.

I'll try this too. Thank you for the information.

@k0kubun k0kubun merged commit fd28a2e into k0kubun:master Mar 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants