forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbazelrc
79 lines (63 loc) · 3.52 KB
/
bazelrc
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
# Bazel distributed cache, can be temporarily disabled by passing the following
# flag: --noremote_accept_cached
build --remote_http_cache=https://bazel-cache.da-ext.net
build --remote_upload_local_results=false
# Enable the disk cache in addition to the http cache.
# Requires nix/overrides/bazel/combined_cache.patch, so disabled for Windows!
build:linux --disk_cache=.bazel-cache
build:darwin --disk_cache=.bazel-cache
# Improve remote cache hit rate by exluding environment variables from the
# sandbox that are not whitelisted using --action_env.
# This will become the default in a future Bazel release.
build --experimental_strict_action_env
# Print test output of failed test.
# Set --test_output=streamed to get the output of all tests in real time.
# Note, this will force tests to run locally and sequentially.
test --test_output=errors
# print verbose failures
build --verbose_failures
# Enable persistent Scala workers to improve compilation times.
# Refer to https://github.com/bazelbuild/rules_scala#readme for details.
build --strategy=Scalac=worker
test --strategy=Scalac=worker
# Activate MacOS fix for "ld: illegal thread local variable reference
# to regular symbol". See
# https://github.com/grpc/grpc/pull/13929/files
build --copt -DGRPC_BAZEL_BUILD
# Bazel defaults to JDK9. This makes sure we run Nix provided JDK, and
# avoid dreaded "Unrecognized VM option 'CompactStrings'" error
build --host_javabase=@java_home//:javabase
build --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
# Do not use a distinct configuration for "host", that is, binaries used
# at build time should be the same as release binaries.
# Without this, we will end up building everything twice as we need "damlc"
# at build time to bootstrap itself (for compiling ghc-prim).
build --distinct_host_configuration=false
# Propagate locales and the java home to the test environment.
test --test_env=LANG=en_US.utf8 --test_env=LOCALE_ARCHIVE --test_env=JAVA_HOME
# Disable c-ares support in grpc. We don't need a faster DNS library
# since we're only connecting to localhost.
build --define=grpc_no_ares=true
# Pass through cacert information for git.
build --action_env=GIT_SSL_CAINFO
# Pass through locale archive to ensure that we can get a UTF-8 locale.
build:linux --action_env=LOCALE_ARCHIVE
# Pass workspace status for stamped actions
# We skip this on Windows, otherwise bazel fails with
# "Access is denied."
# most likely when trying to evaluate the shebang.
build:linux --workspace_status_command=bazel_tools/workspace_status.sh
build:darwin --workspace_status_command=bazel_tools/workspace_status.sh
# Tell bazel to use the nixpkgs Haskell toolchain on Linux and Darwin
build:linux --host_platform=@io_tweag_rules_haskell//haskell/platforms:linux_x86_64_nixpkgs
build:darwin --host_platform=@io_tweag_rules_haskell//haskell/platforms:darwin_x86_64_nixpkgs
# Tell bazel to use GHC's gcc on Windows
# Caching is currently disabled on Windows.
# See: https://github.com/tweag/rules_haskell/issues/744 for details.
build:windows --crosstool_top=@io_tweag_rules_haskell_ghc_windows_amd64//:toolchain --noremote_accept_cached --noremote_upload_local_results
# We use a special windows configuration on CI: cache is enabled. The caching
# is not totally reliable on Windows yet re. absolute paths, but it is not a
# problem on CI if all builds share a similar directory structure.
build:windows-ci --crosstool_top=@io_tweag_rules_haskell_ghc_windows_amd64//:toolchain
try-import %workspace%/.bazelrc.local