Unpackaged default-members
lead to build failures when using source distributions
#2046
Open
1 of 2 tasks
Bug Description
tl;dr: When building code from an sdist that has a workspace
Cargo.toml
in the root withdefault-members
and somedefault-members
are not bundled the install will fail.Either of these options would probably fix that:
default-members
list inrewrite_cargo_toml
. No default members: all listed members are the defaultdefault-members
the same way as done formembers
.A bit more context that lead me to this:
We're using UniFFI and maturin to build all of that.
We have a rather involved build process targeting several different platforms, only one of which is Python.
Up until now we did publish source distributions (sdist), but never actually tested them.
Turns out they were broken because no
uniffi-bindgen
is around.We use a bundled
uniffi-bindgen
, with some extra changes, so usingpip install uniffi-bindgen
leads to other problems.So I now went ahead and added this to our
pyproject.toml
:and also a dependency to the crate maturin builds:
The latter is necessary to force
maturin
to consider the top-levelCargo.toml
the workspace root.Otherwise no root package is found.
With another package listed in
default-members
that is NOT part of the source distributionpip install ./package*.tar.z
will fail with something like:Right now the only way to work around that is to remove
glean-core/rlb
from thedefault-members
list.I'm doing that for now in mozilla/glean#2801
Your maturin version (
maturin --version
)1.5.1
Your Python version (
python -V
)3.12.0
Your pip version (
pip -V
)24.0
What bindings you're using
uniffi
Does
cargo build
work?If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash
/
)?Steps to Reproduce
The text was updated successfully, but these errors were encountered: