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 <andreas.herrmann@tweag.io>
This commit is contained in:
Andreas Herrmann 2020-06-24 12:10:12 +02:00 committed by GitHub
parent f0f682c847
commit 3ec80a05fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,7 @@ sh_binary(
cc_binary( cc_binary(
name = "daml", name = "daml",
srcs = ["daml.cc"], srcs = ["daml.cc"],
data = [":sdk/bin/daml"], data = [":sdk/bin/daml"] + glob(["sdk/sdk/{version}/**"]),
deps = ["@bazel_tools//tools/cpp/runfiles:runfiles"], deps = ["@bazel_tools//tools/cpp/runfiles:runfiles"],
) )
# Needed to provide the same set of DARs to the ledger that # 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/**"]), srcs = glob(["extracted-test-tool/ledger/test-common/**"]),
) )
exports_files(["daml-types.tgz", "daml-ledger.tgz", "daml-react.tgz", "create_daml_app.patch"]) exports_files(["daml-types.tgz", "daml-ledger.tgz", "daml-react.tgz", "create_daml_app.patch"])
""", """.format(version = ctx.attr.version),
) )
return None return None