Skip to content

Broken symlinks prevent packaging when using package.include #10917

@casey

Description

@casey

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]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions