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

Make smaller Electron apps on OS X and iOS #63

Closed
kylemcdonald opened this issue Oct 18, 2015 · 9 comments
Closed

Make smaller Electron apps on OS X and iOS #63

kylemcdonald opened this issue Oct 18, 2015 · 9 comments

Comments

@kylemcdonald
Copy link
Contributor

The "Electron Framework" is duplicated 3x for some reason. We can replace two of these with symlinks like this:

cd projectGenerator.app/Contents/Frameworks/Electron\ Framework.framework
rm Electron\ Framework
rm -rf Versions/Current/
ln -s Versions/A Current/A
ln -s Versions/Current/Electron\ Framework Electron\ Framework

Here is the Project Generator before:

screen shot 2015-10-18 at 10 58 26

And after:

screen shot 2015-10-18 at 11 14 00

screen shot 2015-10-18 at 10 58 48

This makes the .zip for OS X go from 224MB to 172MB.

@ofZach
Copy link
Contributor

ofZach commented Oct 18, 2015

this sounds reasonable. does the same thing happen when you run

npm run build:osx

on osx? I've been curious if there are differences between the platforms with regards to symlinks.

If this is an issue with electron binary downloads (which our project is based off of) can you post an issue upstream at electron:

https://github.com/atom/electron

for example, I saw this as part of their build process but didn't track exactly what it's doing:

https://github.com/atom/electron/blob/master/tools/mac/create-framework-subdir-symlinks.sh

if it's not a problem with electron, it might be an issue with electron packager?

https://github.com/maxogden/electron-packager

(for example, the osx 10.8 problem was an upstream issue with unzipping empty folders, it's useful to track down which module is causing the problem, sometimes we can work our way around it.)

@ofZach
Copy link
Contributor

ofZach commented Oct 18, 2015

this looks like a product of being packaged on linux, here's the framework on an osx dist vs what's made via the nightlies.

screen shot 2015-10-18 at 5 44 59 pm

@arturoc
Copy link
Member

arturoc commented Oct 21, 2015

i'm just checking this and the problem is not in the linux server which is generating the package correctly with those folders as soft links but in the zip file. zip doesn't support soft links, file permissions... that's why the linux downloads use tar.gz. When compressing the generated folder with zip it converts those links into real folders.

should we switch to tar.gz? i guess in osx it shouldn't be a problem no?

@ofZach
Copy link
Contributor

ofZach commented Oct 21, 2015

ah that makes sense. Tar.gz should be fine ! Also, it looks like there might be a flag for symlinks?

http://serverfault.com/questions/265675/how-can-i-zip-compress-a-symlink

@arturoc
Copy link
Member

arturoc commented Oct 21, 2015

oh, ok i've added the symlinks flag and am regenerating the nightlies now, if that doesn't work i'll change it to tar.gz

@arturoc
Copy link
Member

arturoc commented Oct 21, 2015

i think it's fixed now:

http://ci.openframeworks.cc/versions/nightly/

it's slightly bigger than 97Mb but that could be related to the newer version of nodejs, the fodlers are now symlinks

if you want to double check just in case i'm missing something?

@ofZach
Copy link
Contributor

ofZach commented Oct 21, 2015

looks good! I'm going to look at the icons now but the package seems pretty good to me

@arturoc
Copy link
Member

arturoc commented Oct 21, 2015

ok i'm going to close this then

@arturoc arturoc closed this as completed Oct 21, 2015
@kylemcdonald
Copy link
Contributor Author

great detective work, thanks!

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