Skip to content

Failiure when building a wheel from a rust crate with a local dependency #507

Description

@IBims1NicerTobi

I have a rust crate in a workspace with a local dependency. Basically I have

project_workspace_dir
├─project-core
└─project-python

And my project_python depends on project_core in Cargo.toml like this:

[dependencies]
project-core = { path = "../project-core" }

When I call python -m build -s I see the following in my logs:

creating project-0.1.0/../project-core
creating project-0.1.0/../project-core/src

and

copying ../project-core/Cargo.toml -> tr0-0.1.0/../project-core
copying ../project-core/src/error.rs -> tr0-0.1.0/../project-core/src
copying ../project-core/src/lib.rs -> tr0-0.1.0/../project-core/src

This leads to project-core ending up next to dist

Activity

  1. IBims1NicerTobi commented on Feb 23, 2025

    @IBims1NicerTobi
    Author

    I think the optimal solution here would be to detect local dependencies, actually copy them to the archive and rewrite Cargo.toml for the affected crate, but I'm not sure how reasonable that is.

  2. IBims1NicerTobi commented on Feb 28, 2025

    @IBims1NicerTobi
    Author

    MWE here

  3. messense commented on Apr 15, 2025

    @messense
    Member

    I think the optimal solution here would be to detect local dependencies, actually copy them to the archive and rewrite Cargo.toml for the affected crate, but I'm not sure how reasonable that is.

    This is implemented in maturin but it introduces some other issues: https://github.com/PyO3/maturin/issues?q=is%3Aissue%20label%3Asdist%20label%3Abug

    For simplicity I don't think we should implement it in setuptools-rust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions