-
Notifications
You must be signed in to change notification settings - Fork 229
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
Pub does not support publishing packages with directory symlinks #3143
Comments
We need to find out what was the previous behavior - did we include the symlink, or copy the files? I can see this being useful in some cases - we should probably reenable this. |
Symlinks have included I think. You can check the |
As far as I can tell the archive for photo_manager 1.3.4 has no symlinks. Which directory should be a symlink? |
The |
Looks to me like the previous behavior was to copy the symlinked directory. |
That's what we do currently, remove the symlink and make a copy when publishing. I think the previous behavior is good enoungh, but would be better the symlink can support. In this package we combine classes files for both iOS and macOS and they work together. |
One issue with including symlinks in packages is that they do not work very well on windows. But I think the pub-tool could copy directories (as it already does for files). @jonasfj I vaguely remember you having some good points here. |
Yes symlinks might have some capability issues with various of tools. So copies seem enough, the problem here is the pub tool reject them currently. |
I read this, as you're requesting support for symlinks? Rather than filing a bug report saying that something that used to work no longer works -- @AlexV525 is that correct? re: symlinks -> we should avoid these. We are not synchronizing file-systems here, we're publishing packages. And a package is a set of files, maybe including executable bits, but IMO even that could be disputed in the future. That's just my opinion. Adding all sorts of features like symlinks won't make packages easier to consume. |
Not really, it would ge glad to have the original behavior back, for now it's just removed, which looks like symlinks are supported at the first time. So I think we have three options:
|
To be clarify, symlinks used to be copies, which makes me think that symlinks worked well with pub. So I don't think this is a feature request, but a bug report for a feature that used to work. |
I think this is a reasonable behavior, and that's what we do with file-symlinks currently and (I believe) used to do with directories. |
Yes, we do copies for symlinks when publishing files. I'm not sure we ever did this for directory symlinks. In either case, I think it's better to make a There are other problems with symlinks, people might be confused when importing a symlinked file causes code duplication in Dart... etc. In practice there are ways around symlinks in most cases... either using scripts or by tweaking the build system. To avoid source duplication between This is not pretty -- and who knows how it'll break in the future 🙈 but it works for now 🤣 |
Did we missed something? Cause pub does not support symlinks from 2.14. How do you guys agree woth those three options? If you think blocking symlinks works fine, then this issue can be closed, otherwise we should go for copies at least. |
I think symlinks pointing to files are supported. Is this incorrect? I generally dislike adding features like this to |
Well that's the point, see logs here, as I pointed out in the top comment.
After we switched to a lower version of pub, it works well with symlinks. |
Symlinks to directories or files? |
We use it for directories only. |
summary of previous discussion: Previous behavior (pub bundled in dart 2.12/flutter 2.5+ and behavior in current PR):
Current behavior (dart 2.14+, flutter 2.8+):
Summary of solution introduced in #3298
|
This is definitely something we should fix. I'm still on the fence about supporting symlink directories, but maybe that's something we should consider. Especially, if cycles can be resolved reasonably on all platforms with all kinds of links (thinking Windows where I don't even recall how many types of symlink-like links there might be). |
Environment
pub version
: 2.14.0Problem
Our package includes a symlink that links
ios
tomacos
, before 2.14.0 pub does support symlink, but we cannot publish a new version using the latest pub. We neither got a warning nor a breaking change announcement.A detailed log can be found at https://github.com/CaiJingLong/flutter_photo_manager/runs/3683581202?check_suite_focus=true .
Expected behavior
Support symlink as usual.
Actual behavior
Does not support symlinks.
The text was updated successfully, but these errors were encountered: