daml/bazel_tools/haskell-opt.patch
Andreas Herrmann c97f923d8c
Use more deterministic distdir path in haskell_cabal_* (#11963)
* Update rules_haskell

changelog_begin
changelog_end

* Use mostly deterministic distdir path

changelog_begin
changelog_end

Use a path for distdir in the `haskell_cabal_*` rules that is based on
the package name and deterministic unless there is a collision with an
already existing file or directory.

The distdir path enters flags that are passed to GHC and thereby enters
the 'flag hash' field of the generated interface files. If the distdir
path is indeterministic, then the interface file will also be
indeterministic.

* Pin com_google_protobuf to 3.17.3

The latest version of rules_haskell pins protoc to 3.19.1. However, this
generates code that also requires a more recent version of the Java
proto libraries. This change pins the protoc version at the same version
as the protobuf-java library, see https://github.com/protocolbuffers/protobuf/issues/9236.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-12-02 19:25:26 +00:00

14 lines
508 B
Diff

diff --git a/haskell/private/actions/compile.bzl b/haskell/private/actions/compile.bzl
index d5f05bf2..e0e816a9 100644
--- a/haskell/private/actions/compile.bzl
+++ b/haskell/private/actions/compile.bzl
@@ -275,7 +275,7 @@ def _compilation_defaults(hs, cc, java, posix, dep_info, plugin_dep_info, srcs,
# Compilation mode. Allow rule-supplied compiler flags to override it.
if hs.mode == "opt":
- args.add("-O2")
+ args.add("-O")
args.add("-static")
if with_profiling: