Add a compile-only damlc target (#9164)

This untangles the dependency structure a bit so that //daml-lf no
longer ends up depending on daml script and sandbox and similar crap
which should improve build times in general.

changelog_begin
changelog_end
This commit is contained in:
Moritz Kiefer 2021-03-17 10:31:37 +01:00 committed by GitHub
parent bbea484a11
commit f6effb228a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 12 deletions

View File

@ -22,6 +22,18 @@ damlc_data = [
"//compiler/scenario-service/server:scenario_service_jar",
]
add_data(
name = "damlc-compile-only",
data = [
ghc_pkg,
"//compiler/damlc:ghcversion",
"//compiler/damlc:hpp",
"//compiler/damlc/pkg-db",
],
executable = ":damlc-bootstrap",
visibility = ["//visibility:public"],
)
add_data(
name = "damlc",
data = damlc_data,

View File

@ -38,11 +38,11 @@ daml_compile(
srcs = ["daml-lf-test.sh"],
args = [
"$(location //daml-lf/repl:repl)",
"$(location //compiler/damlc)",
"$(location //compiler/damlc:damlc-compile-only)",
"$(location :%s.dar)" % name,
],
data = [
"//compiler/damlc",
"//compiler/damlc:damlc-compile-only",
"//daml-lf/repl",
":%s.dar" % name,
],
@ -60,13 +60,13 @@ daml_compile(
srcs = ["scenario/test.sh"],
args = [
"$(location //daml-lf/repl:repl)",
"$(location //compiler/damlc)",
"$(location //compiler/damlc:damlc-compile-only)",
"$(location :%s)" % file,
"$(POSIX_DIFF)",
"false",
],
data = [
"//compiler/damlc",
"//compiler/damlc:damlc-compile-only",
"//daml-lf/repl",
file,
"%s/EXPECTED.ledger" % "/".join(file.split("/")[0:3]),
@ -88,13 +88,13 @@ daml_compile(
srcs = ["scenario/test.sh"],
args = [
"$(location //daml-lf/repl:repl)",
"$(location //compiler/damlc)",
"$(location //compiler/damlc:damlc-compile-only)",
"$(location :%s)" % file,
"$(POSIX_DIFF)",
"true",
],
data = [
"//compiler/damlc",
"//compiler/damlc:damlc-compile-only",
"//daml-lf/repl",
file,
"%s/EXPECTED.ledger" % "/".join(file.split("/")[0:3]),

View File

@ -6,7 +6,7 @@ load("//bazel_tools/sh:sh.bzl", "sh_inline_test")
_damlc = attr.label(
allow_single_file = True,
default = Label("//compiler/damlc"),
default = Label("//compiler/damlc:damlc-compile-only"),
executable = True,
cfg = "host",
doc = "The DAML compiler.",
@ -213,7 +213,7 @@ def _daml_validate_test(
name,
dar,
**kwargs):
damlc = "//compiler/damlc"
damlc = "//compiler/damlc:damlc-compile-only"
sh_inline_test(
name = name,
data = [damlc, dar],
@ -236,10 +236,10 @@ def _inspect_dar(base):
name = name,
srcs = [
dar,
"//compiler/damlc",
"//compiler/damlc:damlc-compile-only",
],
outs = [pp],
cmd = "$(location //compiler/damlc) inspect $(location :" + dar + ") > $@",
cmd = "$(location //compiler/damlc:damlc-compile-only) inspect $(location :" + dar + ") > $@",
)
_default_project_version = "1.0.0"
@ -323,7 +323,7 @@ def daml_test(
srcs = [],
deps = [],
data_deps = [],
damlc = "//compiler/damlc",
damlc = "//compiler/damlc:damlc",
target = None,
**kwargs):
sh_inline_test(
@ -377,7 +377,7 @@ def daml_doc_test(
ignored_srcs = [],
flags = [],
cpp = "@stackage-exe//hpp",
damlc = "//compiler/damlc",
damlc = "//compiler/damlc:damlc",
**kwargs):
sh_inline_test(
name = name,