Skip to content

Commit

Permalink
Fix concurrent DAML compilations on Windows
Browse files Browse the repository at this point in the history
Since Windows builds aren’t sandboxed properly (see
bazelbuild/bazel#5136), concurrent
compilations interact with the same tmp_db directory which leads to
flaky build failures.
  • Loading branch information
cocreature committed Apr 24, 2019
1 parent bd7b61b commit 34371af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions daml-foundations/daml-ghc/package-database/util.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ def _daml_package_rule_impl(ctx):
progress_message = "Compiling " + name + ".daml to daml-lf " + ctx.attr.daml_lf_version,
command = """
set -eou pipefail
mkdir -p tmp_db
tar xf {db_tar} -C tmp_db --strip-components 1
mkdir -p tmp_db/{daml_lf_version}
PACKAGEDB=$(mktemp -d)
tar xf {db_tar} -C "$PACKAGEDB" --strip-components 1
mkdir -p "$PACKAGEDB"/{daml_lf_version}
# Compile the dalf file
{damlc_bootstrap} compile \
--package-name {pkg_name} \
--package-db tmp_db \
--package-db "$PACKAGEDB" \
--write-iface \
--target {daml_lf_version} \
-o {dalf_file} \
Expand Down

0 comments on commit 34371af

Please sign in to comment.