PyO3 / PyO3/setuptools-rust

Builds run `cargo metadata` for all platforms

Open
#610 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
680
Forks
110
Avg merge
3d 18h
Merged PRs (30d)
1

Description

Builds run cargo metadata --manifest-path Cargo.toml without a --target argument. This requires fetching metadata for all platforms.

Downstream (at least on Alpine) builds use the pattern:

# In the source-fetching stage
cargo fetch --locked

# In the build phase
export CARGO_NET_OFFLINE=true
gpep517 build-wheel --wheel-dir .dist …

The above separates fetching sources and compiling the package with those pre-fetched sources.

This fails for packages with py3-setuptools-rust, because it executes cargo metadata which, by default, wants metadata for packages for all targets.

I believe only the current target should be fetched instead (e.g.: rustc --print host-tuple).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that invokes cargo metadata --manifest-path Cargo.toml and trace how gpep517 build-wheel reaches it. Compare the current invocation with the cargo fetch --locked and offline build flow; done means builds request metadata only for the current target and the Alpine-style prefetch/build workflow no longer fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.