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

workspace dependencies inheritance support #1122

Closed
messense opened this issue Sep 23, 2022 · 2 comments · Fixed by #1123
Closed

workspace dependencies inheritance support #1122

messense opened this issue Sep 23, 2022 · 2 comments · Fixed by #1123
Labels
enhancement New feature or request sdist Source distribution

Comments

@messense
Copy link
Member

💥 maturin failed
  Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
  Caused by: `cargo metadata` exited with an error: error: current package believes it's in a workspace when it's not:
current:   /Users/messense/Projects/maturin/test-crates/workspace_with_path_dep/python/dist/workspace_with_path_dep-0.1.0/Cargo.toml
workspace: /Users/messense/Projects/maturin/test-crates/workspace_with_path_dep/Cargo.toml

this may be fixable by adding `python/dist/workspace_with_path_dep-0.1.0` to the `workspace.members` array of the manifest located at: /Users/messense/Projects/maturin/test-crates/workspace_with_path_dep/Cargo.toml
Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.
@jondo2010
Copy link

I'm guessing there's no "librarified" support in rustc for handling the Cargo.toml and resolving the workspace, which is why Maturin rolls its own handling?

@messense
Copy link
Member Author

messense commented Sep 23, 2022

We use cargo metadata to resolve the workspace, maturin has no problem building wheels for projects using workspace inheritance, the hurdle is when building source distribution maturin only includes what's required to build the wheel (for good reason, for example, to reduce sdist size), which may not include the workspace manifest file Cargo.toml so workspace inherited dependencies can not be resolved when building from source distribution at the moment.

@messense messense changed the title workspace inheritance support workspace dependencies inheritance support Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sdist Source distribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants