-
Notifications
You must be signed in to change notification settings - Fork 232
Follow file symlinks too #2827
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
Follow file symlinks too #2827
Conversation
I think I agree this is the right behavior. One issue here is that we don't have the same tar process for windows and linux/macos. On windows we use 7zip. On the other hand symlinks are probably much less used on windows. Could you write a test that shows this as being fixed? We are working on migrating to a tar implementation in dart (#2817). But it is not clear how long it will take to land. It would be great to have the test for ensuring that the behavior stays consistent when we do the switch. |
50dff61
to
82d75fc
Compare
On Windows, 7-Zip has no option to follow file symlinks. There are just these options about links:
Windows 10 seems to have a system tar.exe included since v1803 (bsdtar 3.3.2). This one could support |
82d75fc
to
b43820c
Compare
It does follow directory symlinks? doesn't it just package the actual symlink? |
b43820c
to
e93532f
Compare
It does follow directory symlinks, as shown by the 'publish follows directory symlinks' test in this PR. At least for symlinks pointing to excluded or out-of-package-root targets, this is the only sensible behavior. |
We have merged #2817 . If you want we can land the test. I believe our implementation follows links. |
Closing for lack of activity. Feel welcome to open a new PR with the test if you would like ensuring the desired behavior does not regress. |
Currently,
pub publish
follows directory symlinks, but not file symlinks. With this PR, file symlinks are followed too. This fixes broken symlinks if they point outside the package root and should not break anything, although it could increase package size.The dry-run shows the directory tree with directory symlinks resolved, and without indicating symlinks for file symlinks, so it is very confusing currently.
Ideally, symlinks would only be resolved if they point outside the package root. However, that would need two or three tar runs (one with, one without
--dereference
) and usingtar --concatenate
(in the second or the final, third run). It would make the code significantly more complex.Related issues:
pub publish
is not picking symbolic links #2699