-
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
cabal install --lib <something> creates environment file that does not mention base #8894
Comments
Thanks for the quick response. Are you saying this is intended behaviour? I do understand that env files are evil (creating per-user cabal hell), so |
Yes, |
I would say that neither is evil, both are fine, when used right imho. But we're still figuring out the best UI for using them right. And generally I think the right way is not a global env file, but a local one per "project unit." This is indeed a consequence of the prior PR, and maybe there can be some inbetween. One can also just "install" base after installing another package as well:
One thing to improve the UX might be to always add base, and never warn about it, as a special case? |
seems reasonable - well, in a world where we also "always import Prelude". I find it highly counter-intuitive that some |
I think Anyways, if anything, this shows that we should have some integration tests for this business. |
If we auto-add base with no other changes, then that's not enough. We also need to add it in such a way that it only gets added if it is not already there, and arguably if the env file is fresh. Otherwise we will have the same situation that PR fixed, where amending an existing env file inevitably generated an error. |
@gbaz well, that's the thing: I don't see how it will fail "inevitably". Your PR was motivated by things like When it can brake, I think, is when you upgrade your compiler. In that case, you may end up with two Without I challenge you to find a single example of a language ecosystem with a similar notion of package environment, where the standard library wouldn't be included by default. The closest I know is, perhaps, Agda. But then again: there's so much woes how user unfriendly that is (cf. agda/agda#5725). @jwaldmann my view in a nutshell: (a) env files are fine, (b) |
It was partly motivated by that, but more importantly it was motivated by the fact that even when calling I would argue that aside from the current inconvenience of needing to manually add base if you want it, which can and should be fixed, |
This is not true. I just checked that 3.8 worked fine at least for some combinations of packages (that is, non mutually exclusive ones) E.g.
Well, it's a judgement call and so is hard to argue with. For me, it's barely usable because of two things:
|
Oops, one correction. The issue with adding all the global packages was that e.g. |
With cabal-install-3.10.1.0, after
cabal install --lib <something>
,ghci
no longer loadsPrelude
:Fine, note: no environment file:
Install package:
Start
ghci
again, note: with environment fileWork-Around:
Indeed, the environment file (created by the install) does not mention
base
, while they previously did.This is with
and ghc-9.6.1, also ghc-9.4.4. This is a change in behaviour from cabal-install-3.8.1.0
The text was updated successfully, but these errors were encountered: