-
Notifications
You must be signed in to change notification settings - Fork 178
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
linux builds are not fully static #696
Comments
Looks like the file is there, so the question is why isn't it used or does something else pull in also the dynamic version: |
fixes the thing that prompted #696
I don't understand something about linking apparently. With our static linking enabled, gemrb_core gets linked statically and ldd doesn't show it any more. Good. Of course it shows all the external deps still, since static linking requires that, eg.:
This leaves us with 70 entries, from Xorg stuff to various codecs and other crap we don't need. Do we need to install tens and tens of dev packages, just to get more .a files in the VM? Sounds extreme, but the fact remains that something else is pulling in libpng16. |
Isn't the correct setting of setting missing at all? I did two quick things that surprised me. 1.) I did a fresh 2.) I put
|
Point 1 is what I was talking about when mentioning ldd output. I only expect to see the glibc stuff, per the warning you quote. The whole reason we want static builds is for them to be as standalone as possible. Isn't adding -static something cmake does for us? But good thought, we tell it to do it for the plugins and core, while we perhaps need to be explicit for the binary? Though I don't see anything in the add_executable docs. (and -Wl,--as-needed only works for dynamic linking) |
Just to get the overall idea:
Given that, we maybe have some error in the settings propagation, i. e. the executable should not list any specific dependency at all, not even shared objects on non-static builds? Because this is what I guess is subject to the individual plugins. |
1&2. If you mean our plugins, then no. We load them at runtime, so in this sense, only gemrb_core is there or missing depending on whether the build is dynamic or static. Time to play around, thanks. |
That was fast, just omitting plugins and moving -ldl is enough. :) |
Too fast, didn't clean the build dir properly. |
Found a thread with the gist of things: Couldn't test it fully, since adding Mistake from above: in the static build all plugins are linked statically, so dynamic loading never comes into play, d-oh. |
Have you had a look at AppImage? I've been given a recommendation to that for scenarios like these. I never tried it myself, but it somehow sounds like an option here. |
That, flatpacks and similar always seemed like an overkill. But it would be interesting to see how big the produced files are. |
I gave it very short try: $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
$ make -j4
$ make install DESTDIR=./AppDir
$ LD_LIBRARY_PATH=./AppDir/usr/lib/gemrb linuxdeploy-x86_64.AppImage --appdir=./AppDir --output=appimage Gives me about 8MB AppImage file. Contains about 40 shared lib copies, including Wayland, X, PulseAudio and stuff. It then complains it will not find plugins in Edit: Yes, such paths must be relative to the binary file location inside of the AppDir. |
40 is still better than 70, so not bad at all. Current builds are 7.4M, so that's fine too. Still, it'd be nice to fix the static build as well. It looks like opensuse doesn't provide a static openal either. Should just try building it manually; who knows how many packages more would be required. Also here's how ja2s integrated it with cmake & ci: ja2-stracciatella/ja2-stracciatella#1215 |
Ok, now this works fine. I'll migrate it to github first, try appimagelint again and then we can lay it to rest. Unfortunately everyone is sunsetting xenial, so we could only get it in for a few months. |
It's less than 2M of overhead, we never have to worry about libpng again, but unfortunately we can't use automated tests. As soon as the video driver tries starting up, gh just craps out. Maybe a thing to retry once actions/runner#241 is fixed. |
A user reported this for the 0.8.6 binary:
Maybe the .a file isn't present when building. Either way, it shouldn't happen.
The text was updated successfully, but these errors were encountered: