Skip to content

build: avoid rebuilds when using clippy in a virtualenv#1557

Merged
davidhewitt merged 1 commit into
PyO3:mainfrom
davidhewitt:cargo-clippy-rebuilds
Apr 19, 2021
Merged

build: avoid rebuilds when using clippy in a virtualenv#1557
davidhewitt merged 1 commit into
PyO3:mainfrom
davidhewitt:cargo-clippy-rebuilds

Conversation

@davidhewitt

@davidhewitt davidhewitt commented Apr 11, 2021

Copy link
Copy Markdown
Member

Closes #1551

The fix comes in two pieces:

  • I add detection for VIRTUAL_ENV and CONDA_PREFIX variables as possible ways to detect the Python interpreter; this logic is borrowed from maturin.
  • I refactored the environment variable rerun-if-env-changed system to ensure we emit exactly the environment variables checked by the current run of the build script. This should avoid issues like Rerun if PYO3_CROSS env variable changes. #1552 .

cc @jameshilliard I took out the (new, undocumented) PYO3_CROSS variable - was there a specific need for its creation?

@davidhewitt

Copy link
Copy Markdown
Member Author

(Ah sorry just seen your other comment, I'll restore PYO3_CROSS and add documentation.)

Comment thread build.rs Outdated
@davidhewitt davidhewitt force-pushed the cargo-clippy-rebuilds branch 3 times, most recently from 60a0db6 to 4cd39a4 Compare April 12, 2021 06:16
@davidhewitt davidhewitt force-pushed the cargo-clippy-rebuilds branch 2 times, most recently from f1c5def to c3b4511 Compare April 19, 2021 07:38
@davidhewitt

Copy link
Copy Markdown
Member Author

If nobody has any objections, I'll probably merge this later today. I think it's a useful tidy up that can avoid some user frustration.

@davidhewitt davidhewitt force-pushed the cargo-clippy-rebuilds branch from c3b4511 to 2b9085a Compare April 19, 2021 19:26
@davidhewitt davidhewitt merged commit d153bca into PyO3:main Apr 19, 2021
@davidhewitt davidhewitt deleted the cargo-clippy-rebuilds branch April 19, 2021 21:29
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.

Switching between cargo check and cargo clippy forces pyo3 to rebuild

2 participants