-
Notifications
You must be signed in to change notification settings - Fork 701
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
Should existence of $XDG_CONFIG_HOME/cabal/config override existence of $HOME/.cabal? #8577
Comments
I say - absolutely not.
Strongly disagree. As likely to be "accidentally" created by newer XDG-aware tools, as the old config likely to be created by the old/current tools. And in any case, make damn sure that |
I think it is is unlikely that new tools will create a cabal config file (why should they?) the way older tools might create a |
Thank you!
I say - if there are tools on the system that insist on using the old convention, then you ought to honor it as well. Otherwise - I worker want to be the one who had to untangle the mess of done stuff going to the old and some - to the new...
Impossible. Looking fur something (as opposed to creating something new) in a non-existing directory always returns an error, and does not create a directory. What have you the reason to assume otherwise??? |
Perhaps let's just see how it's used in the wild and what the user-reported real use cases and pitfalls are. If users are motivated enough to report them, I think it's worth fixing according to their report. |
Now we have some: |
One issue popped up because the idea presented in this thread wasn't implemented in 3.10: This is now featured in the release announcement thread. On the last cabal meeting this week, people seemed to agree that:
@athas would you be interested in working on this? |
Sure, I can take a shot at it. The (2) warning cannot be specific to Incidentally, my own protection from this issue is to create a |
It doesn't have to be, I think. I think it's fine for every command to complain about it because it's an undesirable state of things. As for workarounds: several has been proposed but the idea of this approach is that it should work more reliably for people who don't necessarily understand the problem and are not aware of any workarounds. |
Another option discussed on IRC is to have an environment variable indicating whether the user wants XDG or not; if the var is not set, we always use ~/.cabal. Pros:
Cons:
I think the pros outweigh the cons. Not many people care about XDG, and those who care will be able to get it (and become our testers). Vast majority won’t notice anything and will be happy in their ignorance; that’s much better than what we ended up having with 3.10.1 when people not caring about XDG get into trouble because of it. Opinions? |
@ulysses4ever I support your idea. |
I will take any reasonable solution as long as it's quick, so that we can release 3.10.2.0 soon. |
I am not in favour of hiding XDG behaviour behind an environment variable. It would be a mess if every program required that. |
@hasufell maybe I wasn't convincing enough presenting your idea about env var for XDG (#8577 (comment)). Do you want to add anything? @andreasabel it would be interesting to know your opinion also. |
GHCup does, stack does. XDG is already a mess. It took a couple of decades to support binary directory and now it's defined without a way to change it, breaking configurability, which was the entire point of XDG. I don't see a good argument why we should disrupt CI systems or the majority of users who don't care about XDG. It will never be consistently supported by all tools anyway. And it has serious drawbacks too (sharing of bindir is one). |
Why is it that XDG support disrupts CI systems? I can see that caches built for pre-XDG cabal may interact poorly with XDG cabal, but that sounds like an issue that will resolve itself quickly, as CI caches don't tend to live that long. Normal users will probably not be disrupted much. The only case I can think of where confusion occurs if if you do a |
+1 to Julian. If env var is set - it becomes the ultimate authority. And in general, the one thing we should want to avoid is ambiguity. |
We already have one of those: if |
Sure. I can make ghcup set it by default to avoid some of the fallout. |
@hasufell: I'm in favour, regardless of whether it's a good default long term, because here we have a short term emergency and no resources to handle it the way it should be handled (e.g., communicate with all CI, devenv and tool maintainers and test with all passively maintained tools ourselves and fix as needed). |
The PR is now merged and backported. Shall we close the ticket? |
Indeed. Excited to see how it pans out in practice! |
|
Somewhere in #7386 it was brought up that the current backwards compatibility mode, where the mere presence of a
~/.cabal
directory disables the XDG behaviour, is fragile because older tools may accidentally create this directory, which will cause subsequencecabal
invocations to change their behaviour. It was suggested to add another wrinkle:$XDG_CONFIG_HOME/cabal/config
exists, then XDG behaviour is enabled (and this config file used), regardless of whether~/.cabal
(and~/.cabal/config
) exists.The idea here is that it is unlikely for
$XDG_CONFIG_HOME/cabal/config
to be created accidentally, while~/.cabal
can more easily be created accidentally by older tools that are not aware of the XDG behaviour.Opinions? It would not be particularly difficult to implement; just another case in the existing compatibility functions.
The text was updated successfully, but these errors were encountered: