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

--installdir option for valid directory leads to "does not exist" error #6526

Closed
Daedalus359 opened this issue Feb 4, 2020 · 3 comments
Closed

Comments

@Daedalus359
Copy link

Daedalus359 commented Feb 4, 2020

I am trying to update my cabal-install to the latest version. I am attempting to use the v2-install command for this purpose. The default command complains that installdir is not defined:

$ ~/.cabal/bin/cabal v2-install cabal-install
Resolving dependencies...
Up to date
cabal: installdir is not defined. Set it in your cabal config file or use
--installdir=<path>

However, when I attempt to specify an install directory as recommended, this is the result:

$ ~/.cabal/bin/cabal v2-install cabal-install --installdir=~/.cabal/bin
Resolving dependencies...
Up to date
~/.cabal/bin: createDirectory: does not exist (No such file or directory)

I also tried writing out the path as /home/kevin/.cabal/bin. Same result.

As you can see from the particular cabal binary I use to run these commands, ~/.cabal/bin does exist on my computer. Does anyone know why this is happening, or am I using the command incorrectly? It may be up to date already, but this still seems like the wrong behavior.

System information

  • Ubuntu 18.04
  • Cabal version 3.0.0.0
  • GHC 8.0.2
@phadej
Copy link
Collaborator

phadej commented Feb 4, 2020

Compare,

% ls '~/.vim'
ls: cannot access '~/.vim': No such file or directory
% ls ~/.vim  
autoload  bundle  ftdetect  snippets  syntax

Don't put the equals sign between --installdir and the path, so the shell will expand the ~ for you, or use --installdir=$HOME/.cabal/bin.

@phadej phadej closed this as completed Feb 4, 2020
@Daedalus359
Copy link
Author

Thanks for that - it worked. On the relevant docs page, an example usage is given:

 cabal v2-install exe:cabal --install-method=copy --installdir=~/bin

Why would something like that work? It seems to do the same thing that was wrong in my case (equals sign and ~ in the path).

@phadej
Copy link
Collaborator

phadej commented Feb 4, 2020

That's a mistake in a docs, thanks for pointing out. I'll fix that as I work on #6519

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

No branches or pull requests

2 participants