Most active commenters
  • enriquto(5)
  • sirwhinesalot(3)
  • fc417fc802(3)

←back to thread

306 points dxs | 17 comments | | HN request time: 0.405s | source | bottom
1. enriquto ◴[] No.44070852[source]
Never understood the point of flatpak, snap and the like. Can't you just distribute static binaries? They are not that hard to compile.

(I mean, from the distributing point of view. The sandboxing and resource management is a OS-thing that should be an orthogonal issue. Users must be able to sandbox programs that they don't trust, regardless to how they are packaged and distributed.)

replies(4): >>44070906 #>>44070908 #>>44070918 #>>44071467 #
2. dale_glass ◴[] No.44070906[source]
They're not at all trivial on anything big and complex.

And the code I work on has loadable plugins, too.

3. brnt ◴[] No.44070908[source]
I did not find packaging up an AppImage that is actually compatible across distro's and version all that straightforward, and we were not even using Qt or GTK/libadwaita. How is this easy, in your experience?
replies(1): >>44070933 #
4. arbll ◴[] No.44070918[source]
Any complex software is going to be a collection of files, not a single static binary.
5. enriquto ◴[] No.44070933[source]
> How is this easy, in your experience?

add -static to your link flags? Sometimes you need to fiddle a bit with the order of the libraries, but that's it.

In the ideal case, for maximum portability, i'd like to use the αpε format!

replies(1): >>44071267 #
6. sirwhinesalot ◴[] No.44071267{3}[source]
Have you actually tried to make a fully statically linked GUI app on Linux?
replies(1): >>44072403 #
7. nolist_policy ◴[] No.44071467[source]
> Can't you just distribute static binaries? They are not that hard to compile.

You absolutely can't, since you need to link to the system libGL.so and friends for gpu acceleration, libva.so for video acceleration, and so on.

replies(1): >>44072535 #
8. enriquto ◴[] No.44072403{4}[source]
Just did it!

I had to add "-static" to LDFLAGS and "-lxcb -lXau -lXdmcp" to LDLIBS, for an increase in binary size from 1MB to 3MB. It's a plain X program, i guess if you use fancy toolkits it may be harder.

replies(2): >>44072892 #>>44113186 #
9. fc417fc802 ◴[] No.44072535[source]
To be fair isn't flatpak encapsulating the user space portion of mesa, similar to any other chroot? In which case the apples-to-apples comparison would be shipping your own mesa alongside your app.

Which now has me wondering, is the common wisdom wrong? Could I actually statically link opengl if I went to enough trouble?

replies(1): >>44074198 #
10. brnt ◴[] No.44072892{5}[source]
If anything more than plain X is fancy to you...
11. akvadrako ◴[] No.44074198{3}[source]
You need the exact right version that matches your actual graphics driver. So flatpak takes care of installing the matching drivers inside the sandbox.
replies(2): >>44074277 #>>44076011 #
12. enriquto ◴[] No.44074277{4}[source]
this is horrifying, and contrary to the very notion of what a "driver" should be
replies(1): >>44076114 #
13. fc417fc802 ◴[] No.44076011{4}[source]
Do you? I've often seen this repeated but at some point I tried a cutting edge chroot on an extremely (ie multiple years) out of date device and opengl seemed to work. It surprised me but then I don't know much about how mesa works under the hood.
14. fc417fc802 ◴[] No.44076114{5}[source]
To be fair the graphics APIs are provided as libraries with as much as possible done in userspace. Sandboxing that without any coupling at all would likely require either new kernel APIs or highly questionable virtual memory shenanigans.
15. sirwhinesalot ◴[] No.44113186{5}[source]
Try getting 3D rendering now. Your statically linked libc will fail to load the GPU driver and your app won't work :)
replies(1): >>44134432 #
16. enriquto ◴[] No.44134432{6}[source]
True. And that's why linus showing the finger to nvidia was an exhilarating relief to so many people. The gpu driver shenanigans are horrific to contour, but they are completely unnecessary on technical grounds. All the difficulties are purposefully introduced by the graphics card hardware companies. I'd say "fuck it" and do the rendering in the cpu only, which is almost always possible.
replies(1): >>44158931 #
17. sirwhinesalot ◴[] No.44158931{7}[source]
I agree, but hopefully it's clear that there's a major problem all these crazy solutions are trying to work around.