9 ms·
Nah. XDG base directory was supposed to solve a ton of things 18 years ago, except none of them are hard-hitting user problems most folks really care about most
by zbowling 2y ago
Nah. XDG base directory was supposed to solve a ton of things 18 years ago, except none of them are hard-hitting user problems most folks really care about most of the time unless you are really anal about hidden folders in your home directory polluting things up (most people aren't), so it fails with partial support from apathy from some package devs on Linux to implement it.
Honestly, we should probably abandon the hope that we will ever get full universal adoption. It stinks even worse with the half-adoption state we are in now, with some apps writing to those directories and other apps not. If it wasn't for arch Linux folks trying to drive apps to adopt it more, I don't think it would be. Hell, default Debian/Ubuntu still doesn't set XDG_* directory ENVs by default (some flavors do), and some apps ignore the prescribed "if not set, use this default" nonsense in the spec and do what they have always done because it doesn't break compatibility for users.
Part of the spec stinks, too, like the spit between cache/config/data config where the spec has no written rules specified on when anything is expected to be cleaned up and when or what can or should be backed up by the user.
Let's move to containerizing most apps, putting everything in little jails so we don't have to deal with where they want to write to. They can have their own consistent and expected behaviors on their own island. Snapcraft, flatpack, or any of a bunch of other solutions are already available to solve this problem. Don't have to worry about what some app left behind or wrote to your system when it's all contained.
- 38 2y ago[flagged]
- zbowling 2y agoGuess you have never used https://snapcraft.io/ https://snapcraft.io/, https://flatpak.org/ https://flatpak.org/, or https://appimage.org/ https://appimage.org/ because all of these do exactly that. Snap apps are straight linux containers and the others root like chroot jails I believe still. Or even go take a look at Nix/NixOS and how they pull it off in another way. They have hermetic isolation down to a science. Or heck, just look at what Android does, running each app under its own uid/gid, sandboxing 3rd party code, and keeping each app from reading and writing outside their little jails. Can't pollute a user directory or even write to /tmp if your user can't even enumerate it. Hell, even built a whole sandboxing capability-based security model inside of Fuchsia at Google, which I worked on for 5+ years. I've been building OSs for 20+ years, between Fuchsia and Android at Google and mobile/embedded products at Texas Instruments, so I hope I know what I'm talking about.
- fragmede 2y agoOr Qubes, which goes further and features per-app VMs. Snaps was foisted on the community which was then unwelcoming of it, but per-app isolation isn't the worst idea.
- Brian_K_White 2y agoAndroid is a thoroughly managed appliance, not a general purpose OS. Snaps should not exist. Flatpak and appimage should exist, but should not be used except in extreme cases. You can have bad judgement for 20+ years easily.
- zbowling 2y agoNah. Your objections are rooted in the very limited definition of what an OS is and what a user application model is that fits it. There is no reason why each process/app can't be sandboxed. In fact, it should be for security (we did it in fuchsia). It's actually the way things work with apps from the app store on MacOS in a lot of ways where you can't escape your jail except through what is explicitly entitled. General purpose just means that it's generally useful for a wide range of applications. Android is that. Hell, you can find Android running small appliance server infrastructure and powering IoT devices. Even in 2024, iOS/iPadOS is general purpose at this point, and they have VERY different application models from legacy app models you find on Windows and Linux. You wouldn't not call NixOS a general-purpose OS, and it's like flatpak for literally every process down to things like bash, grep, and vim. Snaps are fine. Aversion is only from how it was introduced to people in Ubuntu, but conceptionally, is great. cgroups wrapping user processes to box them is not only good for security but also for stability and solving dependency versioning issues. It's brilliant. It's similar to what we did in Fuchsia at Google (we took it to another level because we had no legacy to deal with). And sure, maybe I have bad judgment on some things. I contributed a ton to GNOME in the early 2000s both code and ideas that were horrible in hindsight, but I'm not still stuck in an outmoded mental model for thinking about my user environment.
- account42 2y ago> Guess you have never used https://snapcraft.io/ https://snapcraft.io/, https://flatpak.org/ https://flatpak.org/, or https://appimage.org/ https://appimage.org/ because all of these do exactly that. Snap apps are straight linux containers and the others root like chroot jails I believe still. AppImages are not containers at all. They bundle up the program data into a single archive but do not do any sandboxing and leave programms to write their user/config/cache files to wherever they would be written without AppImages, i.e. in xdg-basedir locations. As it should be. > Or even go take a look at Nix/NixOS and how they pull it off in another way. They have hermetic isolation down to a science. NixOS's packaging is also completely orthagonal to the xdg-basedir spec. > I've been building OSs for 20+ years, between Fuchsia and Android at Google and mobile/embedded products at Texas Instruments, so I hope I know what I'm talking about. None of those are desktop operating systems. Please stay away from those with your anti-user opinions.
- cwillu 2y agoYeah, I had upvoted the comment, and retracted the upvote when I got to the last sentence. Nobody who has anything kind to say about snaps has any business anywhere near my desktop.
- CoastalCoder 2y ago> I was sort of with you until this, when I realized you have no idea what you are talking about. I love the pith of your comment, but it wasn't very nice. Like the Churchill quip about being called drunk.
- pseudalopex 2y ago> It stinks even worse with the half-adoption state we are in now, with some apps writing to those directories and other apps not. It stinks about half as much as before. > Part of the spec stinks, too, like the spit between cache/config/data config where the spec has no written rules specified on when anything is expected to be cleaned up and when or what can or should be backed up by the user. Caches don't have to be backed up and can be deleted if you need space. Most people will want to back up configs. What other data should be backed up is a question different people will answer differently. And containers don't solve this.
- immibis 2y agoI actually back up my Gradle cache in particular because things have a tendency to disappear from the internet sometimes, and permanently break builds of older stuff.
- thesnide 2y agoThat stuff that disappears, do you have means to patch and rebuild it? Otherwise, you're directly heading for a nasty surprise at the worst moment.
- immibis 2y agoThe build dependencies are the problem. The build process downloads them from hardcoded internet URLs and they are cached for 30 days. By backing up the cache, I can (probably) rummage around it later to find anything that's been deleted from the internet.
- Wowfunhappy 2y ago> unless you are really anal about hidden folders in your home directory polluting things up n = 1, but, uh, this is one major reason I don't use Linux. It really bugs me.
- BenjiWiebe 2y agoIf hidden pollution bothers you, and you use Windows, don't browse the registry. shudder Actually AppData can get a bit polluted too.
- thesnide 2y agoParent seems to care more about 'not polluting something i see all the time'. Typical of our society, we want to make everything someone else's problem. I guess we deserve some of the SaaS enshittification and it's spending obesity ;-)
- Wowfunhappy 2y ago> Parent seems to care more about 'not polluting something i see all the time'. Yes, this. > Typical of our society, we want to make everything someone else's problem. I don't think that's a fair analogy. It's more like moving junk from the living room to the attic. I'd prefer to have a clean living room and a messy attic.
- vetinari 2y ago>> Parent seems to care more about 'not polluting something i see all the time'. > Yes, this. Like "My Documents" (or "Documents" nowadays)? Now that's some dumping ground.
- Wowfunhappy 2y agoThat's bad too, but at least it's not right in my home folder! When I have to use Windows, I basically just avoid using Documents for files. (But my daily driver is an ancient version of OS X, which has ~/Library for these things.)
- account42 2y ago> Hell, default Debian/Ubuntu still doesn't set XDG_* directory ENVs by default (some flavors do) You are supposed to leave them unset if they match the defaults. Programs ignoring the spec is another matter and should be fixed in those programs not by needlessly bloating the environment of every process with meaningless data.
- zbowling 2y ago> meaningless data Things like .git and .ssh not are not meaningless data even though they are not in ~/.config/ssh/ or ~/.local/shared/git.