-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A path to XDG compliance #844
Comments
#429 had a similar idea, it was to fix an issue of symlinking the |
My only ask is that there be an opt-in variable, eg |
If Julia itself (not just Juliaup) goes down the route of XDG-compliance (which I'd love to see!), we can follow a well-trodden road for how to go about this. Most applications I'm aware of follow this sort of logic:
The most common augmentation here is introducing a As Stefan requests, a Whatever combination of the above you chose, full backward compatibility is maintained while enabling XDG compliance moving forward. |
No, I don't care if XDG-appropriate directories exist. XDG is not a good default. What we do now is a good default: for the typical user who doesn't know or care about XDG, we put all Julia-managed stuff in a single, easy to find, standard location. End of story. For the minority of people who care about XDG, they can set a single environment variable and get XDG behavior. Otherwise we get a situation where people will inevitably be confused about where their Julia files are. "Oh, you're running Julia but you don't have a |
This will never happen: XDG will always be opt-in. The UNIX business of spreading all the files related to a single application across dozens of directories that no one can keep straight is absolute and utter nonsense. I'm fine with allowing people to opt into it if they are masochists or have an actual need for it (this is like five dozen people worldwide), but it won't ever be the default. To be clear:
|
If it isn't the default it doesn't seem worth doing at all because all julia infrastructure would have to add support for it with probably very few uses (the vast majority uses the defaults no matter what they are). |
XDG hardcore compliance is a pain, and in my opinion other than In my experience XDG compliance is helpful mainly to the user so that he knows where to go look for stuff without worrying about the specific installation paths of each program used. If it is then just a matter of quicker access of that specific part of a program, XDG compliance can be easily achieved (with some extra work from the user that wants it) by symlinking. i.e.: |
I can't say I'm a fan of how this discussion seems to be drifting towards retreading JuliaLang/julia#4630. |
My position remains identical. XDG is not a good default for the typical Julia user, even on Linux. It would be a good feature to support for anyone who opts in, however. |
I agree that XDG by default without additional functionality to guide users can be confusing for a typical Julia user or new users that are new to programming. On MacOS, the XDG folder would be That said, I think even the current I don't think most users should ever open their config folder, and if it wasn't for showing people how to set up Maybe |
I don't have strong views on the substance of this at all (hey, I'm a Windows guy, we don't have these problems!), but I am not keen to support two things, so I'm with @KristofferC on this. It just makes maintenance a huge pain, now we need to test double the scenarios and this becomes a permanent "tax" on the Juliaup dev team. If this is really just for aesthetic reasons and doesn't solve any "real" problem, then I think our scarce time is better spent on other features. Having said that, our But maybe this is just one more reason to try to get Juliaup published into platform package managers as Random other thought, I think whatever we do about the |
Juliaup can use I have also brought up I have a number of thoughts on Julia and XDG, but I cannot muster the motivation to be part of another ungrounded conversation. Suffice it to say, I see value beyond "aesthetics". |
Regarding "opt-in" - for pretty much any system that has added XDG support, the "opt-in" mechanism is that you create some files in the XDG location and go delete your files in the previous location. Why isn't that sufficient for the Julia use case? Why is another separate (and redundant, and confusing IMO) mechanism necessary? I did exactly that for
Regarding "default" - I'm not sure that word should apply here, unless I'm missing something (which I very well might be). The config location isn't a matter of "default" vs. "non-default", it's just a search order, right? |
In a recent Slack conversation, I offered to help answer questions about the XDG Base Directories spec. and the
~/.local/bin
directory, as I've previously looked into this extensively over the development of BaseDirs.jl.There are a number of problems that result from needing to modify shell initialisation scripts to extend
PATH
on Linux. The conversation on Slack started with one, somebody needing to givejuliaup
write permission to their shell config in order to successfully install. Others are noted in this comment of mine in a Pkg.jl PR.@davidanthoff mentioned some of the reservations he had with the idea as a lack of clarity, and a seeming need for uncomfortable heuristics. To this, I produced the following response on how the
~/.local/bin
directory could be well-handled, and am copying it here (at David's request) for posterity.Completely get the heuristics making you uncomfortable. With Mac, everything they do define is well-defined, they just leave a bunch of blindspots, and those blind spots end up being a bit like the wild west. Linux is where I'm most familiar by far though. I'm familiar with the issue you mention regarding
~/.local/bin
only being listed on PATH when it already exists. This is usually controlled by/etc/profile
, which often includes something like this:In this case, the way to confirm that
~/.local/bin
* will be on thePATH
(short of ugly heuristics that rely on reading the content of profile files) would be to:~/.local/bin
does not exist and is not onPATH
~/.local/bin
(this is in accordance with the XDG spec's instructions on what to do when a givenXDG_*_HOME
does not exist)$SHELL
, and fetch itsPATH
value$HOME/.local/bin
is on thePATH
from the previous step~/.local/bin
is indeed on thePATH
.~/.local/bin
toPATH
using whatever kudge was already being used for ~/.julia/bin. In this event, all of the concerns previously raised about trying to modifyPATH
this way still apply, but you'll only be hitting this in rare cases.*login: Most shells will perform "login mode" startup with the
-l
flag, and their manual will contain something like thisi.e. they'll source
/etc/profile
.*
~/.local/bin
: It would be good here to use${XDG_BIN_HOME:-$HOME/.local/bin}
it's a proposed extension of the XDG spec that's currently used in practice.Another change that
juliaup
could make to better integrate with the Linux desktop is to use theXDG_DATA_DIR
for the downloaded Julia versions,XDG_STATE_HOME
for the*.json
files, andXDG_RUNTIME_DIR
for the juliaup lock file.The typical way to make this backwards-compatible and be able to use the old mode of behaviour to is via an envvar like
JULIAUP_HOME
, or even havingJUILAUP_STATE
andJULIAUP_DATA
(I'd argue that the lock file should live in the runtime dir regardless).Hope that helps, and happy to field follow-up questions!
The text was updated successfully, but these errors were encountered: