Repository navigation
Closed
Description
General summary/comments (optional)
I was trying to use an intermediate commit of Stack as a dependency in a stack2nix branch adding compatibility with the upcoming version but failed doing so
Steps to reproduce
- Add the following into
stack.yaml:
extra-deps:
- cabal2nix-2.14.1
- github: commercialhaskell/stack
commit: 7a076ab3a79abfe9a65410891b42938825feb96e
subdirs:
- http-download
- pantry
- rio-prettyprint
- .
- Run command
stack build.
Expected
Stack checks out Stack sources and builds project.
Actual
Build fails with
$ stack build
Archive extraction failed. Tarballs and zip archives are supported, couldn't handle the following URL, https://github.com/commercialhaskell/stack/archive/7a076ab3a79abfe9a65410891b42938825feb96e.tar.gz downloaded to the file xclccHWY2xDl.http-archive
It looks like Stack doesn't deal with symlinks in Stack's repo as I see the following in verbose log:
2019-02-11 15:02:40.407947: [debug] Trying to ungzip/untar /home/qrilka/ws/iohk/stack2nix/.stack-work/downloaded/xclccHWY2xDl.http-archive
2019-02-11 15:02:40.414226: [debug] Got exception: Invalid file name in tar archive: "../CONTRIBUTING.md"
2019-02-11 15:02:40.414282: [debug] Trying to unzip /home/qrilka/ws/iohk/stack2nix/.stack-work/downloaded/xclccHWY2xDl.http-archive
2019-02-11 15:02:40.414339: [debug] Got exception: Data.Binary.Get.runGet at position 4: Did not find end of central directory signature
CallStack (from HasCallStack):
error, called at libraries/binary/src/Data/Binary/Get.hs:351:5 in binary-0.8.6.0:Data.Binary.Get
2019-02-11 15:02:40.414395: [debug] Trying to untar (no ungzip) /home/qrilka/ws/iohk/stack2nix/.stack-work/downloaded/xclccHWY2xDl.http-archive
2019-02-11 15:02:40.414435: [debug] Got exception: NotTarFormat
Archive extraction failed. Tarballs and zip archives are supported, couldn't handle the following URL, https://github.com/commercialhaskell/stack/archive/7a076ab3a79abfe9a65410891b42938825feb96e.tar.gz downloaded to the file xclccHWY2xDl.http-archive
Stack version
$ stack --numeric-version
1.9.3
Method of installation
gentoo-haskell
Metadata
Metadata
Assignees
Labels
No labels
Activity
lehins commentedon Feb 11, 2019
This is a problem in tar package. This tarball contains symbolic link
doc/CONTRIBUTING.mdthat points to a top levelCONTRIBUTING.mdusing a relative path, hence is the error:The solution I suggest is to use tar-conduit. It has a function
extractTarballLenient, which is similar in functionality toextractfromtarpackage, but does not have that problem.dbaynard commentedon Feb 11, 2019
I think this is a superset of #4579.
snoyberg commentedon Mar 26, 2019
Can this be closed now that #4581 is merged?
qrilka commentedon Mar 26, 2019
The starting problem wasn't quite about submodules and probably wasn't appearing with the version from
masterat all, I've checked that project and it builds fine withmaster.saurabhnanda commentedon Jun 17, 2019
Ran into a similar issue at iconnect/regex#169 -- could that be related to the current issue?
qrilka commentedon Jun 17, 2019
@lehins didn't we convert to
tar-conduitalready in 2.1? If so is a symlinksrc -> .valid fortar-conduit?qrilka commentedon Jun 17, 2019
@saurabhnanda it looks like thing coming from Pantry itself, could you create a ticket for a proper investigation?