-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop LF < 1.14 from supported damlc output versions (#11701)
* Drop LF < 1.14 from supported damlc output versions fixes #11319 We keep test coverage by depending on the most recent snapshot which still has 1.14 support. changelog_begin - [Daml Compiler] Damlc can only produce Daml-LF 1.14 or newer. Passing aynthing older to `--target` is an error. If you need to produce older versions, use an older SDK. changelog_end * Switch around legacy_compiler_lf_versions changelog_begin changelog_end * drop since-lf changelog_begin changelog_end
- Loading branch information
1 parent
ae8391e
commit 5785bbf
Showing
29 changed files
with
642 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
load("@os_info//:os_info.bzl", "is_windows", "os_name") | ||
load("@io_bazel_rules_scala//scala:scala_cross_version.bzl", "default_maven_server_urls") | ||
|
||
runfiles_library = """ | ||
# Copy-pasted from the Bazel Bash runfiles library v2. | ||
set -uo pipefail; f=bazel_tools/tools/bash/runfiles/runfiles.bash | ||
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ | ||
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ | ||
source "$0.runfiles/$f" 2>/dev/null || \ | ||
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ | ||
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ | ||
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e | ||
# --- end runfiles.bash initialization v2 --- | ||
""" | ||
|
||
def _damlc_legacy_impl(ctx): | ||
out_dir = ctx.path("damlc") | ||
|
||
ctx.download_and_extract( | ||
output = out_dir, | ||
url = "https://github.com/digital-asset/daml/releases/download/v{}/daml-sdk-{}-{}.tar.gz".format(ctx.attr.version, ctx.attr.version, ctx.attr.os_name), | ||
sha256 = ctx.attr.sha256[ctx.attr.os_name], | ||
stripPrefix = "sdk-{}/damlc".format(ctx.attr.version), | ||
) | ||
|
||
ctx.file( | ||
"damlc.sh", | ||
content = | ||
"""#!/usr/bin/env bash | ||
{runfiles_library} | ||
$(rlocation damlc_legacy/damlc/damlc.exe) $@ | ||
""".format(runfiles_library = runfiles_library), | ||
) if is_windows else None | ||
|
||
ctx.file( | ||
"BUILD", | ||
content = | ||
""" | ||
load("@os_info//:os_info.bzl", "is_windows") | ||
package(default_visibility = ["//visibility:public"]) | ||
sh_binary( | ||
name = "damlc_legacy", | ||
srcs = [":damlc/damlc"], | ||
) if not is_windows else sh_binary( | ||
name = "damlc_legacy", | ||
srcs = [":damlc.sh"], | ||
deps = ["@bazel_tools//tools/bash/runfiles"], | ||
data = ["damlc/damlc.exe"], | ||
) | ||
""".format(version = ctx.attr.version), | ||
) | ||
return None | ||
|
||
damlc_legacy = repository_rule( | ||
implementation = _damlc_legacy_impl, | ||
attrs = { | ||
"version": attr.string(mandatory = True), | ||
"os_name": attr.string(mandatory = False, default = os_name), | ||
"sha256": attr.string_dict(mandatory = True), | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.