Skip to content

Commit

Permalink
Compile with optimizations on Windows (digital-asset#2571)
Browse files Browse the repository at this point in the history
  • Loading branch information
cocreature authored and mergify[bot] committed Aug 16, 2019
1 parent b3cf9df commit 992b46c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 8 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ exports_files(glob(["lib/**/*"]))
repositories = dev_env_nix_repos,
) if not is_windows else None

common_ghc_flags = [
"-O1",
"-hide-package=ghc-boot-th",
"-hide-package=ghc-boot",
]

# Used by Darwin and Linux
haskell_register_ghc_nixpkgs(
attribute_path = "ghcStaticDwarf" if enable_ghc_dwarf else "ghcStatic",
Expand All @@ -265,11 +271,8 @@ haskell_register_ghc_nixpkgs(
# we get a similar behavior on Darwin by default.
# However, we had to disable split-sections for now as it seems to interact very badly
# with the GHCi linker to the point where :main takes several minutes rather than several seconds.
compiler_flags = [
"-O1",
compiler_flags = common_ghc_flags + [
"-fexternal-dynamic-refs",
"-hide-package=ghc-boot-th",
"-hide-package=ghc-boot",
] + (["-g3"] if enable_ghc_dwarf else []),
compiler_flags_select = {
"@com_github_digital_asset_daml//:profiling_build": ["-fprof-auto"],
Expand All @@ -290,6 +293,7 @@ haskell_register_ghc_nixpkgs(

# Used by Windows
haskell_register_ghc_bindists(
compiler_flags = common_ghc_flags,
version = "8.6.5",
) if is_windows else None

Expand Down
3 changes: 3 additions & 0 deletions unreleased.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ HEAD — ongoing

+ [Documentation] Added platform-independent tips for testing
+ [DAML Compiler] Some issues that caused ``damlc test`` to crash on shutdown have been fixed.
+ [DAML Compiler] The DAML compiler was accidentally compiled without
optimizations on Windows. This has been fixed which should improve
the performance of ``damlc`` and ``daml studio`` on Windows.

0 comments on commit 992b46c

Please sign in to comment.