2019-04-04 11:33:38 +03:00
|
|
|
# Bazel distributed cache, can be temporarily disabled by passing the following
|
|
|
|
# flag: --noremote_accept_cached
|
2019-04-26 10:52:50 +03:00
|
|
|
build:darwin --remote_http_cache=https://bazel-cache.da-ext.net
|
|
|
|
build:linux --remote_http_cache=https://bazel-cache.da-ext.net
|
|
|
|
build:windows-ci --remote_http_cache=https://bazel-cache.da-ext.net
|
2019-04-04 11:33:38 +03:00
|
|
|
build --remote_upload_local_results=false
|
|
|
|
# Enable the disk cache in addition to the http cache.
|
2019-07-31 17:51:29 +03:00
|
|
|
build:linux --disk_cache=.bazel-cache/disk
|
|
|
|
build:darwin --disk_cache=.bazel-cache/disk
|
2019-08-06 14:31:06 +03:00
|
|
|
fetch:linux --repository_cache=.bazel-cache/repo
|
|
|
|
fetch:darwin --repository_cache=.bazel-cache/repo
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2019-07-05 17:04:47 +03:00
|
|
|
# Required for node_modules trees generated by yarn_install.
|
|
|
|
common --experimental_allow_incremental_repository_updates
|
|
|
|
|
2019-04-04 11:33:38 +03:00
|
|
|
# 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
|
2019-05-14 22:55:45 +03:00
|
|
|
build:windows --action_env=JAVA_HOME
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Pass workspace status for stamped actions
|
|
|
|
build:linux --workspace_status_command=bazel_tools/workspace_status.sh
|
|
|
|
build:darwin --workspace_status_command=bazel_tools/workspace_status.sh
|
2019-04-12 14:25:31 +03:00
|
|
|
build:windows --workspace_status_command=bazel_tools/workspace_status.cmd
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
# Tell bazel to use the nixpkgs Haskell toolchain on Linux and Darwin
|
2019-08-13 17:46:31 +03:00
|
|
|
build:linux --host_platform=@rules_haskell//haskell/platforms:linux_x86_64_nixpkgs
|
|
|
|
build:darwin --host_platform=@rules_haskell//haskell/platforms:darwin_x86_64_nixpkgs
|
2019-04-12 14:25:31 +03:00
|
|
|
# and GHC's gcc on Windows
|
2019-08-13 17:46:31 +03:00
|
|
|
build:windows --crosstool_top=@rules_haskell_ghc_windows_amd64//:cc_toolchain
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
# Caching is currently disabled on Windows.
|
|
|
|
# See: https://github.com/tweag/rules_haskell/issues/744 for details.
|
2019-04-12 14:25:31 +03:00
|
|
|
build:windows --noremote_accept_cached
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
# 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.
|
2019-04-12 14:25:31 +03:00
|
|
|
build:windows-ci --remote_accept_cached=true
|
2019-04-04 11:33:38 +03:00
|
|
|
|
2019-04-09 11:30:01 +03:00
|
|
|
# Instruct bazel to globally use this flag for compiling protobuf files.
|
|
|
|
# We need the source info for generating proto docs. By default proto_library strips
|
|
|
|
# source information and doesn't provide an option to turn this flag on.
|
|
|
|
# Ideally we would only set this option for the proto_library target we care about.
|
|
|
|
# See https://github.com/bazelbuild/rules_go/issues/1519#issuecomment-451622947
|
2019-04-11 15:26:55 +03:00
|
|
|
build:linux --protocopt=--include_source_info
|
|
|
|
build:darwin --protocopt=--include_source_info
|
|
|
|
#FIXME: it generates stderr, which is causing error in bazel on windows:
|
|
|
|
# https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/command_line_interface.cc#L1363
|
|
|
|
#build:windows --protocopt=--include_source_info
|
2019-04-09 11:30:01 +03:00
|
|
|
|
2019-06-17 10:40:28 +03:00
|
|
|
# Some tools used in tests, like postgres CLI, require cmd.exe which can be located by them
|
|
|
|
# using ComSpec environment variable. By default it's not passed from Bazel client environment.
|
|
|
|
test:windows --test_env=ComSpec
|
|
|
|
|
2019-08-19 18:10:30 +03:00
|
|
|
# We default to -c opt. We compile Haskell with -O1 anyway since otherwise
|
|
|
|
# it is unusably slow and the C deps change rarely so there is little reason
|
|
|
|
# to not compile them with optimizations.
|
|
|
|
build -c opt
|
|
|
|
|
2019-04-04 11:33:38 +03:00
|
|
|
try-import %workspace%/.bazelrc.local
|