diff --git a/rules_haskell_tests/tests/RunTests.hs b/rules_haskell_tests/tests/RunTests.hs index 1e036859c..78bdab253 100644 --- a/rules_haskell_tests/tests/RunTests.hs +++ b/rules_haskell_tests/tests/RunTests.hs @@ -10,6 +10,7 @@ import System.Directory (copyFile) import System.FilePath (()) import System.Info (os) import System.IO.Temp (withSystemTempDirectory) +import System.Environment (lookupEnv) import qualified System.Process as Process import Test.Hspec.Core.Spec (SpecM) @@ -26,11 +27,15 @@ main = hspec $ do assertSuccess (bazel ["test", "//..."]) it "bazel test prof" $ do + ghcVersion <- lookupEnv "GHC_VERSION" + -- In .github/workflows/workflow.yaml we specify --test_tag_filters -- -dont_test_on_darwin. However, specifiying --test_tag_filters -- -requires_dynamic here alone would override that filter. So, -- we have to duplicate that filter here. - let tagFilter | os == "darwin" = "-dont_test_on_darwin,-requires_dynamic,-skip_profiling" + let tagFilter | os == "darwin" = "-dont_test_on_darwin,-requires_dynamic,-skip_profiling" ++ ( + -- skip tests for specific GHC version, see https://github.com/tweag/rules_haskell/issues/2073 + maybe "" (",-dont_build_on_macos_with_ghc_" ++) ghcVersion) | otherwise = "-requires_dynamic,-skip_profiling" assertSuccess (bazel ["test", "-c", "dbg", "//...", "--build_tag_filters", tagFilter, "--test_tag_filters", tagFilter]) diff --git a/rules_haskell_tests/tests/haskell_module/dep-narrowing-th/BUILD.bazel b/rules_haskell_tests/tests/haskell_module/dep-narrowing-th/BUILD.bazel index dc306075c..4e18f5484 100644 --- a/rules_haskell_tests/tests/haskell_module/dep-narrowing-th/BUILD.bazel +++ b/rules_haskell_tests/tests/haskell_module/dep-narrowing-th/BUILD.bazel @@ -94,6 +94,11 @@ haskell_library( narrowed_deps = [ ":TestLib2", ], + tags = [ + # skip building this target on macos with GHC 9.6.2 since it crashes ghc-iserv + # see https://github.com/tweag/rules_haskell/issues/2073 + "dont_build_on_macos_with_ghc_9.6.2", + ], deps = [ ":NonModulesTestLib", ":TestLib", @@ -113,6 +118,11 @@ haskell_test( name = "Test", modules = [":TestBinModule"], narrowed_deps = [":lib"], + tags = [ + # skip testing this target on macos with GHC 9.6.2 since it crashes ghc-iserv + # see https://github.com/tweag/rules_haskell/issues/2073 + "dont_build_on_macos_with_ghc_9.6.2", + ], visibility = ["//visibility:public"], deps = [ "//tests/hackage:base",