top | item 45992829

Firefox 147 Will Support the XDG Base Directory Specification

368 points| bradrn | 3 months ago |phoronix.com

155 comments

order

amiga386|3 months ago

At last! Mozilla fixing longstanding bugs! (I jest)

The devil is in the details though: https://hg-edge.mozilla.org/integration/autoland/diff/8a6d6c...

Looking briefly at this,

* there doesn't appear to be any migration from old directory to new directory. Does the code just use ~/.mozilla if it still exists, ~/.config/mozilla otherwise.. or does it _require_ MOZ_LEGACY_HOME=1 to be set to keep using your existing config, and just lose all config if you don't set that?

* there doesn't appear to be a proper split between ~/.cache (always-removable cached data) ~/.config (configuration) and ~/.local/share (application data that is not user-editable configuration and is not just cached data either), they just moved the entire set of profile stuff to ~/.config

Is that about right, or do I need to read the code more carefully?

weaksauce|3 months ago

> At last! Mozilla fixing longstanding bugs! (I jest)

you joke but they did just close out the initial implementation of a something like 27 year old bug. about:keyboard was recently added to nightly to allow you to change or clear the built in keyboard shortcuts of a bunch of menu items like save, back, refresh, or open dev tools or whatever.

philo23|3 months ago

From that diff it looks to me that if ~/.mozilla exists OR if MOZ_LEGACY_HOME is set it uses ~/.mozilla, otherwise it uses the $XDG_CONFIG_HOME/.mozilla directory instead.

So no migration to the XDG directory, but also no throwing away your existing data either.

batisteo|3 months ago

> there doesn't appear to be a proper split between ~/.cache (always-removable cached data) ~/.config (configuration) and ~/.local/share

If that’s true, the title of the issue (and blog post) is quite untrue. Shoving everything in ~/.config is different than following the XDG Base Directory spec.

At least it’s one dotfile less that’s polluting my home.

ndegruchy|3 months ago

I think there is probably a lot of work to do to fully pry the .mozilla folder apart. For a long time they've simply shipped everything in that folder and rolled with it. Making decisions on what is actually cache and what is user config vs "application data" is probably going to be harder than splitting the folder.

eitland|3 months ago

Someday they'll stop changing the context menu if I accidentaly select something.

