Response to “Developers are lazy, thus Flatpak”
theevilskeleton.gitlab.io
theevilskeleton.gitlab.io
That's a lot. Complete operating systems with similar amount of applications installed can take a fraction of that. That's larger than / partition on my PC used to be not that long ago (until I stopped splitting /home out altogether).
My phone has a 32 GB eMMC. I have just a handful of small Flatpak apps installed on it and Flatpak already takes more disk space than the whole fresh OS did there. The thing is that it mostly scales not with number of apps, but with number of runtimes installed - and you only need a single app to still be on an outdated runtime to make it keep excessive space.
On my primary work macbook (which ONLY contains work apps and software dev, nothing else), I'm hitting against the 1TB SSD and have to delete caches to get space back from time to time. The Library directory is currently a whopping 220GB (just checked with du) and I have no idea why.
Windows was a similar experience before I replaced it with a Debian + Steam install.
37GB for an extreme case of 173 large GUI apps built to 97 different runtimes on a system where I can get the latest and greatest version (or older version) of the app without being hobbled by dependency hell seems like a steal by comparison.
Furthermore the Library folder contains application’s data, not applications…
Though I would be interested in a deduplicated nix store of the same number of apps — which is still the best solution imo.
The extreme 37gb example is already deduplicated and compressed (from over 100gb of data). Plus it doesn't require learning the user-unfriendly nix (which is absolutely necessary for debugging when things break).
Of course, Windows does something similar to maintain backwards compatibility with apps going all the way back to Windows 3.1, and does so pretty efficiently all things considered. Flatpack seems anything but efficient.
So it takes around 3.7x the size it should? That's not unusual given that it isolates all dependencies.
flatpak list --columns=ref,sizeThese days it's often being used on phone distros that have nothing to do with Ubuntu (PureOS, Mobian, postmarketOS, Fedora, Arch...). I have like six or seven apps installed via Flatpak, and about a hundred via regular repos. I'm glad Flatpak exists as it enables some use cases that wouldn't be possible otherwise, but let's not pretend that its disk usage is not a PITA (the way it handles updates is super annoying too, you never know how much free space you actually need to have available for it to succeed).
And each app has its own copy of any dependency it uses and apps are isolated from each other.
This seems backwards. The more apps you install, the more likely it is that it will reuse a runtime or otherwise that you already have installed, and hence the less space it is likely to take up.
The traditional approach forces all packages to make do with one version of a library, whereas the flatpak approach encourages them to ignore what other apps in the ecosystem use. The flatpak approach will definitely cause severe bloat in the amount of space used on the system.
Yeah, and that means a bunch of them don't work properly. It's unrealistic to expect app developers to support that one version that each particular distro ships.
Ultimately it's up to distro packagers to make sure the API/ABI lines up properly for dependencies. Of course many of them do not go any further than that, so an app that compiles, links, and starts up may have other issues the packager didn't catch.
My impression is that exceptions become more and more prevalent as (app?) development practices diverge from the workflow that distros have spent decades optimizing their processes for (ie., apps are developed with package managers that don't map well to distro packaging).
There's a lot of "it's not that hard"s in that post. Of course we all prefer software that just works after being installed with the distro package manager. I don't want to install a container runtime to run grep or netcat or whatever. Meanwhile app developers have to balance their own priorities, it gets complicated, and, I guess increasingly often, "ship X feature to Flatpak users" wins over "make the lives of users/maintainers of Fedora easier". It's just another tradeoff, and sometimes the cost of making do with one version of a library isn't worth it.
For the popular applications, it maybe that distro maintainers send you the pull request. But for small time applications, all you get are bug reports that the application is crashing on X distro, fix it.
We ended up moving to AppImages to not deal with all these headaches anymore.
Distros themselves run on very few volunteers. So it's usually a painful process to even get your application packaged into distros like Debian etc .. when dealing with public domain libraries that aren't available in their repositories but you aren't allowed to statically link to them.
https://github.com/vovoid/vsxu/search?q=libpng&type=commits
I remember there were some undefined reference errors too that were causing these issues across distros..
I've been bit by this style thing plenty of times. Just recently, I started a python project and used 3.11, only to realize I was targeting AWS Lambda and at the time 3.9 was the best they offered. I could have tried maintaining two versions and worked around that, or I could change completely to 3.9. (Now 3.10)
Did I lose on some things? Yeah, the switch stuff, in particular. That said, it was far preferable to a complicated build chain that tried to support both.
But you do see the problem right? How distros end up creating this weird situation of certain libraries not being available in certain places. They won't even let you statically link your program to those libraries to it into their repositories. It was easier to just give up.
It really depends doesn't it? If there's a small amount of deps then it's likely but at an infinite amount of possible deps it's clearly unlikely. The reality would depend on the ecosystem but my guess is that there's a lot less overlap than one would hope.
Whereas the flatpak approach allows any application to define a new runtime version without affecting other applications.
The downside here is increased storage, but I think it’s well worth the stability gains
Or just get a package manager that actually solves the problem and can handle multiple versions of every package. Then you get good deduplication, and can still use whatever you wish. Nix and guix are like this.
So why not just statically link at this point?
In many cases, you just can't. Other than glibc having issues with static linking, you can't use `dlopen` in a static binary.
For example, if you're building an application which can use OpenCL, you need to dynamically link to the ICD installed on the system. And because `dlopen` doesn't work in a static application, you're stuck with dynamic linking the whole application (or at least with libc). On the other hand, Windows has no issue with `LoadLibrary` in a static binary...
I don't know enough about GUI applications, but I wouldn't be surprised if anything needing graphical output is in a similar boat.
The cherry on top is that glibc doesn't make it easy for an application to be built for an older version of the library. As Linus Torvalds can attest to [https://www.youtube.com/watch?v=Pzl1B7nB9Kc] building for Linux sucks.
The best trade-off is probably "link against libc, statically link everything else". That gives you dlopen() and some security benefits. But again, build systems don't support it very well out of the box.
I think the outright hostility against static linking has been unfortunate, because now we have a whole bunch of "static linking, but with extra steps" systems to work around it. Dynamic linking is fine for many things, but it's obviously not always the best solution.
It's disappointing that essentially nothing really improved in the 10 years since Linus gave that talk. Okay, there's flatpak and appimage and snap which are an "improvement" of sorts, but it's all pretty complex and half the time when I wanted to run one it didn't work well.
I'd like to be able to patch SSL bugs without downloading a whole new binary for everything that depends on it. But at the same time, I probably couldn't care less about other dependencies, and I don't want to sort out version mismatches and deal with system libraries in most cases.
Ideally the operating system itself could help manage this. Know what deps I care to handle myself or override.
SDL works like that: https://github.com/libsdl-org/SDL/blob/main/docs/README-dyna...
Also you'd want the basic libraries like glibc, ssl to be provided as shared libraries by the distros for various reasons - including security.
That being said i do appreciate how newer languages like rust, go default to static linking.
While this might be a little more annoying, you can absolutely statically link a proprietary application with an LGPL library. You do need to provide object files for the proprietary bits so someone could relink it with a different/modified version of the LGPL library, though. Which, yes, is annoying to the point that if I were distributing a proprietary application, I probably would use dynamic linking with the LGPL bits.
Sadly I have to agree with this. How many "package maintiners" are just wannabe developers that are just doing a bullshit job. Sure they can edit a .deb or .rpm when someone tells them what needs to be fixed, but they couldn't build an app and create the package in the first place.
Another problem is that library devs don't always maintain compatibility. If you're changing a minor version number you should not break any apps using you lib. Full stop, don't tell me your sob story - you are someone's infrastructure and need to act like it.
Fedora (my fave) should ship the latest gtk3 and gtk4 and no app should have to depend on a specific minor version - 3.12 or later is reasonable if the distro is tracking the latest for example.
There's plenty of responsibility here for app developers, library developers, and packagers. If they would all do their job there would be no problem. The real issue is that nobody is perfect, nor has infinite time, so we keep trying to delegate. Modern software development and deployment is at the edge of human capability. I'm not sure what the solution is, but complex dependency management (npm) is not the answer.
You can’t install a “Fedora 38 SDK” or an “Ubuntu 2023.04 SDK” and reliably build software that will be binary-compatible from that point forward—much less use a mechanism like Deployment Target on Apple’s platforms or whatever Android calls the same concept (API version?) to build binaries that can run across a range of distro releases and use features from newer distros when running on them but gracefully handle the case where they’re not available.
Hence commercial software will target something like RHEL or an LTS release and many users will ultimately wind up running that software in a VM anyway as time goes on and binary compatibility isn’t maintained.
Flatpak and snap are both just admissions of failure when it comes to this stuff. It’s been straightforward to build platforms this way for multiple decades now, just do it already.
I'd be a little more charitable.
"Package maintainers are overworked, thus Flatpak."
Flatpak is not an improvement on any technical axis. It's going to bloat your disk usage. Your apps are going to have slight inconsistencies as app developers are going to lock to a specific version of Gtk/Qt/etc. and never move. I can go on and on.
However, that's not the point. The point is that package maintenance is work that nobody is willing to do or to pay for. At the end of the day, there simply is no choice other than shoving this back at the app developers.
It's also work that shouldn't have to exist in the first place. Same application being packaged in different formats - rpms, debs, tarballs and what not -, linked against different set of libraries - so that end users can unpack and run the application developers develop.
I know I'm simplifying the issue, but when you step back and look at the issue of how much time, energy and money goes into maintaining packages of the same software for different versions of different distributions, makes you wonder how we got into such a situation.
I remember having to update whole Ubuntu version to get a newer version of an application I wanted to use.
I did say "how many... ?" Certainly not all, but I once did a fresh Fedora install once, and the latest version of something didn't work. Not at all. I managed to do some searching, tracked down the root problem (in a dependency) and found a workaround, posted that to the IRC, and a while later the package was updated. The workaround was something like passing an option in the launcher - no "code" or rebuilding.
That has never been a thing. There are plenty of software where even fixing a bug is compatibility breaking.
Just make the package manager in a way that it can handle any number/kind of different versions.
See Windows. See MacOS.
One difference between the "Flatpak distro" and traditional distros is that the latter's modularity improves accountability. For instance, if I encounter a bug with a Fedora or Red Hat RPM, I can file an issue in Red Hat Bugzilla for that component, each package has an owner whose job includes handle those bug reports just for that package and forward them upstream if necessary. If I wish, I can even install the corresponding debuginfo packages and step through a debugger myself.
Since Flatpak runtimes are monoliths, every bug is a problem with the entire runtime. It's not clear who is responsible for what part. Is there a centralized bugtracker for each runtime?
Also, compared to the "Flatpak distro" traditional distros have more clearly articulated maintenance policies. I know for how long a Fedora RPM or Ubuntu deb will get updates, and I trust the Ubuntu and Fedora maintainers to keep on top of the latest security patches. What level of maintenance does a Flatpak runtime receive?
This seems like the killer feature of flatpak.
Regardless, do you not trust the applications that you run natively?
Sandboxing has uses other than running actively hostile apps (for which I'd argue this kind of sandboxing isn't enough).
However, I only run Flatpak applications when there are no better ways to run software.
$ ./flatpak-dedup-checker Directories: /var/lib/flatpak/{runtime,app} Size without deduplication: 13.82 GB Size with deduplication: 9.74 GB (70% of 13.82 GB)
$ flatpak list --app | wc -l 16
10GB for 16 applications is a lot. Electron applications seem to be the worst offenders here, I'm not seeing any runtime sharing between them and they're all hundreds of megabytes in size.
Developers are lazy, thus Flatpak - https://news.ycombinator.com/item?id=36185498 - June 2023 (18 comments)
I do software dev for a living. But as a desktop user, nowadays I couldn't care less for the circus and crazy things my OS does in the background. I just want functionality and things to work. I've also got terabytes of disk, MBps of bandwidth and 32GB of ram, so I dont really care if a library is repeated 50 times in my OS. I just want shit to work.
Flatpak, AppImage or .deb, I dont really care as long as I can achieve what I need to do.
And yes, I'm a developer and am generally lazy. That's why I love doing automation
I still can never remember all the idiotic debhelper commands and the linter has strong ideas on how to do something.
I can’t by any means point at a url or git repo, specify a hash, and add some minimal steps and dependencies followed by a single command. That just doesn’t exist for rpm or deb, or if it does it’s very difficult to find good information on it.
Nix goes even a step further and ensures the packaging works in a nice clean environment ensuring you didn’t mistakenly use something else installed but unlisted.
Frankly I’d be surprised if flatpak or anything else is ever as easy as arch’s makepkg .
I could see some app developers liking Flatpak as a way to self-publish a new app (in order to gain some users) before distro packagers pick it up. I don't think I'd ever do that; I'd just wait for distros if they think it's worthwhile, but I can understand why some developers could find it useful.
The thing is, after reading this article, as well as the article it's responding to, I find that I largely agree with both of them. Software distribution and packaging on Linux is a huge mess, especially if you want to distribute binaries that make it easy for users to simply download your app from your website and run it. Flatpak does seem to do a decent job of solving that problem, though it creates other problems, and tries to do other things (like sandboxing) that it doesn't do particularly well. But at the same time, if you end up with a reasonably successful open source project (ignoring the chicken-and-egg problem there), you can rely on popular distros to package your app for you, and you just don't have to worry about it.
I think Flatpak could provide two main (potential) benefits:
1. Sandboxing and isolation. I agree that even distro packagers mostly don't do any kind of security auditing. They get an app building, running, and maybe do a few basic things with it to ensure that it at least vaguely works. Of course, as the author points out, many Flatpak apps are intentionally allowed to break out of the sandbox, and this fact is very poorly communicated to users.
2. Proprietary software distribution. Vendors won't package for 20 different distros; on average you get an RPM, a DEB, and maybe a tarball with an install script that does who knows what to your system. And hopefully they built it on an old-enough distro so it doesn't unintentionally depend on this month's release of glibc. And then hopefully it doesn't depend on libraries that are so old and obsolete that most distros don't ship them anymore. Flatpak gives vendors one thing to target that will run anywhere, and while I avoid proprietary software as much as possible, there's value there.
For my part, I keep Flatpak and Snap off my system; if an app is only available that way, I'll find a different app.