by compsciphd · 4y ago · 0 comments
Except, snap can't update applications while they are running!
i.e. try to do a snap refresh while firefox is running, nothing to update, because its running, quit it wait for all processes to die and then refresh, and it will update and cause you to wait 30-60s while it does it, and then you can restart firefox.
This has to be one of the most idiotic design decision ever made by a containerized application system showing the designers don't understand containerization at all.
one of the primary points of containerization is the ability to have multiple copies of an application running in parallel using different "application images". One should be able to upgrade (i.e. install a new image in parallel to the old one) without disrupting existing execution environments.
Basically all firefox has to do is
1) if a container is running for the current user, execute firefox in its context
2) if no container is running for the current user, create a new container
3) every so often, garbage collect old images that don't have containers running for them.
these concepts are so simple, even docker basically does it!
and that's my rant for the day.
Oh, it's worse than that. When there is an update available but firefox is running you get:
> % snap refresh
> All snaps up to date.
It doesn't even tell you there is an update and that you need to close firefox to get it. In fact, it tells you there isn't one.
Can Firefox itself, when installed via Snap, notify the user that it needs security updates? If so, can users effectively do that, or do they have to know this incantation of closing, waiting, running a terminal command, and restarting?
Snap done properly it’d download and install the new version, point launchers to that and prompt the user to restart running snaps.
When a statement has many examples it is correct to use "e.g.," which is an abbreviation of _exempli gratia_, which in turn is Latin for "for example." For example: There are many emotions a person may feel, e.g., happiness.
When a statement has only one logical conclusion it is correct to use "i.e.," which is the abbreviation of _id est_ which in turn is Latin for "that is." For example: It was the same colour as a clear summer's day sky, i.e., blue.
It seems a bit trite to pick on a single element of language out of the whole post. But it was delightfully communicated and factually educational.
TIL.
It seems you live on a completely different planet to me... "i.e." simply does not mean "for example", and no one who has a good, academic level of English would ever think so.
(Q1) "Do you, even occasionally, ever use e.g. or i.e. when speaking or writing?" Almost all people will answer yes.
(Q2) "Can you correctly define these abbreviations and explain their correct usage?" 1 in 10 will answer correctly.
(Q3) You (the interviewer), use one or the other in a sentence, ask people to correctly paraphrase your meaning to see if, in spite of their lack of academic understanding, they are still perfectly capable of understanding you. 9 in 10 will answer correctly.
This, almost by definition, represents linguistic evolution. And that is ok. I would go so far as to argue that "academic level of English" should be rephrased as "academic style of English" and that that stye has zero relationship with any notion of "correctness" at all. Telling the 9/10 from Q2 that they are "wrong" is, again, very misguided and pretty jerky honestly.
We are all wrong.
For basically any app I use that's installed via snap, I eventually run into a gamebreaking issue and have to remove the snap version and find a normal .deb to install from. Whether it's customization issues (setting up custom fonts in VS Code didn't work) or stability issues (the tab bar in Firefox windows freezing up), there always seems to be some kind of problem
Applications like Firefox, IntelliJ, Chromium, etc. shouldn't be tied to system dependencies managed by apt. They should be entirely monolithic and hermetic.
Long term this deb vs snap approach will make sense and be good for Desktop Linux.
Is snap enough of improvement of Flakpak to ignore community standard and deal witb all the user hostile craziness like non-removable updater? No way.
I hope it goes the way of the Mir and upstart - replaced with a competitor and silently removed.
No. When we have flatpak and appimage, snap makes zero sense. I just see it as a way to implement a centralized walled garden into the OS, and don't install Ubuntu systems even in VMs for five minute test drives.
The way Canonical rolled it out is flat out insulting to the free software community and distro culture, IMHO.
It's too late here to write about its technical problems, so I'll leave it at that.
Snap is immature, and not ready for production deployment. The way Ubuntu/parent company have pushed snap has been damaging to its image.
There's a particular irony to this statement. Before adopting Wayland, Canonical tried to do their own thing with Mir[1]. Years later they gave up and reluctantly adopted Wayland. Their investment in Snap rhymes with this. Snap is an inferior competitor to Flatpak, and in the end it's likely the dust will settle for Snap the same way it did for Mir—in the dirt.
Canoncial as an organization has some serious NIH syndrome and they are putting "Linux on the Desktop" through a lot of unnecessary pain.
AFAICT, Snap is a pretty good solution for server side apps. This is pure speculation (and I don't even know if the timelines line up), but I suspect Canonical developed Snap for server apps, but something made it economically non viable (maybe the popularity of Docker?) and so they now needed to generate money through it some other way and they decided to do it by using it as a workstation app distribution mechanism, and by locking it down for enterprise.
So, flatpak will win, after years of Canonical messing about with snaps?
My Debian installation regularly has two or three versions of the same library (e.g. libx264) installed while packages update and start to use newer versions of the same library.
[0]: https://tldp.org/HOWTO/Program-Library-HOWTO/shared-librarie...
I remember seeing it demoed at Canonical in 2015 or so. It’s been 7 years. How much longer should we wait?
That comparison is not helping to sell it.
How much time? We've been waiting for over 10 years for the dust to settle with Wayland.
I'm not entirely sure if Firefox is updateable via the UI. It's truly awful; and that's coming from an Ubuntu lover.
Agreed that the process sucks :)
No, you don't need to do this at all. You need to shut down Firefox, open a terminal, run 'sudo snap remove firefox', then 'sudo apt install firefox', wait for it to complete, then re-open Firefox.
(I might be missing a step here)
I still get notifications that to update the snap ai need to close firefox, so I wonder what is really happening…
Bonus, I don't need to be root to update it!
It's amazing that they're managing to make it so confusing that someone who wrote .xsession files can no longer understand it without doing a bunch of research. This shouldn't be tricky... that message, in particular, is absurd. Why would you show that and then not have a button that says "update"?
> Except, snap can't update applications while they are running!
What's worse is the unblockable notifications.
And I just de-snapped my xubuntu 22.04 , and doing so upgraded firefox-snap v113 to their repo v116 ! I mean, I thought the purpose was fully updated. Evidently not.
Snap needs to die in a fire.
Firefox can't do that. The simplest reason being that it is stateful and keeps records of history, bookmarks and whatnot which not only can't be accessed concurrently, but the specific storage model chosen can only be forward migrated. Accessing this data from two different versions of Firefox would inevitably lead to corrupt data, even when concurrency is not an issue.
That's just the obvious reason with profiles. But there are also various other issues where Firefox interacts with the plugin system and other external data. All of these could probably be fixed, but it would require a radical redesign of the software which right now no one has stepped up to do.
The least problematic method of using Firefox on Linux for most users is probably the official tarball. It's the trivial method of unpacking a software and running it from the destination folder. It has implications for freeness and DRM, and the obvious problems bundled dependencies bring, but Firefox is unusually well maintained software with the manpower to make it work.
And containerization or producification on top of Firefox will only make it more complicated and worse supported than upstream is.
i.e. you install a new firefox, the data on disk (i.e. file xyz) is no longer what the firefox version running expects and bad things happen. It could cache everything in memory (I guess) and never have to read anything from disk, after it starts up (relative to it, cache/cookies in local profile shouldn't matter in regards to disk).
so when you update the deb you are replacing file 'xyz' and old xyz no longer exists (as opposed to unlinking and replacing "/usr/bin/firefox" as even though unlinked it will still exist (for paging purposes) until every execution of it terminates and only then will it actually be removed from the file system.
this is where containerization can help on a "multi user" system, if everyone ran firefox in a container, every time they started it fresh, they would get the most up to date copy installed (in a non "multi user" setting, its less important, but can still have some value). (quotes because I mean multiple simultaneous desktop graphical desktop users, which if we're honest, most desktop linux users aren't doing).
Would you like to run a completely new Firefox with a completely new profile whenever you update it? You do know that you can't use the same profile even with the same version of Firefox in two separate Firefox instances concurrently, right? If the updater was aware of snap and snap aware of the application it's updating, you could have a graceful update procedure that serializes the current state and reloads the new container, but that's a lot of hoops to jump through, and the jumping must be coordinated between multiple stakeholders.
1. Install and start Firefox. There is one container and one directory full of profiles.
2. Start the upgrade. This creates a second Firefox installation (container) sharing the same profile directory.
3. Try to run Firefox without quitting the old one. Does nothing because the runtime is smart enough to know that the old one is running. Maybe pop up a message suggesting restarting Firefox.
4. Quit Firefox. Start it again. The new one runs. All the data is still there.
5. The old installation goes away.
The runtime has plenty of flexibility in how to make this work. There could be multiple containers. There could be one container with multiple parallel versions. There could be one container with a staged upgrade that can swap in essentially instantaneously once the container is idle (although this may fall apart on multi-user systems or where the containerized program regularly has multiple running copies of itself at once, e.g. a program like bash).
But the fact that snap apparently has trouble with this seems a bit embarrassing.
Every critical piece of information is available to Snapd, and yet, they have chosen the wrong and broken implementation.
> if a container is running for the current user, execute firefox in its context
So there is no need for snap to fancy serialization, just have new and old firefox ready, and keep using old one while it has running processeses. And if the old one exits for any reason, start new one instead.
That's all snap has to do! But it does not, because it really likes to make strange texhnical decisions for some reason.
(For "coordination", snap could make a common file in old app dir like "bin/new_version_availablec, and if firefox detects it, it shows that "your browser needs to be updated" button. I would not be surprised if something like this already exists in firefox. But I doubt snap would use this approach because it is not complex enough for it :) )
You don't need to serialize or reload anything.
Snap can't even update snap-store because it is running in the background.
There is no way for a non-tech savvy person to even figure out how to get past that error.
You either have to ask the user to restart firefox (that would be the sane choice) or corrupt user data.
But i agree that snap sucks. Snap sucks particularly bad because they also push it where it's not only unnecessary but also detrimental to the user experience.
Simple dumb example: i had gnome-calculator in my toolbar. I sometimes need to make basic calculations, it's easy and I keep it handy. I realized that gnome-calculator (a 500k binary) was taking 30 fcking seconds to appear. Turns out it was "updated" to a snap, and now launching it meant for stuff to be mounted around and for snap to do whatever it wanted with my time.