stack on master seems to be having trouble locating a symlink target that definitely does exist.
colin@yumi ~/c/h/chainweb> stack test
Cloning 37ad6ebb25c975c3c0ab9d5554cd5fb6d4809da8 from https://github.com/kadena-io/pact.git
Unsupported tarball from /tmp/with-repo-archive16624/foo.tar: Symbolic link dest not found from docs/en/img to ../img, looking for docs/img.
docs/img/ does exist (it's a directory).
For example:
stack buildThe pinned dependency on Pact is pulled and built.
stack fails somewhere between pulling and building.
Version 2.0.0, Git revision dfbf85ad7e8af5b01cf7b51367290870ffc2c90e x86_64 hpack-0.31.1
A very recent stack upgrade --git.
Looks like when a symlink resolves to a directory, the getFiles call doesn't see it. Here are the keys of the files :: Map FilePath MetaEntry value in that function:
...
"docs/en/pact-reference.md"
"docs/en/pact-reference.rst"
"docs/en/pacts.md"
"docs/img/kadena-logo-100px.png"
"docs/img/kadena-logo-210px.png"
"docs/img/kadena-logo-trans.gif"
"docs/ja/conf.py"
"docs/ja/img"
"docs/ja/index.rst"
"docs/ja/pact-reference.md"
...
Notice that it only has listings for the files inside the directory in question.
The issue seems to be that symlinks are always counted as "files", even when the things they're pointing to are not.
Note also the call to normalizeParents, and the following in its documentation:
-- * May not point to directories
For now I've hacked around the problem by just dumping anything that resulted in Left in toSimple. This is clearly incorrect, but unblocks me for the time being.
I tried to think of a real solution, but being an outsider, I wasn't sure of the implications of say:
foldArchive yield raw directory names as welltoSimple live in IO so that I could do a doesDirectoryExist (it's unclear what dir we're even in, so how would testing the relative symlink make any sense?)getFiles ahead of time, to exclude any symlinks that point to directoriesHopefully this is enough for a real stack dev to write the right solution :+1:
Thanks for all this digging you've done.
This is a good find, thank you! I'll need to look at the code again before coming up with any ideas.
See #4793
Thanks for the fix.