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

default value of symlink-bindir elicits warning when installing executable #5408

Closed
pete- opened this issue Jun 28, 2018 · 2 comments
Closed

Comments

@pete-
Copy link

pete- commented Jun 28, 2018

I haven't tweaked ~/.cabal/config at all, and whenever I use cabal to install an executable, it gives the following message at the end:

Warning: could not create a symlink in /home/me/.cabal/bin for hlint because the file exists there already but is not managed by cabal. You can create a symlink for this executable manually if you wish. The executable file has been installed at /home/me/.cabal/bin/hlint

If I remove the installed executable and then immediately rebuild, it gives the same error (to demonstrate that there really was no file there before cabal tried to do its thing):

$ ls ~/.cabal/bin/hlint
/home/me/.cabal/bin/hlint
$ rm ~/.cabal/bin/hlint
$ cabal install --reinstall hlint
Resolving dependencies...
In order, the following will be installed:
hlint-2.1.6 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring hlint-2.1.6...
Building hlint-2.1.6...
Installed hlint-2.1.6
Warning: could not create a symlink in /home/me/.cabal/bin for hlint because
the file exists there already but is not managed by cabal. You can create a
symlink for this executable manually if you wish. The executable file has been
installed at /home/me/.cabal/bin/hlint

When I remove ~/.cabal/config and then run, eg, cabal update, a new config is created with the following line:

symlink-bindir: ~/.cabal/bin

If I comment that line out, installing executables works without warning.

(Note that if X depends on an executable and the executable results in this warning, then installation of X will fail. Re-running "cabal install X" will work, however.)

@fgaz
Copy link
Member

fgaz commented Jul 1, 2018

Apparently I was wrong here: #5188 (comment).

Context: since new-install, like all new-* commands, installs packages in the immutable nix-style store, we symlink the resulting binaries to ~/cabal/bin (kinda like nix does). To control the symlink location, I used the symlink-bindir flag and set it to ~/.cabal/bin by default, thinking it had no effect on v1-install. Well, it does. And it is now set to the same directory as v1-install's bindir, resulting in that conflict.

@Mikolaj
Copy link
Member

Mikolaj commented Jul 14, 2022

I'm taking the liberty of closing this ticket due to its age and inactivity. Please open a new one if/when you are able to reproduce with an up to date cabal (assuming you are still using the v1- cabal API). Thank you for the report!

@Mikolaj Mikolaj closed this as completed Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants