Skip to content
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

Broken symlinks prevent packaging when using package.include #10917

Closed
casey opened this issue Aug 2, 2022 · 1 comment · Fixed by #11008
Closed

Broken symlinks prevent packaging when using package.include #10917

casey opened this issue Aug 2, 2022 · 1 comment · Fixed by #11008
Labels

Comments

@casey
Copy link
Contributor

casey commented Aug 2, 2022

Problem

Broken symlinks break packaging. This can be fixed by using package.exclude, but package.exclude is mutually exclusive with package.include, so this cannot be fixed if you're already using package.include.

Steps

cargo init foo
cd foo
ln -s foo bar
echo '[package]
name = "cargo-exclude"
version = "0.1.0"
edition = "2021"
include = ["/src"]' > Cargo.toml
git add .
git commit -m 'commit'
cargo package

Possible Solution(s)

Cargo should not follow symlinks that are excluded by virtue of not being included in package.include

Notes

No response

Version

cargo 1.62.1 (a748cf5a3 2022-06-08)
release: 1.62.1
commit-hash: a748cf5a3e666bc2dcdf54f37adef8ef22196452
commit-date: 2022-06-08
host: aarch64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.79.1 (sys:0.4.51+curl-7.80.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 12.5.0 [64-bit]
@casey casey added the C-bug Category: bug label Aug 2, 2022
@ehuss
Copy link
Contributor

ehuss commented Aug 2, 2022

cc @weihanglo This seems to have been introduced by #10214. I think an error like this (particularly not matching the include pattern) probably should be ignored. I'm not sure how tricky it will be to handle this, though.

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

Successfully merging a pull request may close this issue.

2 participants