Skip to content

stack install ghc-core fails because it mishandles special tar entries #2361

Closed
@Blaisorblade

Description

@Blaisorblade

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions