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

Stack setup fails with busybox tar #2146

Closed
kfigiela opened this issue May 16, 2016 · 2 comments
Closed

Stack setup fails with busybox tar #2146

kfigiela opened this issue May 16, 2016 · 2 comments

Comments

@kfigiela
Copy link

kfigiela commented May 16, 2016

stack setup relies on compression autodetection feature of tar. However, some versions of tar (i.e. that one shipped with busybox or Alpine Linux) don't autodetect compressed archives, so that Stack fails.

Steps to reproduce
Use GHC + Alpine Linux docker image (https://github.com/mitchty/alpine-ghc)

$ docker run --rm -it mitchty/alpine-ghc 
# apk update && apk add xz make # stack asks to install them
# stack setup --resolver ghc-7.10.2`

Expected behavior: Stack installs GHC
Actual behavior: Stack fails to extract GHC source archive, as existing tar implementation doesn't autodetect compression. Installing GNU tar (apk add tar) solves is a workaround.

# stack setup --resolver ghc-7.10.2
Run from outside a project, using implicit global project config
Using resolver: ghc-7.10.2 specified on command line
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.
Running /bin/tar xf /root/.stack/programs/x86_64-linux/ghc-7.10.2.tar.xz in directory /tmp/stack-setup29074/ exited with ExitFailure 1


tar: invalid tar magic

Unpacking GHC into /tmp/stack-setup29074/ ...
@mgsloan
Copy link
Contributor

mgsloan commented May 16, 2016

Pinging @borsboom , thoughts on what should be done about this? A few options:

  • On failure, retry tar with a guessed format specific arg. So, it'd see .tar.xz in the URL and guess to use the -J flag.
  • Detect these tar versions and install a newer one.
  • Detect these tar versions and fail with an error about it.

@mgsloan mgsloan added this to the P3: Optional milestone May 16, 2016
@mgsloan
Copy link
Contributor

mgsloan commented Aug 8, 2016

@kfigiela This should now be addressed by 0ae5411 , let me know if not

@mgsloan mgsloan closed this as completed Aug 8, 2016
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

2 participants