1
votes

I have a cabal-sandboxed Haskell project on a server. If I do this on the server it installs in the sandbox:

 cd project && cabal install
 # installs in .cabal-sandbox/bin

But if I do this from my laptop, it installs into the global ~/.cabal/bin

 ssh my@server "cd project && cabal install"
 # installs in $HOME/.cabal/bin

How can I get the sandboxing behavior to work with commands issued over SSH?

1
Which shell is SSH using? Is the path different? Is the SSH shell invoking an old Cabal-install binary that is unaware of cabal sandboxes? - Thomas M. DuBuisson
ssh ... 'echo $SHELL' says /bin/bash - dan
You're right! It's the PATH - dan
But even using the right cabal doesn't fix the problem. - dan
OK I think I figured it out. Thanks - dan

1 Answers

1
votes

The solution was to fix the PATH in the ssh command:

ssh my@server 'export PATH=/home/me/.cabal/bin:$PATH && cd project && cabal install'