You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using cargo vendor to create self-contained downstream sdists and then CARGO_NET_OFFLINE=true to build packages. The approach works fine for PyO3-based projects with setuptools-rust or maturin, e.g. cryptography, pydantic-core, and jiter. However yesterday's release jiter 0.6.0 broke vendoring and offline builds.
$ tar xf jiter-0.6.0.tar.gz
$ cd jiter-0.6.0
$ mkdir -p .cargo
$ cargo vendor > .cargo/config.toml
$ CARGO_NET_OFFLINE=true python3 -m build
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- maturin>=1,<2
* Getting build dependencies for sdist...
* Building sdist...
Running `maturin pep517 write-sdist --sdist-directory .../jiter-0.6.0/dist`
error: no matching package named `python3-dll-a` found
location searched: registry `crates-io`
required by package `pyo3-build-config v0.22.3`
... which satisfies dependency `pyo3-build-config = "^0.22.0"` (locked to 0.22.3) of package `jiter v0.6.0 (.../jiter-0.6.0/crates/jiter)`
... which satisfies path dependency `jiter` (locked to 0.6.0) of package `jiter-python v0.6.0 (.../jiter-0.6.0/crates/jiter-python)`
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.💥 maturin failed Caused by: Cargo metadata failed. Does your crate compile with `cargo build`? Caused by: `cargo metadata` exited with an error: Error: command ['maturin', 'pep517', 'write-sdist', '--sdist-directory', '.../jiter-0.6.0/dist'] returned non-zero exit status 1ERROR Backend subprocess exited when trying to invoke build_sdist$ ls -la vendor/python3-dll-als: cannot access 'vendor/python3-dll-a': No such file or directory
I tracked the problem down to #145 and pyo3/generate-import-lib. The feature adds additional dependencies like python3-dll-a that are not visible to cargo vendor. The fix is trivial, re-add extension modules feature to crates/jiter-python/Cargo.toml and include the new feature. This makes the dependency visible to cargo.
Declare all extension module features in `Cargo.toml`, so they are
visible to `cargo vendor`. Otherwise vendoring does not include
additional dependencies like `python3-dll-a` and offline build fails.
Fixes: pydantic#148
Signed-off-by: Christian Heimes <christian@python.org>
We are using
cargo vendor
to create self-contained downstream sdists and thenCARGO_NET_OFFLINE=true
to build packages. The approach works fine for PyO3-based projects with setuptools-rust or maturin, e.g. cryptography, pydantic-core, and jiter. However yesterday's release jiter 0.6.0 broke vendoring and offline builds.I tracked the problem down to #145 and
pyo3/generate-import-lib
. The feature adds additional dependencies likepython3-dll-a
that are not visible tocargo vendor
. The fix is trivial, re-add extension modules feature tocrates/jiter-python/Cargo.toml
and include the new feature. This makes the dependency visible tocargo
.The text was updated successfully, but these errors were encountered: