News for hackers. Stuff that matters.
Re:$Home, Not So Sweet $Home by toast0 on Wednesday August 16, 2023 @06:50PM (#37154921)
> Screw your conventions, we've always done it this way

I don't understand this section heading. To me, software convention has the third meaning as shown on merriam webster[1]:

> 3 d : an established technique, practice, or device (as in the theater)

In that case, that we've always done it that way establishes the technique, and the established technique is the convention.

To argue that non-desktop software should apply a desktop specification that they weren't involved in developing seems rather insane, especially since they are and have been following the established convention.

[1] https://www.merriam-webster.com/dictionary/convention

Re:$Home, Not So Sweet $Home by mschuster91 on Wednesday August 16, 2023 @06:55PM (#37154968)
> To argue that non-desktop software should apply a desktop specification that they weren't involved in developing seems rather insane, especially since they are and have been following the established convention.

So what, stuff changes over time - and it's not that hard to migrate, either warn the user, or do the migration at first start. Good software should move with the times, not be perpetually frozen.

Re:$Home, Not So Sweet $Home by toast0 on Wednesday August 16, 2023 @07:16PM (#37155147)
Forced migrations always leave a legacy of pain.

How many documents tell you to configure ssh with something in ~/.ssh/config and if the change is made, will now need to be changed to say put your config in one of many paths depending on the version you use?

What if you migrate your config and then roll back to an earlier version?

What if you use your home directory on multiple systems, some which have varying versions of the tool, loading the config from various places (network mounted home directories are a practice in some companies)?

What if you don't upgrade for ten years, and the migration code is gone by then?

What if you operate on a mix of systems of various ages, some which have the new path and some which have the old?

What if the migration code has a security vulnerability?

Personally, I don't see where the benefit is that pays for anywhere near any of this cost. Maybe if you're a desktop app that is within the scope of standards put out by the XDG, you might want to consider accepting this standard of theirs too; and sure, if you're a new application, seems like a might as well?

Re:$Home, Not So Sweet $Home by JoBrad on Wednesday August 16, 2023 @10:08PM (#37156301)
I thought about this, too. One fix would be for ssh to make a solid process that walks you through setting up your ssh config. Then it could be placed anywhere you like, and the preference would be set. Those docs would just reference the setup switch or tool, instead.
Re:$Home, Not So Sweet $Home by tsimionescu on Thursday August 17, 2023 @07:58AM (#37160268)
10 year old docs would reference the newly developed SSH options?
Re:$Home, Not So Sweet $Home by vorpalhex on Wednesday August 16, 2023 @07:01PM (#37155015)
If you force me to migrate, I'm probably ditching your software. The inability to keep a stable user contract is a deep flaw that impacts too much software these days.

Respect the user.

Re:$Home, Not So Sweet $Home by devnullbrain on Wednesday August 16, 2023 @07:04PM (#37155047)
Multiple options for configuration files is a well-trod, easy solution. You shouldn't have to migrate.
Re:$Home, Not So Sweet $Home by INGSOCIALITE on Wednesday August 16, 2023 @07:38PM (#37155321)
Everyone should do what emacs does (and a lot of software does): first look for .emacs for a config … not there? Check .emacs.d … still not there? .config/emacs …
Re:$Home, Not So Sweet $Home by tsimionescu on Thursday August 17, 2023 @07:56AM (#37160253)
That's not exactly what emacs does: if ~/.config/emacs isn't there, then it will default to creating ~/.emacs.d/ and ~/.emacs, even if the XDG env vars are set. Basically, emacs supports XDG config if you really want it to, but it's not the default way of using emacs. And of course, it only uses ~/.config/emacs, none of the other XDG folders. If you download a package from MELPA, that's still going to .config/emacs, as far as I know.
Re:$Home, Not So Sweet $Home by arp242 on Wednesday August 16, 2023 @07:56PM (#37155459)
But also not without the downsides, because what do you do if multiple files are found? And how will you communicate that to the user, if at all? Lots of room for confusion here: "why aren't my changed taking effect?!", "where is this setting coming from, it's not in my file?!" and things like that.
Re:$Home, Not So Sweet $Home by devnullbrain on Wednesday August 16, 2023 @08:00PM (#37155483)
Stick it in the manpage. Neovim does this. Power users who care about non-standard configuration should be able to carry the burden of managing it.
Re:$Home, Not So Sweet $Home by arp242 on Wednesday August 16, 2023 @08:26PM (#37155661)
Things like bashrc and vimrc have been "standard" for decades; that's not a "non-standard configuration", it's what everyone uses today. And Neovim only supports ~/.config/nvim/init.vim judging from the manpage(?) If it doesn't then this only underscores my point that all of this is apt to lead to confusion.

Either way, it had a clean break from Vim and didn't have to deal with people who have been using Neovim for decades (lots of things are different compared to Vim and it's not intended to be compatible in the first place).

Re:$Home, Not So Sweet $Home by devnullbrain on Wednesday August 16, 2023 @09:03PM (#37155873)
By non-standard I mean XDG home
Re:$Home, Not So Sweet $Home by delta_p_delta_x on Wednesday August 16, 2023 @07:23PM (#37155194)
Author here. I had a gut feeling that heading was problematic, and I posted it anyway. I should rephrase that...
Re:$Home, Not So Sweet $Home by bootlickdev on Wednesday August 16, 2023 @08:33PM (#37155701)
It's water under the bridge. Surely you wrote better versions of SSH and Bash before psychoanalyzing the maintainers. XDG conventions are garbage btw.
Re:$Home, Not So Sweet $Home by rendaw on Wednesday August 16, 2023 @11:19PM (#37156745)
It works for me. Established also has multiple meanings, but the most applicable one here says "generally accepted" [1]. Each listed piece of software has its own way of doing things, so speaking of _the_ established practice is wrong here, and I doubt I'd be able to list more than one of those off the top of my head, so _established_ hardly seems appropriate.

And whether you agree with it or not, I doubt anyone understands "desktop" as meaning "GUI only" and not "for human users" in this context. I usually see it used contrastively as in "desktop" vs "server". Server software lives in `/usr` and writes to `/run` and `/var`, etc.

[1] https://en.wiktionary.org/wiki/established

Re:$Home, Not So Sweet $Home by toast0 on Thursday August 17, 2023 @12:20AM (#37157170)
> And whether you agree with it or not, I doubt anyone understands "desktop" as meaning "GUI only" and not "for human users" in this context.

Config files don't apply to only human users either, though. Automation also uses configs. And they've got to be somewhere. Some automation is desktop oriented, I'll acknowledge.

If this standard came from Posix, sure, that applies generally across unix and linux to all programs great and small. If it comes from Linux Standards Base, I've got issues, cause I don't run Linux, but that at least clearly applies to all programs on Linux, packaged by a distribution and configuration file locations are obviously within the scope of LSB.

But XDG is more or less the Xorg/Freedesktop peeps; how are config files for everything under the sun in their scope? There's lots of stuff in their scope, but this just seems out of the blue. Being not an exclusively Linux organization is somewhat helpful, but still. How is the XDG an authority on where to place config files when there was already a servicable location to put them (and the specification documentation doesn't even have a discussion of who they are, why their spec matters, how the values came to be, etc)

Re:$Home, Not So Sweet $Home by delta_p_delta_x on Thursday August 17, 2023 @02:47AM (#37158076)
> How is the XDG an authority

I addressed this in the article: Linux devs not being able to accept some authority—in this case, XDG—is the source of the fragmentation in Linux and why even though we have a spec, there's still a solid 30%+ of programs that don't follow it.

Yes, OpenSSH isn't a 'desktop' program, but there are dozens of desktop programs which use it as a backend. Forget Linux, for a moment: it creates `.ssh`on Windows. Windows doesn't have dot-files, and it never had. This is arrogance.

Re:$Home, Not So Sweet $Home by prmoustache on Thursday August 17, 2023 @03:24AM (#37158333)
>Yes, OpenSSH isn't a 'desktop' program, but there are dozens of desktop programs which use it as a backend. Forget Linux, for a moment: it creates `.ssh`on Windows. Windows doesn't have dot-files, and it never had. This is arrogance.

I would say this is rather consistency accross OS.

Every openssh user knows where to find its config regardless of the OS, if it follows XDG, windows guidelines or if it is running on Haiku, SerenityOS, Redox or RiscOS.

There are plenty of windows specific ssh clients that follow Microsoft guidelines.

Re:$Home, Not So Sweet $Home by zlg_codes on Thursday August 17, 2023 @04:46AM (#37158892)
I'm curious about this angle. I think you're correct, that volunteer developers contributing their code from their free time are reticent to submit to an outside entity telling them how to write their code.

But I'm not seeing how that's a problem. One of the beautiful things about the Bazaar is that if you don't like one part of it, you can move to another where they do things a bit differently. If everyone is deferring to an authority, upon what virtues and rigors do we determine its validity? What powers does it have, and why should we just blindly follow others in one of the most creative human endeavors available on Earth?

Why should one accept authority? Where does the power of this authority come from?

I have similar ideas in society fwiw. I don't see a moral reason to defer to someone else. Is my will less important than the preferences of some other person or group? As long as it's my time and effort being put into making software, it'll be built to the specification of me and any legitimate stakeholders.

Re:$Home, Not So Sweet $Home by delta_p_delta_x on Thursday August 17, 2023 @05:41AM (#37159313)
[delayed]
Re:$Home, Not So Sweet $Home by zlg_codes on Thursday August 17, 2023 @06:10AM (#37159505)
Why should software development be a democratic process? It's not really democratic if one lacks a real voice in the conversation and formal votes are not held. The likelihood of a lone hacker being listened to by XDG or a similar group is similar to the odds of a small web firm being listened to by WHATWG.

The concept of authority as democracy doesn't really make sense to me. Does that mean you adopt any and all conventions once they hit 50.1%? I think we as humans can do better than just follow or limit ourselves to standards that may be popular, but are not necessarily the best tool for the job. I struggle to find many popular and mainstream software practices to be quality, or fitting for me despite the one-size-fits-all that such popular things try to aim for.

What is your role in this 'democracy', if you are actively lobbying for a minority (the XDG) to seize control over the way desktop software is written in the community, by way of writing the piece and it getting shared? That strikes me as manipulating a narrative to get people to "vote for" XDG. It's not a legitimate vote if you and others are actively evangelizing. It's called social pressure and canvassing.

Such social and organizational efforts are completely oblivious to the fact that they are operating in a bazaar, and their methods are designed better for Cathedrals. Cathedrals are used to tightly integrated stacks and top-down decision-making, so standards are hardly different than marching orders to the monks.

The bazaar is the wild west. The only authority in a bazaar is whoever owns the land. In a digital space, there is no land. So how does any authority -- controlling environment variables, of all things -- intend to exert itself in force?

If it's truly a democracy, then the voice of those who resist XDG is equally valuable and valid.

Re:$Home, Not So Sweet $Home by toast0 on Thursday August 17, 2023 @11:33AM (#37163271)
By my count of votes listed in https://wiki.archlinux.org/title/XDG_Base_Directory

165 packages support XDG; 164 partially support it, where partial support really just means they have a way to configure the config path to an arbitrary file and if you tell it with an environment variable, it works; and 128 are unsupported. [1]

Based on that, if software is a democracy, the vote for XDG has failed, let's move back to dotfiles. Of course, moving config files is a lot of extra work and cost for users, so all the existing applications should get a pass for wherever their config files already are, but new application should follow the democratically elected choice of stuff dotfiles in the home directory.

Of course, I don't believe software is a democracy in the sense of voting and the will of the majority overriding the minority. Software is a democracy in the sense that the tools are open, so anyone can build what they want. Less restrictive source licenses allow you to take other people's work and build upon it how you want. Someone could fork all of the programs they use that don't follow the convention of their choice and "fix" them, and users could pick which one they like, software distributors could choose which one they'd like to distribute; etc.

From earlier:

> I addressed this in the article: Linux devs not being able to accept some authority—in this case, XDG—is the source of the fragmentation in Linux and why even though we have a spec, there's still a solid 30%+ of programs that don't follow it.

All authorities naturally have a scope. We don't all follow the style guides of the New York Times or the Chicago Manual of Style, although those are common to adopt in the United States because writing a style guide is hard and might as well pick one someone else did the work for. On the other hand, if you tell a UK person that they didn't follow a US style guide so they're arrogant, they'll quite rightly tell you you're arrogant and the standards of another country don't matter.

Sure, if you're writing new software, you should look around for the relevant specifications and consider picking one. If you're existing software, switching specifications is a breaking change, and you should consider what you get. You've said you find the XDG Base Directory Specification well-laid-out; but I find it lacking a declaration of objectives, justifications, and scope; those issues are non-starters for me, so I would chose the dotfile specification instead, unless I was writing something under the scope of the XDG.

[1] votes counted by separating out the tables, and grep -c '<tr>'; this is a poor way to run an election, but it's the data I have available, and the amount of effort I'm willing to expend