daml/compatibility/bazel_tools/BUILD
Moritz Kiefer d6e5862645
Add platform-version field to daml.yaml (#6736)
* Add `platform-version` field to `daml.yaml`

This PR adds the `platform-version` field to `daml.yaml`. Based on the
approach agreed upon in #6558, the logic for this all sits in
`daml-helper` and there are no changes to the assistant.

The details of how the logic work are in a comment so I’m not going to
repeat them here but the commands that are affected are:

- `daml sandbox`
- `daml sandbox-classic`
- `daml json-api`
- `daml start` (but only for sandbox and the JSON API, not for
  Navigator or anything else)

For tests, I’ve added a test to the compat workspace that installs two
SDKs simultaneously and tries out various combinations and verifies
that we get the correct version. Open to other ideas for testing this
but that seemed like the most sensible option that actually tests what
we run.

changelog_begin

- [DAML Assistant] You can now specify the version of Sandbox and the
  JSON API independently of your SDK version by setting
  ``platform-version`` in your ``daml.yaml``. This is useful if you
  are deploying to a ledger that is running components from a
  different SDK version. See
  https://docs.daml.com/tools/assistant.html#project-config-file-daml-yaml
  for details.

changelog_end

* Run platform-version tests

changelog_begin
changelog_end

* Fix tag globbing

changelog_begin
changelog_end

* fmt

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* Try to fix env vars

changelog_begin
changelog_end

* Remove hardcoded references to 1.2.0

changelog_begin
changelog_end

* Rephrase doc comment

changelog_begin
changelog_end

* get things to compile

changelog_begin
changelog_end

* maybe fix things for realz

changelog_begin
changelog_end

* Remove debugging output

changelog_begin
changelog_end

* Get angry at windows

changelog_begin
changelog_end

* why is windows

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2020-07-15 16:30:01 +02:00

31 lines
633 B
Python

load("@daml//bazel_tools:haskell.bzl", "da_haskell_library")
load("//:versions.bzl", "latest_stable_version")
exports_files([
"daml_ledger_test.sh",
"create_daml_app_test.sh",
"sandbox-with-postgres.sh",
"daml.cc",
])
genrule(
name = "versions-hs-lib-gen",
srcs = [],
outs = ["Versions.hs"],
cmd = """
cat > $@ <<EOF
module Versions where
latestStableVersion :: String
latestStableVersion = "{}"
EOF
""".format(latest_stable_version),
)
da_haskell_library(
name = "versions-hs-lib",
srcs = [":Versions.hs"],
hackage_deps = ["base"],
visibility = ["//visibility:public"],
)