From 07e8bc91f3194d7a91e800b64fa3ff772b929fb9 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Mon, 5 May 2025 17:10:42 +0200 Subject: [PATCH 1/2] fix: add target platform to extra exec platforms in analysis tests This is required as of https://github.com/bazelbuild/bazel/commit/2780393d35ad0607cf5e344ae082b00a5569a964 as tests now require an execution platform that matches their target constraints by default. --- tests/base_rules/py_executable_base_tests.bzl | 2 ++ tests/base_rules/py_test/py_test_tests.bzl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/base_rules/py_executable_base_tests.bzl b/tests/base_rules/py_executable_base_tests.bzl index 37707831fc..3780469f9b 100644 --- a/tests/base_rules/py_executable_base_tests.bzl +++ b/tests/base_rules/py_executable_base_tests.bzl @@ -53,6 +53,7 @@ def _test_basic_windows(name, config): "//command_line_option:crosstool_top": CROSSTOOL_TOP, "//command_line_option:extra_toolchains": [CC_TOOLCHAIN], "//command_line_option:platforms": [WINDOWS_X86_64], + "//command_line_option:extra_execution_platforms": [WINDOWS_X86_64], }, attr_values = {"target_compatible_with": target_compatible_with}, ) @@ -98,6 +99,7 @@ def _test_basic_zip(name, config): "//command_line_option:crosstool_top": CROSSTOOL_TOP, "//command_line_option:extra_toolchains": [CC_TOOLCHAIN], "//command_line_option:platforms": [LINUX_X86_64], + "//command_line_option:extra_execution_platforms": [LINUX_X86_64], }, attr_values = {"target_compatible_with": target_compatible_with}, ) diff --git a/tests/base_rules/py_test/py_test_tests.bzl b/tests/base_rules/py_test/py_test_tests.bzl index d4d839b392..8d0928baef 100644 --- a/tests/base_rules/py_test/py_test_tests.bzl +++ b/tests/base_rules/py_test/py_test_tests.bzl @@ -61,6 +61,7 @@ def _test_mac_requires_darwin_for_execution(name, config): "//command_line_option:crosstool_top": CROSSTOOL_TOP, "//command_line_option:extra_toolchains": CC_TOOLCHAIN, "//command_line_option:platforms": [MAC_X86_64], + "//command_line_option:extra_execution_platforms": [MAC_X86_64], }, attr_values = _SKIP_WINDOWS, ) @@ -94,6 +95,7 @@ def _test_non_mac_doesnt_require_darwin_for_execution(name, config): "//command_line_option:crosstool_top": CROSSTOOL_TOP, "//command_line_option:extra_toolchains": CC_TOOLCHAIN, "//command_line_option:platforms": [LINUX_X86_64], + "//command_line_option:extra_execution_platforms": [LINUX_X86_64], }, attr_values = _SKIP_WINDOWS, ) From e5908dcc3f7546cc5b25c6b9e6b57bba3889afc1 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Mon, 5 May 2025 17:55:36 +0200 Subject: [PATCH 2/2] Fix buildifier lint --- tests/base_rules/py_executable_base_tests.bzl | 4 ++-- tests/base_rules/py_test/py_test_tests.bzl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/base_rules/py_executable_base_tests.bzl b/tests/base_rules/py_executable_base_tests.bzl index 3780469f9b..55a8958b82 100644 --- a/tests/base_rules/py_executable_base_tests.bzl +++ b/tests/base_rules/py_executable_base_tests.bzl @@ -51,9 +51,9 @@ def _test_basic_windows(name, config): "//command_line_option:build_python_zip": "true", "//command_line_option:cpu": "windows_x86_64", "//command_line_option:crosstool_top": CROSSTOOL_TOP, + "//command_line_option:extra_execution_platforms": [WINDOWS_X86_64], "//command_line_option:extra_toolchains": [CC_TOOLCHAIN], "//command_line_option:platforms": [WINDOWS_X86_64], - "//command_line_option:extra_execution_platforms": [WINDOWS_X86_64], }, attr_values = {"target_compatible_with": target_compatible_with}, ) @@ -97,9 +97,9 @@ def _test_basic_zip(name, config): "//command_line_option:build_python_zip": "true", "//command_line_option:cpu": "linux_x86_64", "//command_line_option:crosstool_top": CROSSTOOL_TOP, + "//command_line_option:extra_execution_platforms": [LINUX_X86_64], "//command_line_option:extra_toolchains": [CC_TOOLCHAIN], "//command_line_option:platforms": [LINUX_X86_64], - "//command_line_option:extra_execution_platforms": [LINUX_X86_64], }, attr_values = {"target_compatible_with": target_compatible_with}, ) diff --git a/tests/base_rules/py_test/py_test_tests.bzl b/tests/base_rules/py_test/py_test_tests.bzl index 8d0928baef..c51aa53a95 100644 --- a/tests/base_rules/py_test/py_test_tests.bzl +++ b/tests/base_rules/py_test/py_test_tests.bzl @@ -59,9 +59,9 @@ def _test_mac_requires_darwin_for_execution(name, config): config_settings = { "//command_line_option:cpu": "darwin_x86_64", "//command_line_option:crosstool_top": CROSSTOOL_TOP, + "//command_line_option:extra_execution_platforms": [MAC_X86_64], "//command_line_option:extra_toolchains": CC_TOOLCHAIN, "//command_line_option:platforms": [MAC_X86_64], - "//command_line_option:extra_execution_platforms": [MAC_X86_64], }, attr_values = _SKIP_WINDOWS, ) @@ -93,9 +93,9 @@ def _test_non_mac_doesnt_require_darwin_for_execution(name, config): config_settings = { "//command_line_option:cpu": "k8", "//command_line_option:crosstool_top": CROSSTOOL_TOP, + "//command_line_option:extra_execution_platforms": [LINUX_X86_64], "//command_line_option:extra_toolchains": CC_TOOLCHAIN, "//command_line_option:platforms": [LINUX_X86_64], - "//command_line_option:extra_execution_platforms": [LINUX_X86_64], }, attr_values = _SKIP_WINDOWS, )