diff --git a/compiler/damlc/BUILD.bazel b/compiler/damlc/BUILD.bazel index ad58b34ab65..74cca8e45f3 100644 --- a/compiler/damlc/BUILD.bazel +++ b/compiler/damlc/BUILD.bazel @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//bazel_tools:haskell.bzl", "da_haskell_binary", "da_haskell_library", "da_haskell_repl", "da_haskell_test") +load("//daml-lf/language:daml-lf.bzl", "lf_docs_version") load("//rules_daml:daml.bzl", "daml_doc_test") load("@os_info//:os_info.bzl", "is_windows") load("//bazel_tools/packaging:packaging.bzl", "package_app") @@ -232,8 +233,9 @@ genrule( --output=$(OUTS) \ --package-name=daml-prim \ --format=Json \ + --target={} \ $(locations //compiler/damlc/daml-prim-src) - """, + """.format(lf_docs_version), tools = [ "//compiler/damlc", ], @@ -249,8 +251,9 @@ genrule( --output=$(OUTS) \ --package-name=daml-stdlib \ --format=Json \ + --target={} \ $(locations //compiler/damlc/daml-stdlib-src) - """, + """.format(lf_docs_version), tools = [ "//compiler/damlc", ], @@ -284,9 +287,10 @@ genrule( --base-url=https://docs.daml.com/daml/stdlib \\ --output-hoogle=$(location :daml-base-hoogle.txt) \\ --output-anchor=$(location :daml-base-anchors.json) \\ + --target={} \\ $(location :daml-stdlib.json) $(location :daml-prim.json) $(execpath //bazel_tools/sh:mktgz) $(location :daml-base-rst.tar.gz) daml-base-rst - """, + """.format(lf_docs_version), tools = [ "//bazel_tools/sh:mktgz", "//compiler/damlc", diff --git a/compiler/damlc/daml-stdlib-src/DA/Map.daml b/compiler/damlc/daml-stdlib-src/DA/Map.daml index 76a96c383df..d6233e14bb2 100644 --- a/compiler/damlc/daml-stdlib-src/DA/Map.daml +++ b/compiler/damlc/daml-stdlib-src/DA/Map.daml @@ -11,7 +11,10 @@ module DA.Map where #else --- | This module exports the generic map type `Map k v` and associated + +-- | Note: This is only supported in DAML-LF 1.11 or later. +-- +-- This module exports the generic map type `Map k v` and associated -- functions. This module should be imported qualified, for example: -- -- ``` diff --git a/compiler/damlc/daml-stdlib-src/DA/Set.daml b/compiler/damlc/daml-stdlib-src/DA/Set.daml index d5b38980e7c..5e1c76fdf03 100644 --- a/compiler/damlc/daml-stdlib-src/DA/Set.daml +++ b/compiler/damlc/daml-stdlib-src/DA/Set.daml @@ -11,7 +11,9 @@ module DA.Set where #else --- | This module exports the generic set type `Set k` and associated +-- | Note: This is only supported in DAML-LF 1.11 or later. +-- +-- This module exports the generic set type `Set k` and associated -- functions. This module should be imported qualified, for example: -- -- ``` diff --git a/daml-lf/language/daml-lf.bzl b/daml-lf/language/daml-lf.bzl index 197cf96a521..0f8fe1ed1f8 100644 --- a/daml-lf/language/daml-lf.bzl +++ b/daml-lf/language/daml-lf.bzl @@ -12,6 +12,14 @@ lf_latest_version = "1.11" lf_preview_version = ["1.12"] lf_dev_version = "1.dev" +# We generate docs for the latest preview version since releasing +# preview versions without docs for them is a bit annoying. +# Once we start removing modules in newer LF versions, we might +# have to come up with something more clever here to make +# sure that we don’t remove docs for a module that is still supported +# in a stable LF version. +lf_docs_version = lf_preview_version[0] if lf_preview_version != [] else lf_latest_version + # All LF versions for which we have protobufs. LF_VERSIONS = [ "1.6",