Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to install tarballs with '~' in the path #29

Open
cheecheeo opened this issue Jul 12, 2012 · 2 comments
Open

Unable to install tarballs with '~' in the path #29

cheecheeo opened this issue Jul 12, 2012 · 2 comments

Comments

@cheecheeo
Copy link

In revision f14cddf I'm unable to create an environment with the home directory shortcut ('~'):

$ /.cabal/bin/hsenv --ghc=/packages/ghc-7.5.20120711-x86_64-unknown-linux.tar.bz2
Creating Virtual Haskell directory structure
Installing GHC
Installing GHC from ~/packages/ghc-7.5.20120711-x86_64-unknown-linux.tar.bz2
/bin/tar process failed with status 2

hsenv.log file contains detailed description of the process.

$ cat hsenv.log
Creating Virtual Haskell directory structure
hsenv directory: /data/home/chee1/breakghc/.hsenv_breakghc
cabal directory: /data/home/chee1/breakghc/.hsenv_breakghc/cabal
hsenv bin directory: /data/home/chee1/breakghc/.hsenv_breakghc/bin
Installing GHC
Installing GHC from ~/packages/ghc-7.5.20120711-x86_64-unknown-linux.tar.bz2
Unpacking GHC tarball to /data/home/chee1/breakghc/ghc31404
Running outside process: tar xf ~/packages/ghc-7.5.20120711-x86_64-unknown-linux.tar.bz2 -C /data/home/chee1/breakghc/ghc31404 --strip-components 1
Looking for tar in $PATH
tar -> /bin/tar
Process failed with exit code 2
Empty process output
Process error output:
/bin/tar: ~/packages/ghc-7.5.20120711-x86_64-unknown-linux.tar.bz2: Cannot open: No such file or directory
/bin/tar: Error is not recoverable: exiting now

/bin/tar process failed with status 2

$ rm -rf .hsenv_breakghc/

$ /.cabal/bin/hsenv --ghc=/home/chee1/packages/ghc-7.5.20120711-x86_64-unknown-linux.tar.bz2
Creating Virtual Haskell directory structure
Installing GHC
Installing GHC from /home/chee1/packages/ghc-7.5.20120711-x86_64-unknown-linux.tar.bz2
Initializing GHC Package database at /data/home/chee1/breakghc/.hsenv_breakghc/ghc_pkg_db
Copying necessary packages from original GHC package database
Using user-wide (
/.cabal/packages) Hackage download cache directory
Installing cabal config at /data/home/chee1/breakghc/.hsenv_breakghc/cabal/config
Installing activate script
Installing cabal wrapper using /data/home/chee1/breakghc/.hsenv_breakghc/cabal/config at /data/home/chee1/breakghc/.hsenv_breakghc/bin/cabal
Skipping 'cabal update' step, Hackage download cache already downloaded
to ~/.cabal/packages/. You can update it manually with 'cabal update'
(from inside or outside the virtual environment).

To activate the new environment use 'source .hsenv_breakghc/bin/activate'

I'm guessing that there is a missing environment variable, maybe $HOME missing.

@Paczesiowa
Copy link
Owner

techically, there's no error. '' is not a valid path - it often works, because your shell (bash at least) expands it to your home directory path, before passing it as an argument to a program, but the expansion only happens if it's the first character of a token, e.g. "echo ~ --ghc=" will print something like "/home/paczesiowa --ghc=~". I'm sceptical to writing a hack that will look for ~ at the beginning of a path and expand it - I don't think any other unix tool does it.

different solution would be to allow both "--ghc=PATH" and "--ghc PATH", what do you think about it?

@cheecheeo
Copy link
Author

I think allowing both "--ghc=PATH" and "--ghc PATH" is a good idea.

Better error reporting for unknowing users like me would also be helpful, maybe like the ghc configure script uses:

$ ./configure --prefix=~/blahblahblah
configure: error: expected an absolute directory name for --prefix: ~/blahblahblah

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

No branches or pull requests

2 participants