From 3ec80a05fd97ed1a23e07992369f22836d0bb407 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com> Date: Wed, 24 Jun 2020 12:10:12 +0200 Subject: [PATCH] Track runfile dependencies of SDK assistant (#6462) The //:migration-stable test-cases had issues with test results not being invalidated after an update of the HEAD SDK. This may be due to the SDK distribution files being undeclared dependencies of the `daml` binary. This change adds the SDK distribution files to the `data` attribute of the generated `daml` `cc_binary` to ensure that changes are noticed by Bazel and cached test-cases invalidated. The corresponding runfiles tree includes a symlink per file of the SDK release. At the time of commit this amounts to ~9MiB of symlinks for one SDK version (0.0.0 in particular). CHANGELOG_BEGIN CHANGELOG_END Co-authored-by: Andreas Herrmann --- compatibility/bazel_tools/daml_sdk.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compatibility/bazel_tools/daml_sdk.bzl b/compatibility/bazel_tools/daml_sdk.bzl index b643b17f6b..bb494a6d83 100644 --- a/compatibility/bazel_tools/daml_sdk.bzl +++ b/compatibility/bazel_tools/daml_sdk.bzl @@ -128,7 +128,7 @@ sh_binary( cc_binary( name = "daml", srcs = ["daml.cc"], - data = [":sdk/bin/daml"], + data = [":sdk/bin/daml"] + glob(["sdk/sdk/{version}/**"]), deps = ["@bazel_tools//tools/cpp/runfiles:runfiles"], ) # Needed to provide the same set of DARs to the ledger that @@ -138,7 +138,7 @@ filegroup( srcs = glob(["extracted-test-tool/ledger/test-common/**"]), ) exports_files(["daml-types.tgz", "daml-ledger.tgz", "daml-react.tgz", "create_daml_app.patch"]) -""", +""".format(version = ctx.attr.version), ) return None