Cabal: "createSymbolicLink: does not exist" when --bindir

Created on 29 Mar 2018  路  11Comments  路  Source: haskell/cabal

Building cabal-install 2.2.0.0 with itself:

+ cabal --version
cabal-install version 2.2.0.0
compiled using version 2.2.0.1 of the Cabal library
+ cabal install --bindir=/.../ cabal-install
...
Building cabal-install-2.2.0.0...
Installed cabal-install-2.2.0.0
/home/iuser/.cabal/bin/cabal: createSymbolicLink: does not exist (No such file or directory)

cminstall bug

All 11 comments

I get the error when trying to install globally (via user install: False in .cabal/config):

root$ echo "user-install: False" >> /root/.cabal/config && cabal install idris-1.3.2
Resolving dependencies...
...
Downloaded   cheapskate-0.1.1.2
Starting     cheapskate-0.1.1.2
Building     cheapskate-0.1.1.2
Completed    cheapskate-0.1.1.2
Completed    vector-0.12.1.2
Downloading  vector-binary-instances-0.2.5.1
Downloading  aeson-1.4.7.1
Downloaded   vector-binary-instances-0.2.5.1
Starting     vector-binary-instances-0.2.5.1
Downloaded   aeson-1.4.7.1
Starting     aeson-1.4.7.1
Building     vector-binary-instances-0.2.5.1
Building     aeson-1.4.7.1
Completed    vector-binary-instances-0.2.5.1
Completed    aeson-1.4.7.1
Downloading  idris-1.3.2
Downloaded   idris-1.3.2
Starting     idris-1.3.2
Building     idris-1.3.2
Completed    idris-1.3.2
/root/.cabal/bin/cheapskate: createSymbolicLink: does not exist (No such file or directory)

I also tried by using the --bindir directly, which also results in a createSymbolicLink error.

@dgellow does /root/.cabal/bin exist? And what cabal-install version you use

Hmm. The directory /root/.cabal/bin doesn't exist, but if I use --bindir to target another location, should it still be necessary? That sounds a bit counter intuitive.

Regarding the version:

root$ cabal --version
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library

I'm doing this in a docker container haskell:8.6.

The issue can be reproduced quite easily by building the following Dockerfile:

FROM haskell:8.6

RUN cabal update && cabal install --bindir=/usr/local/ cheapskate

To build it:

$ docker build -t myimage .

Which fails with:

/root/.cabal/bin/cheapskate: createSymbolicLink: does not exist (No such file or directory)

@phadej Thanks for your hint regarding .cabal/bin directory! The following seems to work:

root$ cabal update
root$ mkdir -p /root/.cabal/bin
root$ cabal install --bindir=/usr/local/ <the package to install>

What version of cabal that docker image has? I cannot reproduce with cabal-install-3.2.

This also appears to occurr with --prefix on cabal-install 2.4.0.0, reproducible using the example above as a basis, built with cabal library 2.4.0.1

@ebeasant-arm Could you also try with cabal 3.2?

Will do, building it now.

I would rather try https://mail.haskell.org/pipermail/cabal-devel/2020-September/010486.html cabal-install-3.4.0.0-rc2

I don't think we will look into 3.2 at this point.

(Edited: corrected information) 3.2 rechecking as appears to be similar result, but need to check its not picking up the old path. Rechecking with new-install as well.

Was this page helpful?
0 / 5 - 0 ratings