From c75387e8ad494d158809e962652733533110b32b Mon Sep 17 00:00:00 2001 From: thesayyn Date: Fri, 22 Sep 2023 12:32:00 -0700 Subject: [PATCH] refactor: consume tools from source if unstamped --- .bazelrc | 16 ++-- .github/workflows/release.yml | 5 -- .github/workflows/release_prep.sh | 4 + .pre-commit-config.yaml | 8 -- MODULE.bazel | 15 ++++ WORKSPACE | 11 ++- deps.bzl | 4 +- e2e/copy_to_directory/.bazelrc | 0 e2e/copy_to_directory/WORKSPACE | 21 +++++ e2e/smoke/WORKSPACE | 21 +++++ lib/BUILD.bazel | 1 + lib/private/copy_directory_toolchain.bzl | 5 +- lib/private/copy_to_directory_toolchain.bzl | 5 +- lib/private/docs/BUILD.bazel | 17 +++- lib/private/expand_template_toolchain.bzl | 5 +- lib/private/source_toolchains_repo.bzl | 90 +++++++++++++++++++++ lib/repositories.bzl | 38 +++++++++ scripts/check_versions.sh | 41 ---------- scripts/generate_versions.sh | 10 --- tools/BUILD.bazel | 59 ++++---------- tools/create_versions.sh | 15 +--- tools/release.bzl | 29 +------ tools/source_toolchain.bzl | 17 ---- tools/sri.bzl | 26 ++++++ tools/version.bzl | 5 ++ tools/versions.bzl | 28 ------- 26 files changed, 279 insertions(+), 217 deletions(-) delete mode 100644 e2e/copy_to_directory/.bazelrc create mode 100644 lib/private/source_toolchains_repo.bzl delete mode 100755 scripts/check_versions.sh delete mode 100755 scripts/generate_versions.sh delete mode 100644 tools/source_toolchain.bzl create mode 100644 tools/sri.bzl create mode 100644 tools/version.bzl delete mode 100644 tools/versions.bzl diff --git a/.bazelrc b/.bazelrc index c32f7c868..573cbd548 100644 --- a/.bazelrc +++ b/.bazelrc @@ -2,14 +2,14 @@ # Settings that apply only to CI are in .aspect/bazelrc/ci.bazelrc # Import Aspect bazelrc presets -import %workspace%/.aspect/bazelrc/convenience.bazelrc -import %workspace%/.aspect/bazelrc/correctness.bazelrc -import %workspace%/.aspect/bazelrc/performance.bazelrc -import %workspace%/.aspect/bazelrc/debug.bazelrc -import %workspace%/.aspect/bazelrc/javascript.bazelrc +import .aspect/bazelrc/convenience.bazelrc +import .aspect/bazelrc/correctness.bazelrc +import .aspect/bazelrc/performance.bazelrc +import .aspect/bazelrc/debug.bazelrc +import .aspect/bazelrc/javascript.bazelrc # Use a try-import for Bazel 6 settings since this repository is also tested against Bazel 5 on CI -try-import %workspace%/.aspect/bazelrc/bazel6.bazelrc +try-import .aspect/bazelrc/bazel6.bazelrc ### PROJECT SPECIFIC OPTIONS ### @@ -19,10 +19,6 @@ build --embed_label=v1.2.3 # Mock versioning command to test the --stamp behavior build --workspace_status_command="echo BUILD_SCM_VERSION 1.2.3" -# For testing always use toolchains from source -build --@aspect_bazel_lib//tools:use_source_toolchains -build --extra_toolchains=//tools:all - # For releasing, use --workspace_status_command and stamp common:release --workspace_status_command "${PWD}/workspace_status.sh" common:release -c opt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83df8647f..14c37cef1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,11 +27,6 @@ jobs: # Bazelisk will download bazel to here XDG_CACHE_HOME: ~/.cache/bazel-repo run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //... - - name: Check Versions - env: - # Bazelisk will download bazel to here - XDG_CACHE_HOME: ~/.cache/bazel-repo - run: ./scripts/check_versions.sh ${{ env.GITHUB_REF_NAME }} - name: Build release artifacts run: | if [ -n "$(git status --porcelain)" ]; then diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh index 6308bb4d2..010d4fd33 100755 --- a/.github/workflows/release_prep.sh +++ b/.github/workflows/release_prep.sh @@ -7,6 +7,10 @@ set -o errexit -o nounset -o pipefail cat >.git/info/attributes <` -load("//tools:versions.bzl", "COPY_DIRECTORY_INTEGRITY", "COPY_DIRECTORY_VERSION") +load("//tools:sri.bzl", "COPY_DIRECTORY_INTEGRITY") +load("//tools:version.bzl", "VERSION") # Platform names follow the platform naming convention in @aspect_bazel_lib//:lib/private/repo_utils.bzl COPY_DIRECTORY_PLATFORMS = { @@ -158,7 +159,7 @@ def _copy_directory_platform_repo_impl(rctx): # https://github.com/aspect-build/bazel-lib/releases/download/v1.19.0/copy_directory-linux_amd64 url = "https://github.com/aspect-build/bazel-lib/releases/download/v{0}/copy_directory-{1}{2}".format( - COPY_DIRECTORY_VERSION, + VERSION, release_platform, ".exe" if is_windows else "", ) diff --git a/lib/private/copy_to_directory_toolchain.bzl b/lib/private/copy_to_directory_toolchain.bzl index 1b687c44c..df26203f5 100644 --- a/lib/private/copy_to_directory_toolchain.bzl +++ b/lib/private/copy_to_directory_toolchain.bzl @@ -6,7 +6,8 @@ # `tools/copy_to_directory/mirror_release.sh`. To calculate for a specific release run # `tools/copy_to_directory/mirror_release.sh ` -load("//tools:versions.bzl", "COPY_TO_DIRECTORY_INTEGRITY", "COPY_TO_DIRECTORY_VERSION") +load("//tools:sri.bzl", "COPY_TO_DIRECTORY_INTEGRITY") +load("//tools:version.bzl", "VERSION") # Platform names follow the platform naming convention in @aspect_bazel_lib//:lib/private/repo_utils.bzl COPY_TO_DIRECTORY_PLATFORMS = { @@ -158,7 +159,7 @@ def _copy_to_directory_platform_repo_impl(rctx): # https://github.com/aspect-build/bazel-lib/releases/download/v1.19.0/copy_to_directory-linux_amd64 url = "https://github.com/aspect-build/bazel-lib/releases/download/v{0}/copy_to_directory-{1}{2}".format( - COPY_TO_DIRECTORY_VERSION, + VERSION, release_platform, ".exe" if is_windows else "", ) diff --git a/lib/private/docs/BUILD.bazel b/lib/private/docs/BUILD.bazel index 519411961..cbb505fdd 100644 --- a/lib/private/docs/BUILD.bazel +++ b/lib/private/docs/BUILD.bazel @@ -244,13 +244,24 @@ bzl_library( bzl_library( name = "copy_directory_toolchain", srcs = ["//lib/private:copy_directory_toolchain.bzl"], - deps = ["//tools:versions"], + deps = [ + "//tools:sri", + "//tools:version", + ], ) bzl_library( name = "copy_to_directory_toolchain", srcs = ["//lib/private:copy_to_directory_toolchain.bzl"], - deps = ["//tools:versions"], + deps = [ + "//tools:sri", + "//tools:version", + ], +) + +bzl_library( + name = "source_toolchains_repo", + srcs = ["//lib/private:source_toolchains_repo.bzl"], ) bzl_library( @@ -263,7 +274,7 @@ bzl_library( srcs = ["//lib/private:expand_template_toolchain.bzl"], deps = [ "//lib:stamping", - "//tools:versions", + "//tools:sri", ], ) diff --git a/lib/private/expand_template_toolchain.bzl b/lib/private/expand_template_toolchain.bzl index 6200885c1..4e01e8c41 100644 --- a/lib/private/expand_template_toolchain.bzl +++ b/lib/private/expand_template_toolchain.bzl @@ -6,7 +6,8 @@ # `tools/expand_template/mirror_release.sh`. To calculate for a specific release run # `tools/expand_template/mirror_release.sh ` -load("//tools:versions.bzl", "EXPAND_TEMPLATE_INTEGRITY", "EXPAND_TEMPLATE_VERSION") +load("//tools:sri.bzl", "EXPAND_TEMPLATE_INTEGRITY") +load("//tools:version.bzl", "VERSION") # Platform names follow the platform naming convention in @aspect_bazel_lib//:lib/private/repo_utils.bzl EXPAND_TEMPLATE_PLATFORMS = { @@ -158,7 +159,7 @@ def _expand_template_platform_repo_impl(rctx): # https://github.com/aspect-build/bazel-lib/releases/download/v1.19.0/expand_template-linux_amd64 url = "https://github.com/aspect-build/bazel-lib/releases/download/v{0}/expand_template-{1}{2}".format( - EXPAND_TEMPLATE_VERSION, + VERSION, release_platform, ".exe" if is_windows else "", ) diff --git a/lib/private/source_toolchains_repo.bzl b/lib/private/source_toolchains_repo.bzl new file mode 100644 index 000000000..65012a570 --- /dev/null +++ b/lib/private/source_toolchains_repo.bzl @@ -0,0 +1,90 @@ +"""Create a repository to hold the toolchains + +This follows guidance here: +https://docs.bazel.build/versions/main/skylark/deploying.html#registering-toolchains +" +Note that in order to resolve toolchains in the analysis phase +Bazel needs to analyze all toolchain targets that are registered. +Bazel will not need to analyze all targets referenced by toolchain.toolchain attribute. +If in order to register toolchains you need to perform complex computation in the repository, +consider splitting the repository with toolchain targets +from the repository with _toolchain targets. +Former will be always fetched, +and the latter will only be fetched when user actually needs to build code. +" +The "complex computation" in our case is simply downloading large artifacts. +This guidance tells us how to avoid that: we put the toolchain targets in the alias repository +with only the toolchain attribute pointing into the platform-specific repositories. +""" + +# Add more platforms as needed to mirror all the binaries +# published by the upstream project. + +DEFS_TMPL = """\ +# Generated by source_toolchains_repo.bzl for {toolchain_type} +load("@bazel_skylib//lib:structs.bzl", "structs") + +# Forward all the providers +def _resolved_toolchain_impl(ctx): + toolchain_info = ctx.toolchains["{toolchain_type}"] + return [toolchain_info] + structs.to_dict(toolchain_info).values() + +# Copied from java_toolchain_alias +# https://cs.opensource.google/bazel/bazel/+/master:tools/jdk/java_toolchain_alias.bzl +resolved_toolchain = rule( + implementation = _resolved_toolchain_impl, + toolchains = ["{toolchain_type}"], + incompatible_use_toolchain_transition = True, +) +""" + +BUILD_TMPL = """\ +# Generated by source_toolchains_repo.bzl +# +# These can be registered in the workspace file or passed to --extra_toolchains flag. +# By default all of these toolchains are registered by the oci_register_toolchains macro +# so you don't normally need to interact with these targets. + +load(":defs.bzl", "resolved_toolchain") +load("{toolchain_rule_load_from}", toolchain_rule = "{toolchain_rule}") + +resolved_toolchain(name = "current_toolchain", visibility = ["//visibility:public"]) + +toolchain_rule( + name = "source", + bin = "{binary}", + visibility = ["//visibility:public"], +) + +toolchain( + name = "toolchain", + toolchain = ":source", + toolchain_type = "{toolchain_type}", +) +""" + +def _source_toolchains_repo_impl(rctx): + # Expose a concrete toolchain which is the result of Bazel resolving the toolchain + # for the execution or target platform. + # Workaround for https://github.com/bazelbuild/bazel/issues/14009 + rctx.file("defs.bzl", DEFS_TMPL.format( + toolchain_type = rctx.attr.toolchain_type, + )) + + rctx.file("BUILD.bazel", BUILD_TMPL.format( + toolchain_type = rctx.attr.toolchain_type, + toolchain_rule_load_from = rctx.attr.toolchain_rule_load_from, + toolchain_rule = rctx.attr.toolchain_rule, + binary = rctx.attr.binary, + )) + +source_toolchains_repo = repository_rule( + _source_toolchains_repo_impl, + doc = "Creates a repository with toolchain definitions for source binaries.", + attrs = { + "toolchain_type": attr.string(doc = "Label to the toolchain_type", mandatory = True), + "toolchain_rule_load_from": attr.string(doc = "Label to the concrete toolchain rule to load from", mandatory = True), + "toolchain_rule": attr.string(doc = "Name of the concerete toolchain rule", mandatory = True), + "binary": attr.string(doc = "Label to the binary", mandatory = True), + }, +) diff --git a/lib/repositories.bzl b/lib/repositories.bzl index bfa8be75d..5c74dace5 100644 --- a/lib/repositories.bzl +++ b/lib/repositories.bzl @@ -7,7 +7,9 @@ load("//lib/private:coreutils_toolchain.bzl", "COREUTILS_PLATFORMS", "coreutils_ load("//lib/private:copy_directory_toolchain.bzl", "COPY_DIRECTORY_PLATFORMS", "copy_directory_platform_repo", "copy_directory_toolchains_repo") load("//lib/private:expand_template_toolchain.bzl", "EXPAND_TEMPLATE_PLATFORMS", "expand_template_platform_repo", "expand_template_toolchains_repo") load("//lib/private:local_config_platform.bzl", "local_config_platform") +load("//lib/private:source_toolchains_repo.bzl", "source_toolchains_repo") load("//lib:utils.bzl", "is_bazel_6_or_greater", http_archive = "maybe_http_archive") +load("//tools:version.bzl", "VERSION") # buildifier: disable=unnamed-macro def aspect_bazel_lib_dependencies(override_local_config_platform = False): @@ -132,6 +134,18 @@ def register_copy_directory_toolchains(name = "copy_directory", register = True) register: whether to call through to native.register_toolchains. Should be True for WORKSPACE users, but false when used under bzlmod extension """ + if VERSION == "0.0.0": + source_toolchains_repo( + name = "%s_toolchains" % name, + toolchain_type = "@aspect_bazel_lib//lib:copy_directory_toolchain_type", + toolchain_rule_load_from = "@aspect_bazel_lib//lib/private:copy_directory_toolchain.bzl", + toolchain_rule = "copy_directory_toolchain", + binary = "@aspect_bazel_lib//tools/copy_directory", + ) + if register: + native.register_toolchains("@%s_toolchains//:toolchain" % name) + return + for [platform, meta] in COPY_DIRECTORY_PLATFORMS.items(): copy_directory_platform_repo( name = "%s_%s" % (name, platform), @@ -153,6 +167,18 @@ def register_copy_to_directory_toolchains(name = "copy_to_directory", register = register: whether to call through to native.register_toolchains. Should be True for WORKSPACE users, but false when used under bzlmod extension """ + if VERSION == "0.0.0": + source_toolchains_repo( + name = "%s_toolchains" % name, + toolchain_type = "@aspect_bazel_lib//lib:copy_to_directory_toolchain_type", + toolchain_rule_load_from = "@aspect_bazel_lib//lib/private:copy_to_directory_toolchain.bzl", + toolchain_rule = "copy_to_directory_toolchain", + binary = "@aspect_bazel_lib//tools/copy_to_directory", + ) + if register: + native.register_toolchains("@%s_toolchains//:toolchain" % name) + return + for [platform, meta] in COPY_TO_DIRECTORY_PLATFORMS.items(): copy_to_directory_platform_repo( name = "%s_%s" % (name, platform), @@ -174,6 +200,18 @@ def register_expand_template_toolchains(name = "expand_template", register = Tru register: whether to call through to native.register_toolchains. Should be True for WORKSPACE users, but false when used under bzlmod extension """ + if VERSION == "0.0.0": + source_toolchains_repo( + name = "%s_toolchains" % name, + toolchain_type = "@aspect_bazel_lib//lib:expand_template_toolchain_type", + toolchain_rule_load_from = "@aspect_bazel_lib//lib/private:expand_template_toolchain.bzl", + toolchain_rule = "expand_template_toolchain", + binary = "@aspect_bazel_lib//tools/expand_template", + ) + if register: + native.register_toolchains("@%s_toolchains//:toolchain" % name) + return + for [platform, meta] in EXPAND_TEMPLATE_PLATFORMS.items(): expand_template_platform_repo( name = "%s_%s" % (name, platform), diff --git a/scripts/check_versions.sh b/scripts/check_versions.sh deleted file mode 100755 index 0061e5ece..000000000 --- a/scripts/check_versions.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -o nounset -o pipefail - - -TAG= -if [[ "${PRE_COMMIT:-"0"}" == "1" ]]; then - if [[ ! $( echo "$PRE_COMMIT_REMOTE_BRANCH" | grep -E '^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$' ) ]]; then - # not pushing a tag. skip running. - exit 0 - fi - TAG="${PRE_COMMIT_REMOTE_BRANCH/refs\/tags\//}" -else - if [[ $# -eq 0 ]]; then - echo "a tag required." - exit 1 - elif [[ ! $( echo "$1" | grep -E 'v[0-9]+\.[0-9]+\.[0-9]+$' ) ]]; then - echo "not a valid semver. expected v0.0.0 format." - exit 1 - fi - TAG=$1 -fi - -BAZEL_ARGS=( - --client_env=STABLE_BUILD_SCM_TAG_OVERRIDE="$TAG" - --test_output=errors - --config=release - --ui_event_filters=-stdout - --noshow_progress - //tools:release_versions_checkin_test -) -if ! bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test ${BAZEL_ARGS[@]}; then - echo "" - echo "Release is aborted to due to wrong version information." - echo "" - echo "> Please run the following command and retag with a new commit." - echo "" - echo "./scripts/generate_versions.sh $TAG" - echo "" - exit 1 -fi diff --git a/scripts/generate_versions.sh b/scripts/generate_versions.sh deleted file mode 100755 index 5d4e314d5..000000000 --- a/scripts/generate_versions.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -o nounset -o pipefail - -if [[ $# -eq 0 ]]; then - echo "a tag required." - exit 1 -fi - -bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --config=release --client_env=STABLE_BUILD_SCM_TAG_OVERRIDE="$1" //tools:release_versions_checkin diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index df5727b9e..948356975 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -1,16 +1,6 @@ -load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("//lib:write_source_files.bzl", "write_source_files") load(":release.bzl", "multi_platform_go_binaries", "release") -load(":source_toolchain.bzl", "source_toolchain") - -# buildifier: disable=bzl-visibility -load("//lib/private:expand_template_toolchain.bzl", "expand_template_toolchain") - -# buildifier: disable=bzl-visibility -load("//lib/private:copy_to_directory_toolchain.bzl", "copy_to_directory_toolchain") - -# buildifier: disable=bzl-visibility -load("//lib/private:copy_directory_toolchain.bzl", "copy_directory_toolchain") exports_files([ "create_release.sh", @@ -18,43 +8,23 @@ exports_files([ ]) bzl_library( - name = "versions", - srcs = [":versions.bzl"], + name = "sri", + srcs = [":sri.bzl"], visibility = ["//lib/private/docs:__pkg__"], ) -bool_flag( - name = "use_source_toolchains", - build_setting_default = False, +bzl_library( + name = "version", + srcs = [":version.bzl"], + visibility = ["//lib/private/docs:__pkg__"], ) -config_setting( - name = "prefer_source_toolchains", - flag_values = {":use_source_toolchains": "1"}, +bzl_library( + name = "hashes", + srcs = ["hashes.bzl"], visibility = ["//visibility:public"], ) -source_toolchain( - name = "expand_template_toolchain", - binary = "//tools/expand_template", - toolchain_rule = expand_template_toolchain, - toolchain_type = "@aspect_bazel_lib//lib:expand_template_toolchain_type", -) - -source_toolchain( - name = "copy_to_directory_toolchain", - binary = "//tools/copy_to_directory", - toolchain_rule = copy_to_directory_toolchain, - toolchain_type = "@aspect_bazel_lib//lib:copy_to_directory_toolchain_type", -) - -source_toolchain( - name = "copy_directory_toolchain", - binary = "//tools/copy_directory", - toolchain_rule = copy_directory_toolchain, - toolchain_type = "@aspect_bazel_lib//lib:copy_directory_toolchain_type", -) - multi_platform_go_binaries( name = "copy_to_directory", embed = ["//tools/copy_to_directory:copy_to_directory_lib"], @@ -83,8 +53,9 @@ release( ], ) -bzl_library( - name = "hashes", - srcs = ["hashes.bzl"], - visibility = ["//visibility:public"], +write_source_files( + name = "releases_versions_check_in", + files = { + "sri.bzl": ":release_versions", + }, ) diff --git a/tools/create_versions.sh b/tools/create_versions.sh index 7cb93ef21..22f6031ab 100755 --- a/tools/create_versions.sh +++ b/tools/create_versions.sh @@ -2,24 +2,11 @@ set -o errexit -o nounset -o pipefail -HAS_LOCAL_CHANGES="{{HAS_LOCAL_CHANGES}}" -VERSION="{{VERSION}}" NAME="$1" NAME_UPPER="$(echo $NAME | tr '[a-z]' '[A-Z]')" shift -if [[ "$HAS_LOCAL_CHANGES" == "dirty" ]]; then - cat >&2 <> $@""", ] + [ - "./$(location :create_versions_stamped.sh) {} $(locations {}) >> $@".format(to_label(target).name, target) + "./$(location :create_versions.sh) {} $(locations {}) >> $@".format(to_label(target).name, target) for target in targets ]), - tools = [":create_versions_stamped.sh"], - **kwargs - ) - - write_source_files( - name = "{}_versions_checkin".format(name), - files = { - "versions.bzl": ":versions_generated.bzl", - }, + tools = [":create_versions.sh"], **kwargs ) diff --git a/tools/source_toolchain.bzl b/tools/source_toolchain.bzl deleted file mode 100644 index 2ad22268f..000000000 --- a/tools/source_toolchain.bzl +++ /dev/null @@ -1,17 +0,0 @@ -"""macros for defining source toolchains for tools""" - -def source_toolchain(name, toolchain_rule, toolchain_type, binary): - toolchain_rule( - name = "{}_source".format(name), - bin = binary, - visibility = ["//visibility:public"], - ) - - native.toolchain( - name = name, - toolchain = ":{}_source".format(name), - toolchain_type = toolchain_type, - target_settings = [ - "@aspect_bazel_lib//tools:prefer_source_toolchains", - ], - ) diff --git a/tools/sri.bzl b/tools/sri.bzl new file mode 100644 index 000000000..3d7ed60f1 --- /dev/null +++ b/tools/sri.bzl @@ -0,0 +1,26 @@ +"AUTO GENERATED. DO NOT EDIT" + +COPY_DIRECTORY_INTEGRITY = { + "darwin_amd64": "sha256-EH6Qpf/IzIaGncigN+cMc2xCb0C3XuV8I4cUBtaZ7GE=", + "darwin_arm64": "sha256-DH2vl4k0MSyp+lnvfiiOu0ifc+tZSgJUIOFthSOMMvg=", + "freebsd_amd64": "sha256-ogXy1bGEMB4EnuF606H1Vi0h77B3xg+9rSnghDHyVEw=", + "linux_amd64": "sha256-QGFIoivc0z92barkw/JL4LbggV89nmCfsRkDK7fz4gY=", + "linux_arm64": "sha256-lSUkiCmhQaSxPNDaW8Ny+cipW1fcvNogX5Ex3zN1784=", + "windows_amd64": "sha256-ytdfdmbkB2nHSY5xHUuYiFAJ9MFt+WM0uey25sttnWU=", +} +COPY_TO_DIRECTORY_INTEGRITY = { + "darwin_amd64": "sha256-H0FfQ3IbF9RXl0OyLkVHnzNWEtkQuLZq82KTYvhDel4=", + "darwin_arm64": "sha256-M3LcBrCqI5ZveZqeo3f78TRJ21ebWTQA/tDOfAul2q0=", + "freebsd_amd64": "sha256-zg9qdxYvW/+EcUGNjBqeAxkn0WiZ8cqK2X4ssjl+jSg=", + "linux_amd64": "sha256-zNmE7RNMTRJqrU2w04C3twA3NKq7HvFUWim2HBwJ4Kg=", + "linux_arm64": "sha256-VhG/VMlBwHw+vMv8gFJR1FdYuUXb85N/CETmEedfH7Y=", + "windows_amd64": "sha256-H+8EiOxHCTWZ0R3ok+lS0NdYpjwZf+io9BPeo+lA40k=", +} +EXPAND_TEMPLATE_INTEGRITY = { + "darwin_amd64": "sha256-xfHAVVPnlehEhx3iz5b7a0jPgKiH6WSmX692D1t7ZXs=", + "darwin_arm64": "sha256-p/ec4ni5Tk7m68ojoMA/pE087rzza1+R4h+WCpmPAGk=", + "freebsd_amd64": "sha256-wylWEbSAn2K5PD524Tc85vapN3FOdKkcPTHOPx6Mpfw=", + "linux_amd64": "sha256-hqElemiHdXWu7T2Ic4FDK1UjyRHfSihVJh1UtALyZuo=", + "linux_arm64": "sha256-aGj0vuCjfejJ5Q8mJ7ROKat8qki5vLqrAmPXgWFP6m8=", + "windows_amd64": "sha256-DUwILblpcJD63turokSFjaQnc71Qj7PunGanL3s6P/o=", +} diff --git a/tools/version.bzl b/tools/version.bzl new file mode 100644 index 000000000..be0beb9a8 --- /dev/null +++ b/tools/version.bzl @@ -0,0 +1,5 @@ +"version information. replaced with stamped info with each release" + +_VERSION_PRIVATE = "$Format:%(describe:tags=true)$" + +VERSION = "0.0.0" if _VERSION_PRIVATE.startswith("$Format") else _VERSION_PRIVATE.replace("v", "", 1) diff --git a/tools/versions.bzl b/tools/versions.bzl deleted file mode 100644 index 5fa108825..000000000 --- a/tools/versions.bzl +++ /dev/null @@ -1,28 +0,0 @@ -"AUTO GENERATED. DO NOT EDIT" - -COPY_DIRECTORY_VERSION = "1.31.0" -COPY_DIRECTORY_INTEGRITY = { - "darwin_amd64": "sha256-woit3x+tLBneR1uB2vgdBgoysLVjFKOIg0JQUvY31RE=", - "darwin_arm64": "sha256-lo40uEgpR47iR76xOuGJ8MTlo9OgGQaxlHSEFVYpBbs=", - "linux_amd64": "sha256-DsaFECaxpEzLbv3SfEXcKYpuRk+90FaSYSQuCLEE5i8=", - "linux_arm64": "sha256-IH5pYBe42O9iDZm9MdECvnp9e9PpOf6cEab71U0ktXY=", - "windows_amd64": "sha256-AWcKeRtEs2djr9Mh3ha5wW0kTq5JNPOBIJbcIKk+BGA=", -} - -COPY_TO_DIRECTORY_VERSION = "1.31.0" -COPY_TO_DIRECTORY_INTEGRITY = { - "darwin_amd64": "sha256-L/vJ/RR+PIyX2yDdlqbnPQP3/3bWo6nncA6RIqGRVVQ=", - "darwin_arm64": "sha256-7qHbUZXWFgiDOgInegAGEaPOu0up1gtMurXw/uHy9ys=", - "linux_amd64": "sha256-lDFF2xCzHdDSbNlCSgZ+LkXhvceOZE8ghu5aahARcsw=", - "linux_arm64": "sha256-eGOZbQl0G0Fn74pjPOWVUwZwe0HkhZqoVen9XWQCuAg=", - "windows_amd64": "sha256-ctNXsZzsFb01cGMvYBEOpbtmOMezsorYWocKl34kqtY=", -} - -EXPAND_TEMPLATE_VERSION = "1.34.4" -EXPAND_TEMPLATE_INTEGRITY = { - "darwin_amd64": "sha256-dq7Awfc0SAzz2ViRnRMX4SpVw+09nxBZxTOVu+DrAzM=", - "darwin_arm64": "sha256-vgV43WN/dYqcXxCL0yDeLod/eDFA+dWe02LO/HJREVs=", - "linux_amd64": "sha256-xmmrCq/I79QDJYj6sObvCMnNC90Onwr/ewsQ+a8vEl8=", - "linux_arm64": "sha256-sHXkrjF0kuyJqdME/Pviy7EUA28sGEnEv976Rs+3tX0=", - "windows_amd64": "sha256-UgUkTo0gLN/dIkdZUdcRonNv2/Ul9LrdZ6Tv5c6SmPg=", -}