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

Fix a bug in the python venv export logic. #15294

Merged
merged 2 commits into from
May 2, 2022
Merged

Conversation

benjyw
Copy link
Contributor

@benjyw benjyw commented May 2, 2022

Previously, and partly as a legacy of an older implementation, we acted as if the requirements pex
had interpreter constraints baked into it. We relied on this when detecting the version of that interpreter.

But a requirements pex is internal-only, and so has no interpreter constraints. So in practice we
were picking whatever interpreter was used to run the pex, and that may not have been compatible
with the relevant constraints.

Now we always use a compatible interpreter.

[ci skip-rust]

[ci skip-build-wheels]

[ci skip-rust]

[ci skip-build-wheels]
@benjyw benjyw added the category:bugfix Bug fixes for released features label May 2, 2022
@benjyw benjyw requested review from Eric-Arellano and jsirois May 2, 2022 00:28
@@ -86,39 +85,28 @@ async def export_virtualenv(
request.root_python_targets, python_setup
) or InterpreterConstraints(python_setup.interpreter_constraints)

min_interpreter = interpreter_constraints.snap_to_minimum(python_setup.interpreter_universe)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This interpreter was not the one being used in practice! This was the legacy of the previous implementation.

@@ -217,6 +217,12 @@ def __post_init__(self):
f"Given platform constraints {self.platforms} for internal only pex request: "
f"{self}."
)
if self.internal_only and self.complete_platforms:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We check this for platforms above, but neglected to check it for complete_platforms.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@benjyw benjyw merged commit ba9dc62 into pantsbuild:main May 2, 2022
@benjyw benjyw deleted the fix_export branch May 2, 2022 13:28
benjyw added a commit to benjyw/pants that referenced this pull request May 2, 2022
Previously, and partly as a legacy of an older implementation, we acted as if the requirements pex
had interpreter constraints baked into it. We relied on this when detecting the version of that interpreter.

But a requirements pex is internal-only, and so has no interpreter constraints. So in practice we
were picking whatever interpreter was used to run the pex, and that may not have been compatible
with the relevant constraints.

Now we always use a compatible interpreter.

[ci skip-rust]

[ci skip-build-wheels]
@benjyw
Copy link
Contributor Author

benjyw commented May 2, 2022

Will cherry-pick this to 2.12.x now, but will wait until we get 2.11.0 out before I cherrypick to 2.11.x, to target a 2.11.1 release.

@stuhood
Copy link
Member

stuhood commented May 2, 2022

Will cherry-pick this to 2.12.x now, but will wait until we get 2.11.0 out before I cherrypick to 2.11.x, to target a 2.11.1 release.

Good call. Thanks. #15298.

@stuhood stuhood added this to the 2.11.x milestone May 2, 2022
benjyw added a commit that referenced this pull request May 2, 2022
Previously, and partly as a legacy of an older implementation, we acted as if the requirements pex
had interpreter constraints baked into it. We relied on this when detecting the version of that interpreter.

But a requirements pex is internal-only, and so has no interpreter constraints. So in practice we
were picking whatever interpreter was used to run the pex, and that may not have been compatible
with the relevant constraints.

Now we always use a compatible interpreter.

[ci skip-rust]

[ci skip-build-wheels]
benjyw added a commit to benjyw/pants that referenced this pull request May 2, 2022
…15294)

Previously, and partly as a legacy of an older implementation, we acted as if the requirements pex
had interpreter constraints baked into it. We relied on this when detecting the version of that interpreter.

But a requirements pex is internal-only, and so has no interpreter constraints. So in practice we
were picking whatever interpreter was used to run the pex, and that may not have been compatible
with the relevant constraints.

Now we always use a compatible interpreter.

[ci skip-rust]

[ci skip-build-wheels]
benjyw added a commit that referenced this pull request May 3, 2022
…5307)

Previously, and partly as a legacy of an older implementation, we acted as if the requirements pex
had interpreter constraints baked into it. We relied on this when detecting the version of that interpreter.

But a requirements pex is internal-only, and so has no interpreter constraints. So in practice we
were picking whatever interpreter was used to run the pex, and that may not have been compatible
with the relevant constraints.

Now we always use a compatible interpreter.

[ci skip-rust]

[ci skip-build-wheels]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants