Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

davidhewitt
Copy link
Member

@davidhewitt davidhewitt commented Apr 11, 2021

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
Member Author

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

build.rs Outdated Show resolved Hide resolved
@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
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