From c42f98dc05d902b6f043d3bdd4b04cd7541d2846 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 8 Jan 2024 13:43:33 -0700 Subject: [PATCH 1/3] chore: migrate to target_compatible_with --- .../tests/asterius/asterius_tests_utils.bzl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl b/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl index 5c187f81d..4a0af4f37 100644 --- a/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl +++ b/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl @@ -1,3 +1,4 @@ +load("@bazel_skylib//lib:selects.bzl", "selects") load( "@rules_haskell//haskell/asterius:defs.bzl", "ahc_dist", @@ -6,7 +7,12 @@ load( "asterius_webpack", ) -tags = ["dont_test_on_windows", "dont_test_on_darwin", "skip_profiling", "dont_test_on_bazel_lt_4"] +tags = ["dont_test_on_windows", "skip_profiling", "dont_test_on_bazel_lt_4"] + +target_compatible_with = selects.with_or({ + ("//platforms/os:macos"): ["@platforms//:incompatible"], + "//conditions:default": [], +}) def asterius_test_macro( dep_label, @@ -22,6 +28,7 @@ def asterius_test_macro( entry_point = entry_point, testonly = True, tags = tags, + target_compatible_with = target_compatible_with, ) asterius_test( @@ -30,6 +37,7 @@ def asterius_test_macro( entry_point = entry_point, testonly = True, tags = tags, + target_compatible_with = target_compatible_with, ) asterius_binary( @@ -38,6 +46,7 @@ def asterius_test_macro( entry_point = entry_point, testonly = True, tags = tags, + target_compatible_with = target_compatible_with, ) # TODO the following `asterius_binary_from_genrule` rule is meant to test @@ -51,6 +60,7 @@ def asterius_test_macro( tools = [":asterius_binary" + suffix], testonly = True, tags = tags + ["manual"], + target_compatible_with = target_compatible_with, ) asterius_webpack( @@ -59,4 +69,5 @@ def asterius_test_macro( entry_point = entry_point, testonly = True, tags = tags, + target_compatible_with = target_compatible_with, ) From 4782747df76076b9e138add8950224fd1cefe882 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 8 Jan 2024 14:01:07 -0700 Subject: [PATCH 2/3] Try typing the correct label. --- rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl b/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl index 4a0af4f37..bafd4a50b 100644 --- a/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl +++ b/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl @@ -10,7 +10,7 @@ load( tags = ["dont_test_on_windows", "skip_profiling", "dont_test_on_bazel_lt_4"] target_compatible_with = selects.with_or({ - ("//platforms/os:macos"): ["@platforms//:incompatible"], + ("@platforms//os:macos"): ["@platforms//:incompatible"], "//conditions:default": [], }) From 0f2ba85a136c65f388d29c46be4ff37c089e2c54 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 8 Jan 2024 14:46:56 -0700 Subject: [PATCH 3/3] Set exec_compatible_with. --- rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl b/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl index bafd4a50b..57b8de15b 100644 --- a/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl +++ b/rules_haskell_tests/tests/asterius/asterius_tests_utils.bzl @@ -29,6 +29,7 @@ def asterius_test_macro( testonly = True, tags = tags, target_compatible_with = target_compatible_with, + exec_compatible_with = target_compatible_with, ) asterius_test( @@ -38,6 +39,7 @@ def asterius_test_macro( testonly = True, tags = tags, target_compatible_with = target_compatible_with, + exec_compatible_with = target_compatible_with, ) asterius_binary( @@ -47,6 +49,7 @@ def asterius_test_macro( testonly = True, tags = tags, target_compatible_with = target_compatible_with, + exec_compatible_with = target_compatible_with, ) # TODO the following `asterius_binary_from_genrule` rule is meant to test @@ -61,6 +64,7 @@ def asterius_test_macro( testonly = True, tags = tags + ["manual"], target_compatible_with = target_compatible_with, + exec_compatible_with = target_compatible_with, ) asterius_webpack( @@ -70,4 +74,5 @@ def asterius_test_macro( testonly = True, tags = tags, target_compatible_with = target_compatible_with, + exec_compatible_with = target_compatible_with, )