8000 tests: make some analysis tests work for when test's exec platform is… · kaycebasques/rules_python@e54060b · GitHub
[go: up one dir, main page]

Skip to content

Commit e54060b

Browse files
authored
tests: make some analysis tests work for when test's exec platform is required (bazel-contrib#2869)
An upcoming change in Bazel makes the test toolchain required, which means a compatible exec platform amongst toolchains must be found (bazelbuild/bazel@2780393). Some analysis tests of `py_test` force the target platform to a specific platform, but before this change didn't register a compatible exec platform. This can be fixed by registering the target platform as an exec platform. Since Python targets currently depend on a C++ toolchain through Bazel's `launcher` and `launcher_maker` and the default toolchain can't cross-compile to Linux, the host platform still needs to be kept at highest priority to ensure that cross-compilation isn't needed on macOS. Work towards bazel-contrib#2850
1 parent efc7589 commit e54060b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/base_rules/py_executable_base_tests.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ def _test_main_module_bootstrap_system_python(name, config):
356356
target = name + "_subject",
357357
config_settings = {
358358
BOOTSTRAP_IMPL: "system_python",
359+
"//command_line_option:extra_execution_platforms": ["@bazel_tools//tools:host_platform", LINUX_X86_64],
359360
"//command_line_option:platforms": [LINUX_X86_64],
360361
},
361362
expect_failure = True,
@@ -380,6 +381,7 @@ def _test_main_module_bootstrap_script(name, config):
380381
target = name + "_subject",
381382
config_settings = {
382383
BOOTSTRAP_IMPL: "script",
384+
"//command_line_option:extra_execution_platforms": ["@bazel_tools//tools:host_platform", LINUX_X86_64],
383385
"//command_line_option:platforms": [LINUX_X86_64],
384386
},
385387
)

0 commit comments

Comments
 (0)
0