bazel: add yq to PATH in go generate

This commit is contained in:
Malte Poll 2023-06-28 18:09:05 +02:00 committed by Daniel Weiße
parent aa00c43156
commit cb22a25144
2 changed files with 6 additions and 0 deletions

View File

@ -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.

View File

@ -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)