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

fails to unpack a ghc bindist properly #49

Closed
hasufell opened this issue Feb 21, 2020 · 1 comment
Closed

fails to unpack a ghc bindist properly #49

hasufell opened this issue Feb 21, 2020 · 1 comment

Comments

@hasufell
Copy link
Member

hasufell commented Feb 21, 2020

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

@hasufell
Copy link
Member Author

It seems ././@LongLink is not handled correctly: https://stackoverflow.com/questions/2078778/what-exactly-is-the-gnu-tar-longlink-trick

hasufell added a commit to hasufell/tar-bytestring that referenced this issue Feb 21, 2020
hasufell added a commit to hasufell/tar-bytestring that referenced this issue Feb 21, 2020
hasufell added a commit to hasufell/tar-bytestring that referenced this issue Apr 1, 2021
hasufell added a commit to hasufell/tar-bytestring that referenced this issue Apr 7, 2021
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 a pull request may close this issue.

1 participant