Clean before running daml build (#2816)

This should hopefully fix some of the flakiness we’ve been seeing on
Windows. Not entirely sure what’s going wrong without the clean but
since this only happens the lack of sandboxing seems like the most
likely difference.
This commit is contained in:
Moritz Kiefer 2019-09-08 19:49:00 +02:00 committed by mergify[bot]
parent cc452a626f
commit f1a9afdf17
2 changed files with 17 additions and 9 deletions

View File

@ -9,17 +9,21 @@ genrule(
srcs = glob(["**/*.daml"]),
outs = ["trigger.dar"],
cmd = """
cat << EOF > daml.yaml
set -eou pipefail
TMP_DIR=$$(mktemp -d)
mkdir -p $$TMP_DIR/daml/Daml
cp -L $(location Daml/Trigger.daml) $$TMP_DIR/daml/Daml
cat << EOF > $$TMP_DIR/daml.yaml
sdk-version: 0.0.0
name: trigger
source: triggers/daml
source: daml
version: 0.0.1
dependencies:
- daml-stdlib
- daml-prim
EOF
$(location //compiler/damlc) build -o $(location trigger.dar)
$(location //compiler/damlc) build --project-root=$$TMP_DIR -o $$PWD/$(location trigger.dar)
rm -rf $$TMP_DIR
""",
tools = ["//compiler/damlc"],
visibility = ["//visibility:public"],

View File

@ -19,18 +19,22 @@ genrule(
outs = ["acs.dar"],
cmd = """
set -eou pipefail
cat << EOF > daml.yaml
TMP_DIR=$$(mktemp -d)
mkdir -p $$TMP_DIR/daml
cp -L $(location :daml/ACS.daml) $$TMP_DIR/daml
cp -L $(location //triggers/daml:trigger.dar) $$TMP_DIR/
cat << EOF > $$TMP_DIR/daml.yaml
sdk-version: 0.0.0
name: acs
source: triggers/tests/daml
source: daml
version: 0.0.1
dependencies:
- daml-stdlib
- daml-prim
- $(location //triggers/daml:trigger.dar)
- trigger.dar
EOF
$(location //compiler/damlc) build -o $(location acs.dar)
$(location //compiler/damlc) build --project-root=$$TMP_DIR -o $$PWD/$(location acs.dar)
rm -rf $$TMP_DIR
""",
tools = ["//compiler/damlc"],
visibility = ["//visibility:public"],