stack install ghc-core fails because it mishandles special tar entries #2361
Comments
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 |
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
stack install ghc-core
fails, butstack build
aftercabal unpack ghc-core
succeeds. Apparently it fails while trying to usesetFileMode
on filepax_global_header
.TL;DR.
ghc-core
's tarball contains an entrypax_global_header
which does not represent a file, andstack
incorrectly assumes all entries are files, sostack
fails unpacking. It turns out thatstack unpack ghc-core
fails whilecabal unpack ghc-core
works. Such entries are valid, andgit-archive
creates them.Investigation shows that
pax_global_header
is a special tar entry contains extra attributes; newertar
versions special-case it, older ones don't (see e.g. backdrop-ops/contrib#55 (comment))pax_global_header
entry (confirmed e.g. throughgzcat ghc-core-0.5.6.tar.gz| strings |grep pax_global_header
, or withzcat
on Linux).stack
calls setFileMode on each entry in the tar file, without checking if they're real entries or not:https://github.com/commercialhaskell/stack/blob/master/src/Stack/Fetch.hs#L524-L532
tar
package itself seems to mark these entries as with EntryContent = OtherEntryType ..., with specific type codes, see e.g.haskell/tar@6c0acf8.
stack
should ignore the same entries — I'm just not sure how to do that without duplicating too much knowledge about the format from the Tar package. Looking atunpack
(https://github.com/haskell/tar/blob/4557fdeab9363fcce16ed0be1f41eda022ba7c55/Codec/Archive/Tar/Unpack.hs#L77-L82), we might want to filter for entries of "type" (EntryContent
) beingNormalFile
,Directory
,HardLink
,SymbolicLink
.Failing invocation:
Working:
(At this point,(EDIT: Given my setup that's not surprising).stack install ghc-core
seems to work in cases where it failed before in the same snapshot, but I haven't investigated).The text was updated successfully, but these errors were encountered: