Skip to content

Commit

Permalink
Skip profiling test on macos with GHC 9.6.2
Browse files Browse the repository at this point in the history
Trying to build this results in a bus error with ghc-iserv.
  • Loading branch information
avdv committed Dec 7, 2023
1 parent 745663e commit ce050b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rules_haskell_tests/tests/RunTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit ce050b0

Please sign in to comment.