mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-11 06:01:46 +03:00
Fix concurrent DAML compilations on Windows (#679)
Since Windows builds aren’t sandboxed properly (see https://github.com/bazelbuild/bazel/issues/5136), concurrent compilations interact with the same tmp_db directory which leads to flaky build failures.
This commit is contained in:
parent
963d0779c3
commit
16d82f61c2
@ -77,14 +77,17 @@ 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}
|
||||
# Since we don't have sandboxing on Windows, that directory might
|
||||
# exist from a previous build.
|
||||
rm -rf {package_db_name}
|
||||
mkdir -p {package_db_name}
|
||||
tar xf {db_tar} -C {package_db_name} --strip-components 1
|
||||
mkdir -p {package_db_name}/{daml_lf_version}
|
||||
|
||||
# Compile the dalf file
|
||||
{damlc_bootstrap} compile \
|
||||
--package-name {pkg_name} \
|
||||
--package-db tmp_db \
|
||||
--package-db {package_db_name} \
|
||||
--write-iface \
|
||||
--target {daml_lf_version} \
|
||||
-o {dalf_file} \
|
||||
@ -94,6 +97,7 @@ def _daml_package_rule_impl(ctx):
|
||||
""".format(
|
||||
main = modules[ctx.attr.main],
|
||||
name = name,
|
||||
package_db_name = "package_db_for_" + name,
|
||||
damlc_bootstrap = ctx.executable.damlc_bootstrap.path,
|
||||
dalf_file = ctx.outputs.dalf.path,
|
||||
daml_lf_version = ctx.attr.daml_lf_version,
|
||||
|
Loading…
Reference in New Issue
Block a user