tests: make precompile tests pass when other toolchains are defined#2213
Merged
rickeylev merged 1 commit intobazel-contrib:mainfrom Sep 10, 2024
Merged
Conversation
This makes the precompile_tests pass when the environment defines custom toolchains that don't match what rules_python defines in its dev environment. This keeps the tests independent of whatever the user's environment is. Along the way: * Also force `--allow_unresolved_symlinks=true` in the tests. This flag isn't enabled in certain environments, but is implicitly relied upon by the `current_interpreter_executable` rule when a platform runtime is used (as they are in the tests). * Move the Python testing toolchains to support/py_toolchains, to match where the cc testing toolchains were moved.
oprypin
approved these changes
Sep 10, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 10, 2024
…2213) This makes the precompile_tests pass when the environment defines custom toolchains that don't match what rules_python defines in its dev environment. This keeps the tests independent of whatever the user's environment is. Basically, the tests rely on a fake Python version 4.5 toolchain for the precompiler being defined. They pass today because they fallback to a real toolchain (as setup by MODULE.bazel), which doesn't have any version constraints on it. In comparison, within Google, there is no "default" toolchain, so the tests fail to find what they need. To fix, explicitly define a fake precompiler toolchain and tell the test to use it. Along the way: * Also force `--allow_unresolved_symlinks=true` in the tests. This flag isn't enabled in certain environments, but is implicitly relied upon by the `current_interpreter_executable` rule when a platform runtime is used (as they are in the tests). * Move the Python testing toolchains to support/py_toolchains, to match where the cc testing toolchains were moved.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 10, 2024
…2213) This makes the precompile_tests pass when the environment defines custom toolchains that don't match what rules_python defines in its dev environment. This keeps the tests independent of whatever the user's environment is. Basically, the tests rely on a fake Python version 4.5 toolchain for the precompiler being defined. They pass today because they fallback to a real toolchain (as setup by MODULE.bazel), which doesn't have any version constraints on it. In comparison, within Google, there is no "default" toolchain, so the tests fail to find what they need. To fix, explicitly define a fake precompiler toolchain and tell the test to use it. Along the way: * Also force `--allow_unresolved_symlinks=true` in the tests. This flag isn't enabled in certain environments, but is implicitly relied upon by the `current_interpreter_executable` rule when a platform runtime is used (as they are in the tests). * Move the Python testing toolchains to support/py_toolchains, to match where the cc testing toolchains were moved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the precompile_tests pass when the environment defines custom toolchains that
don't match what rules_python defines in its dev environment. This keeps the tests
independent of whatever the user's environment is.
Basically, the tests rely on a fake Python version 4.5 toolchain for the precompiler being
defined. They pass today because they fallback to a real toolchain (as setup by
MODULE.bazel), which doesn't have any version constraints on it. In comparison, within
Google, there is no "default" toolchain, so the tests fail to find what they need.
To fix, explicitly define a fake precompiler toolchain and tell the test to use it.
Along the way:
--allow_unresolved_symlinks=truein the tests. This flag isn't enabled incertain environments, but is implicitly relied upon by the
current_interpreter_executablerule when a platform runtime is used (as they are inthe tests).
testing toolchains were moved.