-
Notifications
You must be signed in to change notification settings - Fork 79
/
BUILD.bazel
158 lines (139 loc) · 3.73 KB
/
BUILD.bazel
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
load(
"@rules_haskell//haskell:private/haskell_impl.bzl",
"haskell_toolchain_libraries",
)
load(
"@rules_haskell//haskell:private/cc_wrapper.bzl",
"cc_wrapper",
)
load(
"@rules_haskell//haskell:cabal_wrapper.bzl",
"cabal_wrapper",
)
load(
"@rules_haskell//haskell:toolchain_info.bzl",
"haskell_toolchain_info",
)
exports_files(
glob(["*.bzl"]) + [
"assets/ghci_script",
"private/cabal_wrapper.sh.tpl",
"private/cabal_wrapper.py",
"private/coverage_wrapper.sh.tpl",
"private/ghci_repl_wrapper.sh",
"private/haddock_wrapper.sh.tpl",
"private/cc_wrapper.py.tpl",
"private/cc_wrapper_windows.sh.tpl",
"private/pkgdb_to_bzl.py",
],
)
# to make functions visible to unit tests
exports_files(
["private/actions/link.bzl"],
visibility = ["//tests/unit-tests:__pkg__"],
)
exports_files(
["private/ghc_wrapper.sh"],
visibility = ["//tests/shellcheck:__pkg__"],
)
bzl_library(
name = "bazel_json",
srcs = [
"//vendor/bazel_json/lib:json_parser.bzl",
],
)
# @bazel_tools//tools does not define a bzl_library itself, instead we are
# supposed to define our own using the @bazel_tools//tools:bzl_srcs filegroup.
# See https://github.com/bazelbuild/skydoc/issues/166
bzl_library(
name = "bazel_tools",
srcs = [
"@bazel_tools//tools:bzl_srcs",
],
)
bzl_library(
name = "haskell",
srcs = glob(["**/*.bzl"]),
visibility = ["//visibility:public"],
deps = [
":bazel_json",
":bazel_tools",
"@bazel_skylib//lib:collections",
"@bazel_skylib//lib:dicts",
"@bazel_skylib//lib:paths",
"@bazel_skylib//lib:shell",
"@bazel_skylib//lib:versions",
"@io_tweag_rules_nixpkgs//nixpkgs",
"@rules_sh//sh:posix",
],
)
cc_wrapper(
name = "cc_wrapper",
visibility = ["//visibility:public"],
)
cabal_wrapper(
name = "cabal_wrapper",
visibility = ["//visibility:public"],
)
py_binary(
name = "pkgdb_to_bzl",
srcs = ["private/pkgdb_to_bzl.py"],
visibility = ["//visibility:public"],
)
py_library(
name = "package_configuration",
srcs = ["private/package_configuration.py"],
imports = ["private"],
visibility = ["//tests/package_configuration:__subpackages__"],
)
py_binary(
name = "ls_modules",
srcs = ["private/ls_modules.py"],
visibility = ["//visibility:public"],
deps = [":package_configuration"],
)
sh_binary(
name = "ghc_wrapper",
srcs = ["private/ghc_wrapper.sh"],
visibility = ["//visibility:public"],
)
py_binary(
name = "version_macros",
srcs = ["private/version_macros.py"],
visibility = ["//visibility:public"],
)
# generate the _GHC_BINDISTS dict
py_binary(
name = "gen-ghc-bindist",
srcs = [":gen_ghc_bindist.py"],
main = ":gen_ghc_bindist.py",
visibility = ["//visibility:public"],
)
# toolchains must have a valid toolchain_type from bazel 0.21
toolchain_type(
name = "toolchain",
visibility = ["//visibility:public"],
)
toolchain_type(
name = "doctest-toolchain",
visibility = ["//visibility:public"],
)
# XXX: This target is a work-around for toolchain transitions not being
# implemented, yet. See
# https://github.com/bazelbuild/proposals/blob/master/designs/2019-02-12-toolchain-transitions.md
# This will need to be revisited once that proposal is implemented.
haskell_toolchain_libraries(
name = "toolchain-libraries",
visibility = ["//visibility:public"],
)
config_setting(
name = "use_worker",
define_values = {
"use_worker": "True",
},
)
haskell_toolchain_info(
name = "toolchain_info",
)