1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
load(
"@io_tweag_rules_haskell//haskell:haskell.bzl",
"haskell_library",
"haskell_test",
)
package(default_testonly = 1)
# empty library with package name "bytestring"
haskell_library(
name = "bytestring",
srcs = ["src/BS.hs"],
deps = ["//tests/hackage:base"],
)
# This depends on two packages "bytestring"
# There should be no CPP macro conflict
haskell_test(
name = "macro_conflict",
srcs = ["Main.hs"],
compiler_flags = [
"-XCPP",
"-Werror",
] + select({
# clang on darwin fails because of unused command line argument, it fails because of -Werror
"@bazel_tools//src/conditions:darwin": [
"-optP-Wno-unused-command-line-argument",
],
"//conditions:default": [],
}),
deps = [
":bytestring",
"//tests/hackage:base",
"//tests/hackage:bytestring",
],
)
|