-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.nix.part
65 lines (56 loc) · 1.98 KB
/
BUILD.nix.part
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
#
# Inserted into BUILD in nix-build mode, to replicate the haskell toolchain
# setup that rules_haskell would normally do. See WORKSPACE.nix.part
# file for explaining why is this needed.
#
load(
"@rules_haskell//haskell:defs.bzl",
"haskell_toolchain",
"haskell_import",
)
# MARK: CUT START
# Note: toolchain_libraries should be put here, generated by the rules_haskell python script.
# MARK: CUT END
haskell_toolchain(
name = "ghctc",
compiler_flags =
[
"-threaded", # Use multicore runtime
"-rtsopts", # Enable specifying runtime options on command line.
# Set default RTS options.
# -maxN<X>: use up to X cores if available.
# -qn4: only use 4 cores for parallel GC.
# -A64m: use larger allocation area.
# -n4m: use allocation chunks, which can be beneficial on multicore.
# See https://simonmar.github.io/posts/2015-07-28-optimising-garbage-collection-overhead-in-sigma.html.
# -T: make gc stats available in-program
# -t: print one-line GC statistics to stderr on exit.
"-with-rtsopts=-maxN8 -qn4 -A64m -n4m -T -t",
# Switch on useful extra warnings, and make warnings compilation
# error.
"-Wall",
"-Werror",
"-Wcompat",
"-Wincomplete-record-updates",
"-Wincomplete-uni-patterns",
"-Wredundant-constraints",
],
tools = ["@ghc//:bin"],
version = "8.6.5",
is_static = False,
libraries = toolchain_libraries,
locale_archive = "@glibc_locales//:locale-archive",
)
toolchain(
name = "ghc_toolchain",
toolchain_type = "@rules_haskell//haskell:toolchain",
toolchain = ":ghctc",
exec_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:x86_64",
],
target_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:x86_64",
],
)