(Some UX designer or developer thought it was a great idea to remove the back and forward buttons from the context menu if text is selected so now I have two different context menus and one of them lack the thing I am looking for most of the time which is the back button.

Or fixing the tabstrip API (someone has decided we users are now too stupid to use only tree style tabs and for our own good we must be prevented from hiding the original tab bar).

ryandrake|3 months ago

You may jest, but sadly, that was my first knee-jerk reaction to the headline, too. "Wow, Mozilla actually fixes Firefox bugs? Let's go!" This is how low the bar has gotten :(

More of this, less AI-cramming, please!

pjmlp|3 months ago

Next bookmarks window resizing, well we can dream.

darkamaul|3 months ago

This is a meaningful step! For years, XDG Base Directory compliance has been spotty across major applications. Firefox's adoption matters because it's widely used and its implementation may encourage others to follow suit.

The Arch Wiki documentation will likely need updates [1], but sadly the list of non-compliant software is far too long.

[1]: https://wiki.archlinux.org/title/XDG_Base_Directory

aidenn0|3 months ago

FWIW, the OpenSSH devs believe it to be a potential security risk to adopt XDG:

> Adding additional configuration paths is confusing and potentially risky for .ssh as, quite unlike usual "desktop" apps, it grants system access and having its configuration smeared across several possible paths makes managing this more confusing and brittle.[1]

I think this is clearly true for something like ~/.ssh/authorized_keys; it is perhaps less true for ~/.ssh/config and or ~/.ssh/known_hosts which could go in XDG_CONFIG_HOME and XDG_DATA_HOME, but if part of the point of the XDG BDS is to reduce dotfiles in $HOME then it makes less sense to move some, but not all of those files.

1: https://marc.info/?l=openssh-unix-dev&m=170687803731931&w=2

shmerl|3 months ago

Chromium is still polluting stuff with $HOME/.pki because it's not using libnss correctly and developers don't care to fix it, despite a longstanding open bug report.

Which results in everything that embeds Chromium (like QtWebEngine and etc.) polluting $HOME as well.

PunchyHamster|3 months ago

the most "fun" I had it with the mess recently was after icedove -> thunderbird name migration (it was renamed in Debian coz of some trademark issue).

Tunderbird, of course, kept mail and config in same directory. The migration process renamed .icedove to .thunderbird and removed it.

But the config for mailboxe still had .icedove/xyz path. So once config migration is finished, mails start to download in old location, and after restarting thunderbird goes "hey, there is both .icedove and .thunderbird dir, I'm not starting".

with XDG that config would be separate so there would be no need to even move the data dir

indolering|3 months ago

It's absurd that the list is so long considering the PR to fix it would only take a couple of hours.

enriquto|3 months ago

that's great!

The ~/.mozilla folder is one of the last remaining dotfiles in my home directory

    $ ls -a ~
    . .. .bashrc .mozilla .profile .ssh bak config local pro src
You can also be an xdg ninja if you want: https://github.com/b3nj5m1n/xdg-ninja

Annoyingly, many programs hardcode ~/.config and ~/.local (instead of using XDG_CONFIG_HOME etc) and try to recreate them every time they run. This is a good indication to stop using these careless programs!

smaudet|3 months ago

(hard) links to the rescue.

I like environment variables, but developers/operating systems have trouble using them well.

I could almost see XDG_CONFIG_HOME being a setting read by a driver that provides access to a "virtual" path (on *nix, all paths are virtual anyways).

wpm|3 months ago

TIL about xdg-ninja, thanks for sharing.

I despise programs that think they can just run a goddamn train on my home directory. I'm sick of hidden files I'm expected to edit by hand for configuration. I sick of ugly dotfiles everywhere.

ndegruchy|3 months ago

This is great news. Firefox respects the system-defined folders on Windows and macOS. Linux, being the free spirit it is, doesn't have a 'standard'. XDG makes recommendations that make a certain amount of sense and aligning to that is a great step forward for such a large project.

johnisgood|3 months ago

About time. Every piece of software should be XDG-compliant. I am surprised it was not the case at all to begin with.

freeone3000|3 months ago

XDG is newer than firefox and hasn’t been widely adopted for the majority of its life.

amiga386|3 months ago

Do you mean Firefox specifically?

The reason most software is not "XDG-compliant" is because most software predates the XDG basedir spec which only came into existence in 2021 (edit: oops, that's just version 0.8; version 0.6 was available in 2003)

It will be nice for software, as it updates, to support this standard which seems to be gaining adoption, and it will make users homedirs much cleaner. But it's most important for software to _keep working_, and have a migration path that doesn't lose the user's config or end up with two configs and not have a clear rule on which one it will use.

lovedaddy|3 months ago

This is awesome! Been tracking the bug for what seems like Gimp 3 levels of time. But great job all involved.

andriamanitra|3 months ago

First .mkv support and now this! I really like what Firefox has been doing recently. The only major annoyance that still remains is hard-coded keyboard shortcuts, fingers crossed!

sfink|3 months ago

Firefox Nightly has about:keyboard (as I just found out from the comment thread on phoronix). Hopefully it sticks. It's bare-bones but functional and I like it that way.

shevy-java|3 months ago

Not bad - with a delay of only 21 years, Firefox is just about to make a strong come back now. :D

johnisgood|3 months ago

Someone asked what the blocker is, and the guy replied:

  Time ? I'm focused on other things.
I mean, he only had 21 years. :D

AdmiralAsshat|3 months ago

I wonder if the original reporter is still around to see their enhancement ticket closed?

aallaall|3 months ago

Perhaps their grand children are still around?

ksec|3 months ago

I am wondering what other long standing bug or feature that is still missing on Firefox.

Firefox excel in terms of Multi Tab and memory usage. And I have yet to encounter a rendering issues in the past 12 months.

kjkjadksj|3 months ago

I’m not sure if its because of my ad blocker but I get the occasional link that wont click when I am say going through a job application flow. Could be the way their saas vender implements things. For things that are important like that or say banking/credit card websites I usually am forced to defer to Safari.

PaulDavisThe1st|3 months ago

  # export XDG_CONFIG_HOME $HOME
though more seriously

  # export XDG_CONFIG_HOME $HOME/config
why another dotfile dir?

butz|3 months ago

Let's hope this will inspire other software developers to follow conventions and move their configs to appropriate directories.

shmerl|3 months ago

Sincere congrats! It only took 21 years.

jaredhallen|3 months ago

Will it stop enabling dns over https by default?

trizuz|3 months ago

[deleted]

kernc|3 months ago

Now that everyone is kindly on board, IBM can finally bury this standard. /s

ceving|3 months ago

I think the XDG spec is pretty petty. What difference does it make that the files are in ~/.config/mozilla instead of ~/.mozilla? And calling it a bug is presumptuous.

wpm|3 months ago

The difference is that I don’t use standard XDG directories because I loathe dot-files, loathe hidden directories, and so I declare my own environment variables to put everything where I want.

Then Firefox (and ansible, and many others) comes barreling in dropping an unconfigurable dot-directory in my fucking home folder ignoring the perfectly good XDG variables I have set.

It is a constant struggle to stop my home folder from not feeling like my home. Developers ought to learn some fucking respect.

Avamander|3 months ago

There are multiple reasons for this.

One being that it's _my_ $HOME, not some random developers'. I literally had more than 50 different dotfiles and dotfolders in my $HOME at some point. It was a garbage dump and I couldn't even identify the culprit with some of them. Simply disrespectful.

Then there's the issue of cleaning up leftovers and stale cache files. It shouldn't take a custom script cleaning up after every special snowflake that decided to use some arbitrarily-named directory in $HOME.

Not following the spec also makes backing up vital application state much much harder.

In the end, I made my $HOME not writeable so I could instantly find out if some software wants to take a dump. It turns out it's often simply unnecessary as well, the software doesn't even care, just prints an error and continues.

adgjlsfhk1|3 months ago

the main benefit (which even with this change, Firefox won't get) is the separation of configuration, cache files, binaries etc which sysadmins likely want completely different policies for. e.g. cache shouldn't be backed up, config shouldn't be executable etc

kennywinker|3 months ago

Have you ever `ls -al ~/` on a heavily used unix system? Absolute rot and chaos. I have like 100 hidden directories+files in the root of my home directory. Some of them are caches, some are configs.

codedokode|3 months ago

I don't like Unix filesystem structure in general. What's the point of having directories like /usr or /lib in the root directory, when they could be all under for example, /ubuntu24? And the user could keep files in the root directory and not in /home with lot of system files.

Also I don't like that some distributions suggest partitioning a drive. This is inconvenient, because you can run out of space at one partition, but have lot of free space at another. It simply doesn't make sense. And if you have swap as a partition, you get slightly faster access, but cannot change the size!

neoden|3 months ago

> you can run out of space at one partition, but have lot of free space at another

that's exactly the point — you can run out of space in your /home but that does not affect, for example, /var. or vice versa, log explosion in /var is contained within its own partition and does not clog the entire filesystem.

tasn|3 months ago

There are a lot of reasons. Just three from the top of my head:

1. The way Unix works, a directory is a file, so if you can write in a directory you'll also be able to move directories around (and thus break the structure you mentioned completely).

2. Doesn't make sense for multi-user. Yes, I understand most people have their own computers, but (1) why design it in a way that breaks multi-user unnecessarily? (2) there are a lot of utility users, and having them get access to user files because of the way this is structured is silly.

3. `grep -r` is going to be a pain in the ass when searching your own files, because it'll also search all the other system subdirectories too.

mixmastamyk|3 months ago

It’s just historical. Believe the large number of top level directories was a result of ken not having enough space on a single disk on his PDP, when that was precious.

For years I’ve been putting all user data into a separate /data partition and have kept the OS partition small (~30gb). But you have to fix the system when first installed. When I still used Windows I had the same c:/d: split.

More recently started putting kernels into a bigger ESP (EFI) partition with sdboot or uki.

With terabyte system disks, running out of space mostly doesn’t happen anymore unless you made the system partition(s) small. Don’t do that, give them plenty of GB, each of which are now thousandths of the disk.

joestrouth1|3 months ago

If one user kept their files in the root directory, where would a second user keep theirs?

hnarn|3 months ago

I’m honestly having issues deciding if this is bait or not. Surely you understand that UNIX is a multi-user operating system and that partitioning drives exactly for the reason you describe is critical to ensure that, for example, runaway log growth doesn’t cause a database to shut down?

einpoklum|3 months ago

Partitioning a drive lets you use different file systems on different parts.

It also lets you somewhat-better enforce things like:

* Setting some data aside as read-only-never-touch-it.

* Excluding some files and directories from searching and indexing.

although admittedly you don't _have_ to partition for that purpose.