Skip to content

Commit

Permalink
Use the cc tool for c2hs instead of cpp
Browse files Browse the repository at this point in the history
Re-activate tests that had been disabled because of `c2hs` failing with `clang: error: no input files`.

Fixes #1486
  • Loading branch information
avdv committed Jul 12, 2022
1 parent 072e23b commit 92e9431
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 56 deletions.
2 changes: 1 addition & 1 deletion haskell/c2hs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
15 changes: 0 additions & 15 deletions tests/c2hs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)

Expand All @@ -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"],
)

Expand Down
5 changes: 0 additions & 5 deletions tests/c2hs/repo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
10 changes: 0 additions & 10 deletions tests/haskell_module/repl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,13 @@ 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",
)

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",
)

Expand Down
15 changes: 0 additions & 15 deletions tests/repl-targets/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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",
Expand Down Expand Up @@ -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",
)

Expand Down
10 changes: 0 additions & 10 deletions tests/version-macros/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 = [
Expand Down

0 comments on commit 92e9431

Please sign in to comment.