From 92e943181b7757d4401b66c5366e8725f50aa01d Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Tue, 12 Jul 2022 13:58:04 +0200 Subject: [PATCH] Use the `cc` tool for c2hs instead of `cpp` Re-activate tests that had been disabled because of `c2hs` failing with `clang: error: no input files`. Fixes #1486 --- haskell/c2hs.bzl | 2 +- tests/c2hs/BUILD.bazel | 15 --------------- tests/c2hs/repo/BUILD.bazel | 5 ----- tests/haskell_module/repl/BUILD.bazel | 10 ---------- tests/repl-targets/BUILD.bazel | 15 --------------- tests/version-macros/BUILD.bazel | 10 ---------- 6 files changed, 1 insertion(+), 56 deletions(-) diff --git a/haskell/c2hs.bzl b/haskell/c2hs.bzl index 0fad061c13..cdaa1d74d5 100644 --- a/haskell/c2hs.bzl +++ b/haskell/c2hs.bzl @@ -42,7 +42,7 @@ def _c2hs_library_impl(ctx): args.add_all([chs_file.path, "-o", hs_file.path]) args.add("-C-E") - args.add_all(["--cpp", cc.tools.cpp]) + args.add_all(["--cpp", cc.tools.cc]) args.add("-C-includeghcplatform.h") args.add("-C-includeghcversion.h") args.add_all(["-C" + x for x in cc.cpp_flags]) diff --git a/tests/c2hs/BUILD.bazel b/tests/c2hs/BUILD.bazel index b39a6eb367..d16d334830 100644 --- a/tests/c2hs/BUILD.bazel +++ b/tests/c2hs/BUILD.bazel @@ -10,22 +10,12 @@ c2hs_library( name = "foo", srcs = ["src/Foo/Foo.chs"], src_strip_prefix = "src", - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], deps = ["//tests:zlib"], ) c2hs_library( name = "bar", srcs = ["Bar.chs"], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], deps = [":foo"], ) @@ -36,11 +26,6 @@ haskell_library( ":foo", "@c2hs_repo//:baz", ], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], deps = ["//tests/hackage:base"], ) diff --git a/tests/c2hs/repo/BUILD.bazel b/tests/c2hs/repo/BUILD.bazel index 424f251e42..3b5545e71c 100644 --- a/tests/c2hs/repo/BUILD.bazel +++ b/tests/c2hs/repo/BUILD.bazel @@ -5,11 +5,6 @@ package(default_testonly = 1) c2hs_library( name = "baz", srcs = ["Baz.chs"], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], visibility = ["//visibility:public"], deps = ["@rules_haskell//tests:zlib"], ) diff --git a/tests/haskell_module/repl/BUILD.bazel b/tests/haskell_module/repl/BUILD.bazel index 20fc3bc8a7..23e016344f 100644 --- a/tests/haskell_module/repl/BUILD.bazel +++ b/tests/haskell_module/repl/BUILD.bazel @@ -6,11 +6,6 @@ rules_haskell_integration_test( name = "haskell_module_repl_test", size = "small", srcs = ["HaskellModuleReplTest.hs"], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], workspace_path = "haskell_module_repl_test", ) @@ -18,11 +13,6 @@ rules_haskell_integration_test( name = "haskell_module_repl_cross_library_deps_test", size = "small", srcs = ["HaskellModuleReplCrossLibraryDepsTest.hs"], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], workspace_path = "haskell_module_repl_cross_library_deps_test", ) diff --git a/tests/repl-targets/BUILD.bazel b/tests/repl-targets/BUILD.bazel index 8b88498f6d..bfa334d882 100644 --- a/tests/repl-targets/BUILD.bazel +++ b/tests/repl-targets/BUILD.bazel @@ -24,11 +24,6 @@ genrule( c2hs_library( name = "chs", srcs = ["Chs.chs"], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], ) haskell_library( @@ -39,11 +34,6 @@ haskell_library( ":chs", ":codegen", ], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], visibility = ["//visibility:public"], deps = [ "//tests:zlib", @@ -123,11 +113,6 @@ rules_haskell_integration_test( rules_haskell_integration_test( name = "hs_lib_repl_test", srcs = ["HsLibReplTest.hs"], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], workspace_path = "hs_lib_repl_test", ) diff --git a/tests/version-macros/BUILD.bazel b/tests/version-macros/BUILD.bazel index bd96527b8c..1b86c67086 100644 --- a/tests/version-macros/BUILD.bazel +++ b/tests/version-macros/BUILD.bazel @@ -70,11 +70,6 @@ haskell_module( c2hs_library( name = "c2hs-lib", srcs = ["C2hsLib.chs"], - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], version = "4.5.6.7", deps = [ ":versioned-lib", @@ -90,11 +85,6 @@ haskell_test( ":c2hs-lib", ], main_file = "MainC2hs.hs", - tags = [ - # See https://github.com/tweag/rules_haskell/issues/1486 - "dont_test_on_darwin_with_bindist", - "dont_test_on_windows", - ], version = "4.5.6.7", visibility = ["//tests/asterius/version-macros:__pkg__"], deps = [