You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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:
making foldArchive yield raw directory names as well
having toSimple 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?)
filtering out the results of getFiles ahead of time, to exclude any symlinks that point to directories
Hopefully this is enough for a real stack dev to write the right solution 👍
Activity
fosskers commentedon Apr 25, 2019
The message comes from:
stack/subs/pantry/src/Pantry/Archive.hs
Line 397 in dfbf85a
fosskers commentedon Apr 25, 2019
Looks like when a symlink resolves to a directory, the
getFilescall doesn't see it. Here are the keys of thefiles :: Map FilePath MetaEntryvalue in that function: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.
fosskers commentedon Apr 25, 2019
Note also the call to
normalizeParents, and the following in its documentation:fosskers commentedon Apr 25, 2019
For now I've hacked around the problem by just dumping anything that resulted in
LeftintoSimple. 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:
foldArchiveyield raw directory names as welltoSimplelive inIOso that I could do adoesDirectoryExist(it's unclear what dir we're even in, so how would testing the relative symlink make any sense?)getFilesahead of time, to exclude any symlinks that point to directoriesHopefully this is enough for a real stack dev to write the right solution 👍
mihaimaruseac commentedon Apr 26, 2019
Thanks for all this digging you've done.
snoyberg commentedon May 1, 2019
This is a good find, thank you! I'll need to look at the code again before coming up with any ideas.
Support symlinks to directories (fixes #4776)
snoyberg commentedon May 1, 2019
See #4793
Merge pull request #4793 from commercialhaskell/4776-symlinks-to-dirs
fosskers commentedon May 1, 2019
Thanks for the fix.