top | item 40578948

(no title)

zbowling | 1 year 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.

discuss

order

account42|1 year 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|1 year 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.

pseudalopex|1 year 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|1 year ago

I 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.

Wowfunhappy|1 year 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|1 year ago

If hidden pollution bothers you, and you use Windows, don't browse the registry. shudder

Actually AppData can get a bit polluted too.

38|1 year ago

[deleted]

zbowling|1 year ago

Guess you have never used https://snapcraft.io/, https://flatpak.org/, or 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.

CoastalCoder|1 year 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.

cwillu|1 year ago

Yeah, 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.