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

Further minimization #5

Closed
probonopd opened this issue Jan 19, 2020 · 16 comments
Closed

Further minimization #5

probonopd opened this issue Jan 19, 2020 · 16 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@probonopd
Copy link

probonopd commented Jan 19, 2020

What is the theory of operation for the current minimization strategy?

By examining, at runtime, which files are actually needed, it may be possible to bring down the AppImage size even further, by bundling a narrower subset of Wine and its dependencies (only those that are actually needed by the particular app).

Here is a comparison:

Using the minimization technique outlined in https://github.com/probonopd/libhookexecv#minimizing I was able to reduce the size by more than three quarters!

@sudo-give-me-coffee
Copy link
Owner

It's amazing, please, can you send me the minimized version? I didn't understand which step should I take to perform these steps

@sudo-give-me-coffee
Copy link
Owner

I was able to reduce the size to 158 MB following the same logic and "reverse engineering" the NotepadPlusPlus-3.5-x86_64.AppImage without affect resulting AppImage. It's very impressive, but 100 MB is floating under AppImage if compared with your

@mmtrt
Copy link

mmtrt commented Jan 19, 2020

Why not make the wine appimage act as runtime and create split windows software appimages containing application + script launchers without wine so it leverages the actual wine runtime appimage to run and this make appimage size as actual application size.

Sample appimage I did way back uses same technique https://github.com/mmtrt/foobar2000_AppImage

Just my opinion.

@probonopd
Copy link
Author

probonopd commented Jan 19, 2020

The steps:

mkdir squashfs-root
sudo mount -t tmpfs tmpfs squashfs-root/ -o strictatime,nodiratime 
./Picasa_3-x86_64.AppImage --appimage-extract 

touch test

./squashfs-root/AppRun

find squashfs-root/ -mindepth 3 -anewer test -not -path '*/share/icons/*' -not -path '*/share/applications/*' -not -path '*/share/metainfo/*' 
find squashfs-root/ -mindepth 3 -not -anewer test -not -path '*/share/icons/*' -not -path '*/share/applications/*' -not -path '*/share/metainfo/*' -delete || true
find squashfs-root/ -type d -empty -delete
./squashfs-root/AppRun  # Does it still run?

# Make minimized AppImage
ARCH=x86_64 ./appimagetool-x86_64.AppImage ./squashfs-root/

Example: https://github.com/probonopd/libhookexecv/releases/download/continuous/Picasa_3-minimized-x86_64.AppImage

@probonopd
Copy link
Author

probonopd commented Jan 19, 2020

Why not make the wine appimage act as runtime and create split windows software appimages containing application + script launchers without wine so it leverages the actual wine runtime appimage to run and this make appimage size as actual application size.

An AppImage must contain everything to run the application. Otherwise it is not an AppImage. The whole idea of AppImage is "one app = one file". This makes AppImages so simple to use.

Also, my method of minimizing the AppImage means that the AppImage just contains enough of Wine to run this Windows application, but not others.

@sudo-give-me-coffee
Copy link
Owner

Very cool, now I see where my error is, I will implement this as an option, thank you very much @probonopd

@sudo-give-me-coffee sudo-give-me-coffee added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 20, 2020
@sudo-give-me-coffee
Copy link
Owner

sudo-give-me-coffee commented Jan 20, 2020

Why not make the wine appimage act as runtime and create split windows software appimages containing application + script launchers without wine so it leverages the actual wine runtime appimage to run and this make appimage size as actual application size.

Sample appimage I did way back uses same technique https://github.com/mmtrt/foobar2000_AppImage

Just my opinion.

The first reason, is the @probonopd reply

The second reason is that, on Windows, the program is distributed with all the content. In linux, in my opinion, this should be better, all application dependencies must be contained in a single file to avoid installations

@mmtrt, thanks for your idea, but it has a some issues, for e.g. if user uses a ostree managed system?

@mmtrt
Copy link

mmtrt commented Jan 21, 2020

@probonopd @sudo-give-me-coffee Sure my method is flawed and has some issues like segfaults when calling some scripts from other appimage and it breaks AppImage philosophy as single app file and could create issues with ostree system in long run but yet it has more stability as compare to minimized version of Appimage which tends to break due to missing files removed by using that method.

Back to testing this appimage:

I did some testing on packaging bottles they seems to work fine good job on making this possible but during test one app failed to launched after being packed as AppImage which was notepad-plus-plus where its own dll signature protection failed to launch due to that but this worked fine on launching it from bottle after installed.

@sudo-give-me-coffee
Copy link
Owner

@mmtrt Can you please open a separate "Issue" for this? I found the source of the bug, but I need a separate "issue" to reference with the fix

@sudo-give-me-coffee
Copy link
Owner

@probonopd This method is clearing plugins and additional data, licenses, change logs and all other "secondary" resources

@probonopd
Copy link
Author

Yes. Maybe it is necessary to exclude some locations from being deleted.

sudo-give-me-coffee added a commit that referenced this issue Mar 8, 2020
* Added 'minimize' command #5
* Added support for applications that verify the signature of the DLL #7
* More transparent way for handling PREFIX
* Less CPU usage by packaged applications
* More fast initialization of packaged applications
* Commands now show how many steps it takes to complete the task
* Splits some commands
@sudo-give-me-coffee
Copy link
Owner

@probonopd Added "minimize" option

@sudo-give-me-coffee
Copy link
Owner

@mmtrt added option to bundle system.reg file

@sudo-give-me-coffee
Copy link
Owner

Many thanks, i think that i can close now, if not please reopen it

@probonopd
Copy link
Author

@probonopd Added "minimize" option

How does it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants