Skip to content

Commit

Permalink
LF: replace "dev" LF version by "1.dev" in bazel files (#11894)
Browse files Browse the repository at this point in the history
the more consistent, as asked by Moritz in review of #11820

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
remyhaemmerle-da authored Nov 26, 2021
1 parent 8ef348d commit 58e69ad
Show file tree
Hide file tree
Showing 34 changed files with 76 additions and 81 deletions.
8 changes: 4 additions & 4 deletions daml-assistant/integration-tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ genrule(
name = "integration-tests-mvn",
srcs = [
"@mvn_dev_env//:mvn",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/archive:daml_lf_dev_archive_proto_java_pom",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java_pom",
"//language-support/java/bindings:libbindings-java.jar",
"//language-support/java/bindings:bindings-java_pom.xml",
"//language-support/java/bindings-rxjava:libbindings-rxjava.jar",
Expand Down Expand Up @@ -42,8 +42,8 @@ genrule(
tar xf $(location //docs:quickstart-java.tar.gz) -C "$$TMP_DIR"
install_mvn \\
"com.daml" "daml-lf-archive" \\
$$(echo $(locations //daml-lf/archive:daml_lf_dev_archive_proto_java) | xargs -n1 echo | grep -v -- '-src\\.jar$$') \\
$(location //daml-lf/archive:daml_lf_dev_archive_proto_java_pom)
$$(echo $(locations //daml-lf/archive:daml_lf_1.dev_archive_proto_java) | xargs -n1 echo | grep -v -- '-src\\.jar$$') \\
$(location //daml-lf/archive:daml_lf_1.dev_archive_proto_java_pom)
install_mvn \\
"com.daml" "bindings-java" \\
$(location //language-support/java/bindings:libbindings-java.jar) \\
Expand Down
19 changes: 10 additions & 9 deletions daml-lf/archive/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,22 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")
name = "daml_lf_%s_archive_proto" % version,
srcs = [":daml_lf_%s_archive_proto_srcs" % version],
javadoc_root_packages = ["com.daml.daml_lf_%s" % mangled_version],
maven_artifact_prefix = "daml-lf-%s-archive" % version,
maven_artifact_prefix = "daml-lf-%s-archive" % short_version,
maven_group = "com.daml",
strip_import_prefix = "src/%s/protobuf" % directory,
visibility = ["//visibility:public"],
),
]
for version in PROTO_LF_VERSIONS
for mangled_version in [mangle_for_java(version)]
for directory in ["main" if version == "dev" else "stable"]
for short_version in ["dev" if version == "1.dev" else version]
for mangled_version in [mangle_for_java(short_version)]
for directory in ["main" if version == "1.dev" else "stable"]
]

# FIXME(JM): Clean this up
genrule(
name = "daml_lf_dev_archive_haskell_proto_src",
srcs = ["daml_lf_dev_archive_proto_srcs"],
srcs = ["daml_lf_1.dev_archive_proto_srcs"],
outs = ["Com/Daml/DamlLfDev/DamlLf.hs"] +
["Com/Daml/DamlLfDev/DamlLf%s.hs" % v.title() for v in LF_MAJOR_VERSIONS],
cmd =
Expand Down Expand Up @@ -106,7 +107,7 @@ da_scala_library(
tags = ["maven_coordinates=com.daml:daml-lf-archive-reader:__VERSION__"],
visibility = ["//visibility:public"],
deps = [
":daml_lf_dev_archive_proto_java",
":daml_lf_1.dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/language",
"//libs-scala/nameof",
Expand Down Expand Up @@ -138,8 +139,8 @@ da_scala_test_suite(
],
scalacopts = lf_scalacopts,
deps = [
":daml_lf_1.dev_archive_proto_java",
":daml_lf_archive_reader",
":daml_lf_dev_archive_proto_java",
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/data",
"//daml-lf/language",
Expand All @@ -163,8 +164,8 @@ da_scala_test_suite(
scalacopts = lf_scalacopts,
deps = [
":daml_lf_1.14_archive_proto_java",
":daml_lf_1.dev_archive_proto_java",
":daml_lf_archive_reader",
":daml_lf_dev_archive_proto_java",
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/data",
"@maven//:com_google_protobuf_protobuf_java",
Expand All @@ -188,7 +189,7 @@ da_scala_binary(
],
)

SNASPSHOT_VERSIONS = [ver for ver in PROTO_LF_VERSIONS if ver != "dev"]
SNASPSHOT_VERSIONS = [ver for ver in PROTO_LF_VERSIONS if ver != "1.dev"]

[
sh_test(
Expand All @@ -203,7 +204,7 @@ SNASPSHOT_VERSIONS = [ver for ver in PROTO_LF_VERSIONS if ver != "dev"]
"proto_breaking_changes.sh",
"src/main/protobuf/com/daml/daml_lf_dev",
":daml_lf_%s_archive_proto_srcs" % version,
":daml_lf_dev_archive_proto_srcs",
":daml_lf_1.dev_archive_proto_srcs",
"@buf//:bin/buf",
],
)
Expand Down
4 changes: 2 additions & 2 deletions daml-lf/archive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ It produces several libraries containing code to encode / decode such
definition, a Haskell one, and several Java ones:

```
$ bazel build //daml-lf/archive:daml_lf_archive_haskell_proto
$ bazel build //daml-lf/archive:daml_lf_dev_archive_proto_java
$ bazel build //daml-lf/archive:daml_lf_dev_archive_haskell_proto
$ bazel build //daml-lf/archive:daml_lf_1.dev_archive_proto_java
$ bazel build //daml-lf/archive:daml_lf_1_14_archive_proto_java
```

Expand Down
Empty file.
Empty file.
16 changes: 8 additions & 8 deletions daml-lf/encoder/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ load(
)
load(
"//daml-lf/language:daml-lf.bzl",
"ENCODER_LF_VERSIONS",
"LF_VERSIONS",
"lf_version_configuration",
"mangle_for_java",
)
Expand All @@ -27,8 +27,8 @@ da_scala_library(
scalacopts = lf_scalacopts,
visibility = ["//visibility:public"],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/language",
"@maven//:com_google_protobuf_protobuf_java",
Expand All @@ -39,7 +39,7 @@ da_scala_test_suite(
name = "tests",
size = "small",
srcs = glob(["src/test/scala/**/*.scala"]),
data = [":testing-dar-%s" % target for target in ENCODER_LF_VERSIONS],
data = [":testing-dar-%s" % target for target in LF_VERSIONS],
scala_deps = [
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_matchers_core",
Expand All @@ -51,8 +51,8 @@ da_scala_test_suite(
deps = [
":encoder",
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/language",
"//daml-lf/parser",
Expand All @@ -72,8 +72,8 @@ da_scala_binary(
deps = [
":encoder",
"//:sdk-version-scala-lib",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/archive/encoder",
"//daml-lf/data",
"//daml-lf/language",
Expand All @@ -91,7 +91,7 @@ da_scala_binary(
"src/test/lf/*_%s_*.lf" % target,
]),
)
for target in ENCODER_LF_VERSIONS
for target in LF_VERSIONS
]

[
Expand Down Expand Up @@ -121,7 +121,7 @@ da_scala_binary(
],
),
]
for target in ENCODER_LF_VERSIONS
for target in LF_VERSIONS
]

[
Expand Down Expand Up @@ -161,6 +161,6 @@ EOF

filegroup(
name = "testing-dars",
srcs = ["testing-dar-%s" % version for version in ENCODER_LF_VERSIONS],
srcs = ["testing-dar-%s" % version for version in LF_VERSIONS],
visibility = ["//visibility:public"],
)
2 changes: 1 addition & 1 deletion daml-lf/engine/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ da_scala_test_suite(
deps = [
":engine",
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/interpreter",
"//daml-lf/language",
Expand Down
4 changes: 2 additions & 2 deletions daml-lf/interface/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ da_scala_library(
"//navigator:__subpackages__",
],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/language",
"@maven//:com_google_protobuf_protobuf_java",
Expand All @@ -50,8 +50,8 @@ da_scala_test(
scalacopts = lf_scalacopts,
deps = [
":interface",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/language",
"//daml-lf/parser",
Expand Down
2 changes: 1 addition & 1 deletion daml-lf/interpreter/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ da_scala_benchmark_jmh(
visibility = ["//visibility:public"],
deps = [
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/interpreter",
Expand Down
15 changes: 5 additions & 10 deletions daml-lf/language/daml-lf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ def _cmp(a, b):
return -1

def _cmp_lf_version(a, b):
if (a == "1.dev" or a == "dev") and (b == "1.dev" or b == "dev"):
if a == "1.dev" and b == "1.dev":
return 0
elif (a == "1.dev" or a == "dev"):
elif a == "1.dev":
return 1
elif (b == "1.dev" or b == "dev"):
elif b == "1.dev":
return -1
else:
aVer = _to_major_minor(a)
Expand Down Expand Up @@ -88,22 +88,17 @@ LF_VERSIONS = [
"1.12",
"1.13",
"1.14",
"dev",
"1.dev",
]

# All LF versions for which we have protobufs.
PROTO_LF_VERSIONS = [ver for ver in LF_VERSIONS if versions.gte(ver, "1.14")]

# The subset of LF versions accepted by //daml-lf/encoder
ENCODER_LF_VERSIONS = ["1.dev" if ver == "dev" else ver for ver in LF_VERSIONS]

# We support older LF versions using an older compiler binary
LEGACY_COMPILER_LF_VERSIONS = [ver for ver in LF_VERSIONS if versions.lte(ver, "1.13")]

# The subset of LF versions accepted by the compiler in the syntax
# expected by the --target option.
COMPILER_LF_VERSIONS = [ver for ver in ENCODER_LF_VERSIONS if ver not in LEGACY_COMPILER_LF_VERSIONS]

ALL_COMPILER_LF_VERSIONS = LEGACY_COMPILER_LF_VERSIONS + COMPILER_LF_VERSIONS
COMPILER_LF_VERSIONS = [ver for ver in LF_VERSIONS if ver not in LEGACY_COMPILER_LF_VERSIONS]

LF_MAJOR_VERSIONS = ["1"]
2 changes: 1 addition & 1 deletion daml-lf/scenario-interpreter/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ da_scala_benchmark_jmh(
visibility = ["//visibility:public"],
deps = [
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/interpreter",
Expand Down
2 changes: 1 addition & 1 deletion daml-lf/validation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ da_scala_benchmark_jmh(
visibility = ["//visibility:public"],
deps = [
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/interpreter",
Expand Down
2 changes: 1 addition & 1 deletion daml-script/export/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ da_scala_binary(
],
visibility = ["//visibility:public"],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/language",
"//language-support/scala/bindings",
Expand Down
2 changes: 1 addition & 1 deletion daml-script/runner/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ da_scala_library(
scalacopts = script_scalacopts,
visibility = ["//visibility:public"],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/interface",
Expand Down
4 changes: 2 additions & 2 deletions daml-script/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ da_scala_library(
visibility = ["//visibility:public"],
deps = [
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/interface",
"//daml-lf/interpreter",
Expand Down Expand Up @@ -178,8 +178,8 @@ da_scala_test_suite(
deps = [
":test-utils",
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/interface",
"//daml-lf/interpreter",
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ java_binary(
srcs = glob(["source/app-dev/bindings-java/quickstart/template-root/src/main/java/**/*.java"]) + [":quickstart-model-srcjar"],
main_class = "com.daml.quickstart.iou.IouMain",
deps = [
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//language-support/java/bindings:bindings-java",
"//language-support/java/bindings-rxjava",
"@maven//:ch_qos_logback_logback_classic",
Expand Down
9 changes: 4 additions & 5 deletions language-support/java/codegen/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ load(
)
load(
"//daml-lf/language:daml-lf.bzl",
"ALL_COMPILER_LF_VERSIONS",
"LF_VERSIONS",
"lf_version_configuration",
)
Expand Down Expand Up @@ -59,8 +58,8 @@ da_scala_library(
tags = ["maven_coordinates=com.daml:codegen-java-lib:__VERSION__"],
visibility = ["//visibility:public"],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/interface",
"//language-support/codegen-common",
Expand Down Expand Up @@ -162,7 +161,7 @@ scala_source_jar(
],
),
]
for target in ALL_COMPILER_LF_VERSIONS
for target in LF_VERSIONS
# we skip 1.13 as their serializable types are the same as 1.12.
# We include 1.14 since while it has no new serializable types
# it is the earliest version supported by HEAD damlc.
Expand All @@ -185,7 +184,7 @@ scala_source_jar(
),
target = ver,
)
for ver in ALL_COMPILER_LF_VERSIONS
for ver in LF_VERSIONS
]

daml_compile(
Expand Down Expand Up @@ -304,7 +303,7 @@ java_test(
],
),
]
for target in ALL_COMPILER_LF_VERSIONS
for target in LF_VERSIONS
# we skip 1.13 as their serializable types are the same as 1.12.
# We include 1.14 since while it has no new serializable types
# it is the earliest version supported by HEAD damlc.
Expand Down
2 changes: 1 addition & 1 deletion language-support/scala/codegen/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ da_scala_library(
"@maven//:ch_qos_logback_logback_classic",
],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/interface",
"@maven//:org_slf4j_slf4j_api",
Expand Down
2 changes: 1 addition & 1 deletion ledger-service/utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ da_scala_library(
tags = ["maven_coordinates=com.daml:http-json-utils:__VERSION__"],
visibility = ["//visibility:public"],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/interface",
"//daml-lf/language",
Expand Down
Loading

0 comments on commit 58e69ad

Please sign in to comment.