PyO3 / PyO3/pyo3

`pyo3-build-config` cleanups

Open
#4,761 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Good First Issue refactoring
Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

In https://github.com/PyO3/pyo3/pull/4758 I fixed the urgent bug with PYO3_CONFIG_FILE changes not correctly triggering rebuilds.

I think we can take action to ensure we don't have a similar accident again. I was playing around with various ideas, I've seen two so far which I think make sense:

  • A lot of pyo3-build-config APIs require being run in a build script. I wonder if we should have something like a BuildScriptContext struct which all those APIs take, and it can collect info about environment accesses so that we can both test them and emit to cargo reliably.
  • We can add clippy configuration to ban direct environment variable access, as suggested by @alex .

Contributor guide

Open the contributing guide

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 reviewing the pyo3-build-config APIs and the changes in pull request #4758 around PYO3_CONFIG_FILE rebuilds. Compare the proposed BuildScriptContext approach with adding Clippy rules that ban direct environment-variable access. Done means the chosen cleanup is specified, implemented, and verifies environment accesses reliably in tests and Cargo output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.