Skip to content
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-3.0 requires --installdir option which doesn't exist in existing ~/.cabal/configs #5973

Closed
phadej opened this issue Mar 28, 2019 · 10 comments · Fixed by #6624
Closed

Comments

@phadej
Copy link
Collaborator

phadej commented Mar 28, 2019

% 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>
  • it fails only at the end
  • why it cannot use default if it's not specified?
@fgaz
Copy link
Member

fgaz commented Mar 30, 2019

Did you cabal user-config update?

@phadej
Copy link
Collaborator Author

phadej commented Mar 30, 2019 via email

@mouse07410
Copy link
Collaborator

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
Copy link

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
Copy link

sprajagopal commented Feb 3, 2020

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

@drewboardman
Copy link

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
Copy link
Collaborator

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
Copy link
Collaborator

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...

@m-renaud m-renaud self-assigned this Mar 29, 2020
m-renaud added a commit to m-renaud/cabal that referenced this issue Apr 2, 2020
This change updates the `cabal install` command to use the default install
directory for executables if one was not specified in either Cabal's config file
or on the command line with the --installdir flag.

Previously this would error out, now it warns that it used the default and
continues.

PR haskell#6624, resolves haskell#5973.
@szabi
Copy link

szabi commented May 19, 2020

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
Copy link

zhangysh1995 commented May 27, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants