Skip to content

Fix spurious cross-compilation metadata warnings - #3296

Open
woodruffw wants to merge 1 commit into
PyO3:mainfrom
woodruffw-forks:codex/fix-cross-compile-artifact-warnings
Open

Fix spurious cross-compilation metadata warnings#3296
woodruffw wants to merge 1 commit into
PyO3:mainfrom
woodruffw-forks:codex/fix-cross-compile-artifact-warnings

Conversation

@woodruffw

Copy link
Copy Markdown
Contributor

I hit this warning when doing some cross-compilation of wheels with maturin.

TL;DR: when cross-compiling (e.g. Windows-on-Linux), Cargo may compile host-only dependencies omitted from target-filtered cargo metadata. Maturin would spuriously warn about their artifacts. The fix is to collect artifacts only for the package being packaged, identified by its package ID.

I've added a wasm cross build to the tests that ensures that the warning no longer occurs.

Filter compiler artifacts by the root package ID. Target-filtered
`cargo metadata` can omit host-only dependencies, so looking up every
artifact produces spurious warnings during cross-compilation.

Add a WASI regression test checking that the warning is absent and both
binaries are packaged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant