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

Support OpenBSD's tar where possible, require GNU tar for xz support (#2283) #2456

Merged
merged 2 commits into from
Aug 8, 2016

Conversation

Blaisorblade
Copy link
Collaborator

This PR improves the support for OpenBSD's tar as discussed in #2283. For .tar.xz archives that are unsupported there, it will error out and require installing gtar. For other archives it will specify z and j options (on all platforms), hence supporting OpenBSD tar directly (and I assume staying compatible with other ones).

The first commit is already tested by @bonds on OpenBSD, I tested both on OS X, and checked manpages for GNU tar and FreeBSD tar, so this should work there too.

Relevant UNIX man pages:
OpenBSD tar
FreeBSD tar.

Since OpenBSD's tar does not support xz, use only `gtar` there. Stick to
`tar` elsewhere.

The UX is not perfect but it's already useful.
This supports non-GNU tar programs that do not decompress archives
automatically, such as the OpenBSD one.
@bonds
Copy link

bonds commented Aug 8, 2016

I tested the '-j' option on OpenBSD and it worked:

Before (using Version 1.1.2 x86_64 hpack-0.14.0):

~/s/winot (scott|✚3) ❯❯❯ stack setup                Mon Aug  8 11:10:17 PDT 2016
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.                
Running /bin/tar xf /home/scott/.stack/programs/x86_64-openbsd/ghc-7.8.3.tar.bz2 in directory /tmp/stack-setup16733/ exited with ExitFailure 1


tar: input compressed with bzip2; use the -j option to decompress it

Unpacking GHC into /tmp/stack-setup16733/ ...⏎

After (using 0ae5411):

~/s/winot (scott|✚3) ❯❯❯ /home/scott/src/stack/.stack-work/install/x86_64-openbsd/lts-6.0/7.10.3/bin/stack setup
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.                
Did not find executable at specified path: /tmp/stack-setup24687/ghc-7.8.3/configure
Configuring GHC ...⏎

Not sure about the error about not being able to find the executable...I was able to cd into the tmp directory and see all the files in there, so that appears to be a separate issue.

@Blaisorblade
Copy link
Collaborator Author

Blaisorblade commented Aug 8, 2016

Not sure about the error about not being able to find the executable...I was able to cd into the tmp directory and see all the files in there, so that appears to be a separate issue.

I looked at the tarball from https://openbsd.dead-parrot.de/distfiles/ghc-7.8.3.20150623-amd64-unknown-openbsd.tar.bz2; I guess the directory is named /tmp/stack-setup24687/ghc-7.8.3.20150623/ rather than /tmp/stack-setup24687/ghc-7.8.3/? That explains the immediate failure; given #416 I'm sure there are bigger problems anyway. EDIT: I opened commercialhaskell/stackage-content#20 to drop it.

Looking at #416, you should be able to do a stack setup 7.10.3 --reinstall to test the 7.10.3 bindist (also .bz2). You should then be able to remove it (EDIT: if you want) with (careful!) rm -rf ~/.stack/programs/x86_64-osx/ghc-7.10.3* (please double-check). (EDIT2: #416 (comment) reports some small problems with that bindist, so beware).

Blaisorblade added a commit to Blaisorblade/stackage-content that referenced this pull request Aug 8, 2016
@Blaisorblade Blaisorblade merged commit 9d3adac into master Aug 8, 2016
@Blaisorblade Blaisorblade deleted the 2283-openbsd-hack branch August 8, 2016 18:53
@Blaisorblade Blaisorblade self-assigned this Aug 8, 2016
@bonds
Copy link

bonds commented Aug 8, 2016

LGTM:

~ ❯❯❯ stack setup 7.10.3 --reinstall                Mon Aug  8 14:29:12 PDT 2016
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.                 
Running /bin/tar xf /home/scott/.stack/programs/x86_64-openbsd/ghc-7.10.3.tar.bz2 in directory /tmp/stack-setup16994/ exited with ExitFailure 1


tar: input compressed with bzip2; use the -j option to decompress it

Unpacking GHC into /tmp/stack-setup16994/ ...⏎                                  
~ ❯❯❯ /home/scott/src/stack/.stack-work/install/x86_64-openbsd/lts-6.0/7.10.3/bin/stack setup 7.10.3 --reinstall
Run from outside a project, using implicit global project config
Using resolver: lts-6.9 from implicit global project's config file: /home/scott/.stack/global-project/stack.yaml
Populated index cache.    
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.                 
Installed GHC.                              
stack will use a sandboxed GHC it installed
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
~ ❯❯❯                                               Mon Aug  8 14:31:56 PDT 2016

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

Successfully merging this pull request may close these issues.

3 participants