From 5c1ab45421a06cb2d845427a112e98522d24720f Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 27 Oct 2020 17:14:34 -0700 Subject: [PATCH 1/3] Test target_compatible_with --- test/coverage_settings_tests.bzl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/coverage_settings_tests.bzl b/test/coverage_settings_tests.bzl index 397b8ffb9..099bf54f3 100644 --- a/test/coverage_settings_tests.bzl +++ b/test/coverage_settings_tests.bzl @@ -65,13 +65,13 @@ def coverage_settings_test_suite(name = "coverage_settings"): coverage_xcode_prefix_map_test( name = "{}_xcode_prefix_map".format(name), tags = [name], - expected_argv = select({ - "//test:linux": [], - "//conditions:default": [ - "-coverage-prefix-map", - "__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR", - ], - }), + expected_argv = [ + "-coverage-prefix-map", + "__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR", + ], + target_compatible_with = [ + "@bazel_tools//platforms:osx", + ], mnemonic = "SwiftCompile", target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple", ) From 336d72156c97a6971e7aa3dd3d65ebc5c8e514f7 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 27 Oct 2020 17:26:12 -0700 Subject: [PATCH 2/3] Fix attr --- test/coverage_settings_tests.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/coverage_settings_tests.bzl b/test/coverage_settings_tests.bzl index 099bf54f3..02e256333 100644 --- a/test/coverage_settings_tests.bzl +++ b/test/coverage_settings_tests.bzl @@ -70,7 +70,7 @@ def coverage_settings_test_suite(name = "coverage_settings"): "__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR", ], target_compatible_with = [ - "@bazel_tools//platforms:osx", + "@platforms//os:macos", ], mnemonic = "SwiftCompile", target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple", From 9cd7c7ef03fb97b92be2be815fe55c1f9f252554 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Fri, 12 Mar 2021 09:44:46 -0800 Subject: [PATCH 3/3] Update all --- test/BUILD | 8 -------- test/coverage_settings_tests.bzl | 4 +--- test/debug_settings_tests.bzl | 12 +++++------- test/split_derived_files_tests.bzl | 16 ++++------------ 4 files changed, 10 insertions(+), 30 deletions(-) diff --git a/test/BUILD b/test/BUILD index fb4afe0d7..70dcb37e7 100644 --- a/test/BUILD +++ b/test/BUILD @@ -32,11 +32,3 @@ bzl_library( "//test/rules:starlark_tests_bzls", ], ) - -# TODO: Remove once https://github.com/bazelbuild/bazel/pull/10945 lands -config_setting( - name = "linux", - constraint_values = [ - "@bazel_tools//platforms:linux", - ], -) diff --git a/test/coverage_settings_tests.bzl b/test/coverage_settings_tests.bzl index 02e256333..b14e58234 100644 --- a/test/coverage_settings_tests.bzl +++ b/test/coverage_settings_tests.bzl @@ -69,9 +69,7 @@ def coverage_settings_test_suite(name = "coverage_settings"): "-coverage-prefix-map", "__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR", ], - target_compatible_with = [ - "@platforms//os:macos", - ], + target_compatible_with = ["@platforms//os:macos"], mnemonic = "SwiftCompile", target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple", ) diff --git a/test/debug_settings_tests.bzl b/test/debug_settings_tests.bzl index 380572583..49d5a61d6 100644 --- a/test/debug_settings_tests.bzl +++ b/test/debug_settings_tests.bzl @@ -225,13 +225,11 @@ def debug_settings_test_suite(name = "debug_settings"): xcode_remap_command_line_test( name = "{}_remap_xcode_path".format(name), - expected_argv = select({ - "//test:linux": [], - "//conditions:default": [ - "-debug-prefix-map", - "__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR", - ], - }), + expected_argv = [ + "-debug-prefix-map", + "__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR", + ], + target_compatible_with = ["@platforms//os:macos"], mnemonic = "SwiftCompile", tags = [name], target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple", diff --git a/test/split_derived_files_tests.bzl b/test/split_derived_files_tests.bzl index 34839ebae..5aa8243a5 100644 --- a/test/split_derived_files_tests.bzl +++ b/test/split_derived_files_tests.bzl @@ -274,12 +274,8 @@ def split_derived_files_test_suite(name = "split_derived_files"): split_swiftmodule_bitcode_test( name = "{}_bitcode_compile".format(name), - expected_argv = select({ - "//test:linux": [], - "//conditions:default": [ - "-embed-bitcode", - ], - }), + expected_argv = ["-embed-bitcode"], + target_compatible_with = ["@platforms//os:macos"], mnemonic = "SwiftCompile", tags = [name], target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple", @@ -297,12 +293,8 @@ def split_derived_files_test_suite(name = "split_derived_files"): split_swiftmodule_bitcode_markers_test( name = "{}_bitcode_markers_compile".format(name), - expected_argv = select({ - "//test:linux": [], - "//conditions:default": [ - "-embed-bitcode-marker", - ], - }), + expected_argv = ["-embed-bitcode-marker"], + target_compatible_with = ["@platforms//os:macos"], mnemonic = "SwiftCompile", tags = [name], target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",