-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo publish chokes on symlinks #2748
Comments
Hmm, last time I tried to publish something, I worked around the issue by copying the directory in place of the symlink and it worked fine. Now, it doesn't any more, and I didn't update cargo in the meantime... I don't understand what's going on. |
Thanks to @SimonSapin I understood what's going on: cargo uses the git index to list the files to package.But the symlink is listed as a plain file in this index, not as a directory (and that's caused my other error: I didn't Needless to say I'd really like this to work again (I use the symlink because this "protocols" directory is shared between two projects), but I understand I'd be more than a simple bugfix. |
This isn't always quite as simple to workaround when the symlink is in a submodule that you don't really have the ability to modify... |
Are there currently any good workarounds for this? I'm working on a project which uses a 3rd party submodule (which itself contains submodules), and which makes heavy use of symlinks throughout its directory structure (which makes modifying it non-trivial). This also affects the |
Handle symlinks to directories When cargo encounters a link, check if it's a directory when considering it for further processing. I'm not sure how this interacts with things such as submodules – it allowed me to publish the crate [pqcrypto-kyber768](https://github.com/rustpq/pqcrypto) which uses a link to a submodule. Fixes #2748. This PR: * Add new tests that demonstrate that links to dirs can't be packaged * Fixes those tests * Enabled symlink tests to run on Windows * Fix a bug in the handling of symlinks * Add new test runner behaviour on Windows (it will ignore symlink-related tests and instead run them if you specify --ignored.)
On my project wayland-client, I have a structure like this:
With previous versions of cargo, publishing wayland-client worked as expected, packaging the contents of
protocols
through the symlink as if it was a simple directory.Now, since I updated to cargo 0.10.0,
cargo publish
chokes on theprotocols
symlink:The text was updated successfully, but these errors were encountered: