From 7cf17f9c755aabd895105e8af0ea48f3040e171b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Tue, 22 Jan 2019 11:19:21 +0100 Subject: [PATCH] User-defined GHC flags override the default ones. When the same flag (eg. -vx) is instanciated several times with different values, GHC uses the outermost one. --- haskell/private/actions/compile.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/haskell/private/actions/compile.bzl b/haskell/private/actions/compile.bzl index 8fcb92367..9f387bc79 100644 --- a/haskell/private/actions/compile.bzl +++ b/haskell/private/actions/compile.bzl @@ -197,7 +197,6 @@ def _compilation_defaults(hs, cc, java, dep_info, srcs, import_dir_map, extra_sr if hs.mode == "opt": args.add("-O2") - args.add(ghc_args) args.add(["-static"]) if with_profiling: args.add("-prof", "-fexternal-interpreter") @@ -230,6 +229,8 @@ def _compilation_defaults(hs, cc, java, dep_info, srcs, import_dir_map, extra_sr "p_o", ]) + args.add(ghc_args) + # Pass source files for f in set.to_list(source_files): args.add(f)