-
-
Notifications
You must be signed in to change notification settings - Fork 390
Can't create archive with broken symlinks #392
Comments
Ah, this might have something to do with the fact that zip archives don't seem to natively support symlinks. The tar headers do accept the symlink targets, but zip does not. Apparently the
Thanks for setting up a reproducer. I'm just quickly triaging my backlog right now. Could you tell me if the error happens with tar archives too? Anyway, the error shouldn't happen, I agree, I'm just trying to make sure I understand it well enough to make the right fix. |
Thanks; I agree something should be fixed, just not quite sure how yet. The ZIP file header doesn't seem to support symlink information, so I'm not sure how to archive the link? I can see how we can dereference the symlink and archive the target file, but not the symlink. |
Just to clarify as I revisit a few things...
Do you mean that the path of the symlink or the path of the target should be added to the archive? I think with zip files we lose one of those, we can't keep both (I'd love to be wrong though) I guess I just need some help from someone who understands this better than I :) |
What version of the package or command are you using?
v4.0.0-alpha.8
What are you trying to do?
I've got a process that archives nested folders on a server.
I'm trying to compress directories containing symlinks, some of which may point to things that no longer exist.
I am getting the error
open symlink.file: no such file or directory
even though I haveFollowSymlinks: false,
What steps did you take?
https://github.com/donatj/archivertest - here's the problem boiled down to an example project.
The gist of that project is
The
toArchive
directory contains a link-logo.png symlink that points to alogo.png
that no longer exists.What did you expect to happen, and what actually happened instead?
I just a zip with the broken symlink in it like most compression tools give. This throws an error.
How do you think this should be fixed?
Some part of the code is trying to follow the symlink, even though FollowSymlinks is turned off. That should be corrected and the symlink should just be archived as-is.
Please link to any related issues, pull requests, and/or discussion
Example project
https://github.com/donatj/archivertest
Bonus: What do you use archiver for, and do you find it useful?
I've got a number of CLI tools using it for creating archives.
The text was updated successfully, but these errors were encountered: