You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sandbox-config's package-db path contains hardcoded GHC version #1935
which makes it harder to share the same cabal.sandbox.config for multiple GHC versions.
How is that a problem? cabal.sandbox.config is updated when you run cabal configure -w /path/to/ghc. To install dependencies, run cabal install -w /path/to/ghc --only-dependencies - it will also use the correct package DB.
This is even more disturbing then if the cabal.sandbox.config file is rewritten each time a different ghc is picked up by cabal. Doesn't that cause problems when I run multiple cabal commands for different ghc versions in parallel?
PS: cabal sandbox hc-pkg get's tripped up quite easily:
$ PATH=/opt/ghc/7.0.4/bin:$PATH cabal sandbox hc-pkg list --verbose
Using a sandbox located at /tmp/sb/.cabal-sandbox
/opt/ghc/7.0.4/bin/ghc-pkg --global --no-user-package-conf --package-conf=/tmp/sb/.cabal-sandbox/x86_64-linux-ghc-7.8.2-packages.conf.d list
ghc-pkg: too few bytes. Failed reading at byte position 1488
cabal sandbox hc-pkg get's tripped up quite easily
Isn't this fixed in HEAD? hc-pkg should use the compiler the project was configured with.
Doesn't that cause problems when I run multiple cabal commands for different ghc versions in parallel?
That's not supported even when not taking sandboxes into account. E.g. if you try to run cabal build for two different compilers in the same directory, they will write over each other's temporary files and dist/setup-config. I recommend using two separate checkouts if you want to do that.
Isn't this fixed in HEAD? hc-pkg should use the compiler the project was configured with.
Maybe that's the point, I don't regard the sandbox as associated with a package, I actually create a sandbox just as way to have an isolated environment separate from ${HOME].cabal/+${HOME}/.ghc. And then I start installing packages into that via cabal install <package-id|package-folder> as if I was operating against my "user global" ~/.cabal environment. Sometimes I place symlinks into several folders pointing to a common cabal.sandbox.config (and I wonder how that interacts with the config-rewriting).
However, I tried with HEAD, and it behaved the same wrt hc-pkg as shown above.
That's not supported even when not taking sandboxes into account. E.g. if you try to run cabal build for two different compilers in the same directory, they will write over each other's temporary files and dist/setup-config. I recommend using two separate checkouts if you want to do that.
Fwiw, I do that currently anyway exactly due to the dist/-issue you describe, however the $HOME/.cabal/ folder is shared (and configured in such a way that different compilers are isolated from each other). I'm just saying that the sandboxed .cabal
Activity
23Skidoo commentedon Jun 10, 2014
How is that a problem?
cabal.sandbox.configis updated when you runcabal configure -w /path/to/ghc. To install dependencies, runcabal install -w /path/to/ghc --only-dependencies- it will also use the correct package DB.hvr commentedon Jun 10, 2014
This is even more disturbing then if the
cabal.sandbox.configfile is rewritten each time a differentghcis picked up bycabal. Doesn't that cause problems when I run multiplecabalcommands for different ghc versions in parallel?hvr commentedon Jun 10, 2014
PS:
cabal sandbox hc-pkgget's tripped up quite easily:23Skidoo commentedon Jun 10, 2014
Isn't this fixed in HEAD?
hc-pkgshould use the compiler the project was configured with.That's not supported even when not taking sandboxes into account. E.g. if you try to run
cabal buildfor two different compilers in the same directory, they will write over each other's temporary files anddist/setup-config. I recommend using two separate checkouts if you want to do that.hvr commentedon Jun 10, 2014
Maybe that's the point, I don't regard the sandbox as associated with a package, I actually create a sandbox just as way to have an isolated environment separate from
${HOME].cabal/+${HOME}/.ghc. And then I start installing packages into that viacabal install <package-id|package-folder>as if I was operating against my "user global"~/.cabalenvironment. Sometimes I place symlinks into several folders pointing to a commoncabal.sandbox.config(and I wonder how that interacts with the config-rewriting).However, I tried with HEAD, and it behaved the same wrt
hc-pkgas shown above.Fwiw, I do that currently anyway exactly due to the
dist/-issue you describe, however the$HOME/.cabal/folder is shared (and configured in such a way that different compilers are isolated from each other). I'm just saying that the sandboxed.cabal23Skidoo commentedon Jun 10, 2014
You can also use
cabal sandbox init --sandbox /path/to/shared-sandbox.OK, I'll investigate.
Then I think it will work (sort of) with sandboxes as long as you don't mind that
.ofiles andsetup-configare overwritten.adamgundry commentedon Oct 10, 2015
I'm working on this at the London infrastructure hackathon.
Use configured compiler for cabal sandbox hc-pkg