From cb22a25144ab145a7cf2eafd7581814f85f499da Mon Sep 17 00:00:00 2001 From: Malte Poll Date: Wed, 28 Jun 2023 18:09:05 +0200 Subject: [PATCH] bazel: add yq to PATH in go generate --- bazel/ci/BUILD.bazel | 3 +++ bazel/ci/go_generate.sh.in | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bazel/ci/BUILD.bazel b/bazel/ci/BUILD.bazel index a38e8ecdb..ecd813a21 100644 --- a/bazel/ci/BUILD.bazel +++ b/bazel/ci/BUILD.bazel @@ -320,6 +320,7 @@ sh_template( "//internal/versions/hash-generator", "@go_sdk//:bin/go", "@org_golang_x_tools//cmd/stringer", + "@yq_toolchains//:resolved_toolchain", ], substitutions = { "@@DOCGEN@@": "$(rootpath :com_github_siderolabs_talos_hack_docgen)", @@ -328,8 +329,10 @@ sh_template( "@@HELM@@": "$(rootpath :com_github_helm_helm)", "@@MEASUREMENT_GENERATOR@@": "$(rootpath //internal/attestation/measurements/measurement-generator:measurement-generator)", "@@STRINGER@@": "$(rootpath @org_golang_x_tools//cmd/stringer:stringer)", + "@@YQ@@": "$(YQ_BIN)", }, template = "go_generate.sh.in", + toolchains = ["@yq_toolchains//:resolved_toolchain"], ) # deps_mirror_fix fixes bazel workspace rules for external dependencies. diff --git a/bazel/ci/go_generate.sh.in b/bazel/ci/go_generate.sh.in index f238dd896..7676a48af 100644 --- a/bazel/ci/go_generate.sh.in +++ b/bazel/ci/go_generate.sh.in @@ -23,6 +23,8 @@ hash_generator=$(realpath @@HASH_GENERATOR@@) stat "${hash_generator}" >> /dev/null measurement_generator=$(realpath @@MEASUREMENT_GENERATOR@@) stat "${measurement_generator}" >> /dev/null +yq=$(realpath @@YQ@@) +stat "${yq}" >> /dev/null cd "${BUILD_WORKSPACE_DIRECTORY}" @@ -34,6 +36,7 @@ PATH=$(dirname "${docgen}"):${PATH} PATH=$(dirname "${helm}"):${PATH} PATH=$(dirname "${hash_generator}"):${PATH} PATH=$(dirname "${measurement_generator}"):${PATH} +PATH=$(dirname "${yq}"):${PATH} export PATH submodules=$(${go} list -f '{{.Dir}}' -m)