Skip to content

1.86 cargo package fail when workspace crate contains symlink into git submodule #15384

@radhermit

Description

@radhermit

Problem

Previously it was possible to symlink a shared directory (e.g. testdata) into multiple crates from the root workspace directory where it exists as a git submodule.

Now in the cargo version that comes with rust-1.86, trying to use cargo publish or cargo package returns nonexistent file errors such as the following:

error: attempt to get status of nonexistent file 'testdata/toml/dep.toml'; class=Invalid (3); code=NotFound (-3)

Reverting to an earlier version of rust alleviates the issue.

Steps

For reference, I'm running into the issue with the project at https://github.com/pkgcraft/pkgcraft that symlinks its testdata directory into multiple crates. See the following steps to reproduce the issue:

  1. git clone --recursive https://github.com/pkgcraft/pkgcraft.git
  2. cd pkgcraft
  3. git checkout pkgcraft-tools-0.0.25
  4. cargo package -p pkgcraft-tools

Version

cargo 1.86.0 (adf9b6ad1 2025-02-28)
release: 1.86.0
commit-hash: adf9b6ad14cfa10ff680d5806741a144f7163698
commit-date: 2025-02-28
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.0 vendored)
libcurl: 8.12.0-DEV (sys:0.4.79+curl-8.12.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Gentoo Linux 2.17.0 [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-packageS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.regression-from-stable-to-stableRegression in stable that worked in a previous stable release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions