mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 19:21:37 +00:00
Fix subtle build breakage
Repro case: $ make clean generated_files $ hack/update-generated-protobuf.sh This would complain about not finding `fmt`, and it was indicating the wrong GOROOT. The problem was that the first step built binaries for generating code, which *embeds* the value of GOROOT into the binary. The whole tree was bind-mounted into the build container and then JUST the dockerized dir was mounted over it. The in-container build tried to use the existing binaries, but GOROOT is wrong. This change whites-out the whole _output dir. I first made just an anonymous volume for _output, but docker makes that as root, which means I can't write to it from our non-root build. So I just put it in the data container. This seems to work. The biggest change this makes is that the $GOPATH/bin/ and $GOPATH/pkg/ dirs will persist across dockerized builds.
This commit is contained in:
@@ -45,7 +45,7 @@ gotoprotobuf=$(kube::util::find-binary "go-to-protobuf")
|
||||
# searches for the protoc-gen-gogo extension in the output directory
|
||||
# satisfies import of github.com/gogo/protobuf/gogoproto/gogo.proto and the
|
||||
# core Google protobuf types
|
||||
PATH="${KUBE_ROOT}/_output/local/go/bin:${PATH}" \
|
||||
PATH="${KUBE_ROOT}/_output/bin:${PATH}" \
|
||||
"${gotoprotobuf}" \
|
||||
--proto-import="${KUBE_ROOT}/vendor" \
|
||||
--proto-import="${KUBE_ROOT}/third_party/protobuf" \
|
||||
|
Reference in New Issue
Block a user