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 install ghc-core fails because it mishandles special tar entries #2361

Closed
Blaisorblade opened this issue Jul 10, 2016 · 1 comment
Closed

Comments

@Blaisorblade
Copy link
Collaborator

@Blaisorblade Blaisorblade commented Jul 10, 2016

stack install ghc-core fails, but stack build after cabal unpack ghc-core succeeds. Apparently it fails while trying to use setFileMode on file pax_global_header.
TL;DR. ghc-core's tarball contains an entry pax_global_header which does not represent a file, and stack incorrectly assumes all entries are files, so stack fails unpacking. It turns out that stack unpack ghc-core fails while cabal unpack ghc-core works. Such entries are valid, and git-archive creates them.

Investigation shows that

Failing invocation:

$ stack install ghc-core
Run from outside a project, using implicit global project config
Using resolver: lts-6.6 from implicit global project's config file: /Users/pgiarrusso/.stack/global/stack.yaml
/private/var/folders/_7/hlxv4yv95x95vgnn416b4q4m0000gp/T/stack96236/pax_global_header: setFileMode: does not exist (No such file or directory)

Working:

$ cabal unpack ghc-core
Downloading ghc-core-0.5.6...
Unpacking to ghc-core-0.5.6/
# Standard setup (omitted)
$ stack build
ghc-core-0.5.6: configure
Configuring ghc-core-0.5.6...
ghc-core-0.5.6: build
Preprocessing executable 'ghc-core' for ghc-core-0.5.6...
[1 of 1] Compiling Main             ( ghc-core.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/ghc-core/ghc-core-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/ghc-core/ghc-core ...
ghc-core-0.5.6: copy/register
Installing executable(s) in
/Users/pgiarrusso/AeroFS/Mine/Sorgenti-Sync/Haskell/Stack-GHC-7.8.4/.stack-work/install/x86_64-osx/lts-0.7/7.8.4/bin

(At this point, stack install ghc-core seems to work in cases where it failed before in the same snapshot, but I haven't investigated). (EDIT: Given my setup that's not surprising).

@Blaisorblade
Copy link
Collaborator Author

@Blaisorblade Blaisorblade commented Jul 10, 2016

I'm writing a patch.

I just investigated the set of possible entry types, according to the POSIX standard (http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_02), and there are no surprises. The only uses of OtherEntryType defined there use typecode g and x, that are represented as OtherEntryType 'g' and OtherEntryType 'x'; no other values are possible.

Blaisorblade added a commit to Blaisorblade/stack that referenced this issue Jul 10, 2016
Stop trying to reset permissions on pax header entries.
XXX incomplete.
Blaisorblade added a commit to Blaisorblade/stack that referenced this issue Jul 10, 2016
Stop trying to reset permissions on pax header entries.
XXX incomplete.
Blaisorblade added a commit to Blaisorblade/stack that referenced this issue Jul 17, 2016
* Stop trying to reset permissions on pax header entries.
* Add changelog entry.
* Output warnings for unexpected entries.

The interface of untar is designed for unit testing.
Blaisorblade added a commit to Blaisorblade/stack that referenced this issue Jul 17, 2016
* Stop trying to reset permissions on pax header entries.
* Add changelog entry.
* Output warnings for unexpected entries.

The interface of untar is designed for unit testing.
Blaisorblade added a commit to Blaisorblade/stack that referenced this issue Jul 19, 2016
* Stop trying to reset permissions on pax header entries.
* Add changelog entry.
* Output warnings for unexpected entries.
* Add testcases.

The interface of untar is designed for unit testing.
Blaisorblade added a commit to Blaisorblade/stack that referenced this issue Jul 19, 2016
* Stop trying to reset permissions on pax header entries.
* Add changelog entry.
* Output warnings for unexpected entries.
* Add testcases.

The interface of untar is designed for unit testing.
Blaisorblade added a commit to Blaisorblade/stack that referenced this issue Jul 19, 2016
* Stop trying to reset permissions on pax header entries.
* Add changelog entry.
* Output warnings for unexpected entries.
* Add testcases.

The interface of untar is designed for unit testing.
mgsloan added a commit that referenced this issue Jul 20, 2016
…ries

stack unpack: Ignore pax headers (fix #2361)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant