haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 691 forks source link

cabal-install-3.0 requires --installdir option which doesn't exist in existing ~/.cabal/configs #5973

Closed phadej closed 4 years ago

phadej commented 5 years ago
% cabal new-install hlint
Resolving dependencies...
Build profile: -w ghc-8.4.4 -O1
In order, the following will be built (use -v for more details):
 - hlint-2.1.15 (lib) (requires build)
 - hlint-2.1.15 (exe:hlint) (requires build)
Starting     hlint-2.1.15 (lib)
Building     hlint-2.1.15 (lib)
Installing   hlint-2.1.15 (lib)
Completed    hlint-2.1.15 (lib)
Starting     hlint-2.1.15 (exe:hlint)
Building     hlint-2.1.15 (exe:hlint)
Installing   hlint-2.1.15 (exe:hlint)
Completed    hlint-2.1.15 (exe:hlint)
cabal: installdir is not defined. Set it in your cabal config file or use
--installdir=<path>
fgaz commented 5 years ago

Did you cabal user-config update?

phadej commented 5 years ago

No, nothing told me to do so.

Sent from my iPhone

On 30 Mar 2019, at 17.55, Francesco Gazzetta notifications@github.com wrote:

Did you cabal user-config update?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mouse07410 commented 5 years ago

Did you cabal user-config update?

No, nothing told me to do so.

Worse than that - there's no mentioning of the config parameter installdir in the Cabal documentation. The only way to (presumably) add it correctly is to run the above command.

drewboardman commented 4 years ago

I just experienced the same issue, and ran cabal user-config update. This created a backup of the 2.4.1 config and replaced it with a 3.0.0 config. If someone could explain how to set the --installdir correctly - I wouldn't mind submitting a PR to update the documentation.

sprajagopal commented 4 years ago

Had the same issue with ghc 8.6.5 and cabal -3.1.0. After searching a while, I found this issue.

drewboardman commented 4 years ago

Had the same issue with ghc 8.6.5 and cabal -3.1.0. After searching a while, I found this issue.

Are you on Arch by any chance? And did you edit your ~/.cabal/config file based on that arch wiki? I updated the wiki yesterday with more info.

ulysses4ever commented 4 years ago

I have the very same confusing behavior with cabal-install 3.0.1 and GHC 8.8.2. It would be nice to fix it somehow (e.g. initialize installdir without explicit cabal user-config update).

tomsmeding commented 4 years ago

Alternatively, it could be nice if cabal at least informs the user that cabal user-config update might be in order. Currently, the only way I know of getting this information is this issue, which is a bit scarce...

szabi commented 4 years ago

I ran into the same issue today on cabal 3.2.0.0, and like cabal user-config update fixed it, but just like with @phadej one year ago,

No, nothing told me to do so.

Like obviously several people before me (I'm counting four more).

Phadej's fix was merged after the latest current release.

=> Would a 3.0.0.1 release not be in order to roll out this fix for an issue which people seem to run into quite frequently?

zhangysh1995 commented 4 years ago

I ran into this issue today and found that I need to run the command again and again if I leave this bash session and come back.

My scenario is that I used the system /usr/bin/cabal to upgrade to the newest version, and use the local ~/.cabal/bin/cabal as the binary.