Skip to content

fails to unpack a ghc bindist properly #49

Closed

Description

@hasufell

Unpacking a ghc bindist with tar is broken.

  1. extract/unpack does not preserve executable files #25 will cause make to fail, because various files are missing executable bit
  2. It screws up some files (including their filepaths). Running configure and make (after fixing exec bits) results in
ghc-cabal: Error: Could not find module:
Data.ByteString.Builder.Prim.Internal.UncheckedShifts with any suffix: ["hi"]
in the search path: ["dist-install/build"]
ghc.mk:985: recipe for target 'install_packages' failed
make[1]: *** [install_packages] Error 1
Makefile:51: recipe for target 'install' failed
make: *** [install] Error 2

And indeed, searching for UncheckedShifts results in odd output (yes, the filename is truncated):

$ find . -type f -iname '*unchecked*'
./libraries/bytestring/dist-install/build/Data/ByteString/Builder/Prim/Internal/UncheckedShi

Searching a healthy unpacked dir (unpacked with cli tar) results in:

$ find . -type f -iname '*unchecked*'
./libraries/bytestring/dist-install/doc/html/bytestring/src/Data-ByteString-Builder-Prim-Internal-UncheckedShifts.html
./libraries/bytestring/dist-install/build/Data/ByteString/Builder/Prim/Internal/UncheckedShifts.hi
./libraries/bytestring/dist-install/build/Data/ByteString/Builder/Prim/Internal/UncheckedShifts.dyn_hi
./libraries/bytestring/dist-install/build/Data/ByteString/Builder/Prim/Internal/UncheckedShifts.p_hi

I couldn't reproduce it with a single overly long path. So I'm not sure this is a problem with path length. I suspect there is some really dangerous memory bug here.

Edit: I could reproduce it with a single file: https://github.com/hasufell/tar-bug/releases/download/0.1.1/ghc-8.6.5.tar

Activity

  1. added 2 commits that reference this issue on Feb 21, 2020
    7f87a34
    452f667
  2. added 2 commits that reference this issue on Apr 1, 2021
    475c2cb
    4b0a9a4
  3. added 8 commits that reference this issue on Nov 15, 2023
    f042167
    c2af596
    cb6d4ef
    4efbfbc
    6456cf3
    e6b171f
    aff9134
    d35c6bb
  4. added a commit that references this issue on Jul 17, 2024
    d07e937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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