Skip to content

pub publish doesn't follow file symlinks #2193

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

Closed
werediver opened this issue Aug 27, 2019 · 4 comments
Closed

pub publish doesn't follow file symlinks #2193

werediver opened this issue Aug 27, 2019 · 4 comments

Comments

@werediver
Copy link

Environment

  • pub version or flutter pub version: Pub 2.4.0
  • OS version: macOS 10.14.6
  • Are you using the Chinese community mirror or a corporate firewall? No.

Problem

pub publish ignores file symlinks (but follows directory symlinks).

For example, in a multi-package repo I want the top level README.md to be symlinked from some of the packages (../README.md):

https://github.com/werediver/sum_types.dart/tree/5657f9d83f26cebac98ab3a0d8d5ff7e060d0859/sum_types_generator

Expected behavior

I expect pub to resolve file symlinks and include the target files in the package as if they were in place of the symlinks.

Actual behavior

Pub entirely ignores file symlinks during publishing as if they do not exist.

--trace output

Not relevant (no errors).

@werediver werediver changed the title pub publish doesn't resolve file symlinks pub publish doesn't follow file symlinks Aug 27, 2019
@werediver
Copy link
Author

No, it does. I ended up with broken symlinks, which were legitimately ignored by pub.

@frencojobs
Copy link

How did you manage to solve this? I'm also having an error where the linked files and folders outside of the project base are recognized as broken symlinks.

@werediver
Copy link
Author

@frencojobs I didn't use sym-links pointing outside the package directory, so it was never a problem for me. It is likely that such links are not accepted by pub for security and/or package integrity reasons.

You may consider using hard-links, if you think you have such a need.

@frencojobs
Copy link

Thanks. Even though I can't get in contact with the author of the Retrofit library, it seems like the library is structured a lot like what I needed, monorepo with symlinks. So, I actually think it's possible but maybe I'm doing something wrong.

I'm currently using hard-links because I'm in a hassle right now. But it doesn't look like the best idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants