From 2edd10709c8fa183e7f66ef28c063bcce9c26670 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Mon, 25 Jun 2018 14:25:55 -0700 Subject: [PATCH 1/2] Fix run-in-gopath issue with symlink'd gopath --- hack/lib/init.sh | 1 - hack/update-bazel.sh | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hack/lib/init.sh b/hack/lib/init.sh index 2f1a33a0b76..72e2c8f70ec 100755 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -178,4 +178,3 @@ kube::realpath() { fi kube::readlinkdashf "$1" } - diff --git a/hack/update-bazel.sh b/hack/update-bazel.sh index 10fb3b38004..64cc801ddbd 100755 --- a/hack/update-bazel.sh +++ b/hack/update-bazel.sh @@ -20,8 +20,6 @@ set -o pipefail export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" -kube::util::ensure-gnu-sed - # Remove generated files prior to running kazel. # TODO(spxtr): Remove this line once Bazel is the only way to build. rm -f "${KUBE_ROOT}/pkg/generated/openapi/zz_generated.openapi.go" @@ -31,9 +29,8 @@ export GOBIN="${KUBE_OUTPUT_BINPATH}" PATH="${GOBIN}:${PATH}" # Install tools we need, but only from vendor/... -go install ./vendor/github.com/bazelbuild/bazel-gazelle/cmd/gazelle - -go install ./vendor/github.com/kubernetes/repo-infra/kazel +go install k8s.io/kubernetes/vendor/github.com/bazelbuild/bazel-gazelle/cmd/gazelle +go install k8s.io/kubernetes/vendor/github.com/kubernetes/repo-infra/kazel touch "${KUBE_ROOT}/vendor/BUILD" # Ensure that we use the correct importmap for all vendored dependencies. @@ -46,6 +43,8 @@ fi gazelle fix \ -build_file_name=BUILD,BUILD.bazel \ -external=vendored \ - -mode=fix + -mode=fix \ + -repo_root "${KUBE_ROOT}" \ + "${KUBE_ROOT}" kazel From 50fd906f740aefaaa4869d14bed54a625ef66305 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Mon, 25 Jun 2018 15:45:14 -0700 Subject: [PATCH 2/2] Update vendored tool go install location to use GOPATH --- hack/lib/util.sh | 2 +- hack/verify-spelling.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 7fec453f0ec..658efc85884 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -435,7 +435,7 @@ kube::util::ensure_godep_version() { fi kube::log::status "Installing godep version ${GODEP_VERSION}" - go install ./vendor/github.com/tools/godep/ + go install k8s.io/kubernetes/vendor/github.com/tools/godep/ if ! which godep >/dev/null 2>&1; then kube::log::error "Can't find godep - is your GOPATH 'bin' in your PATH?" kube::log::error " GOPATH: ${GOPATH}" diff --git a/hack/verify-spelling.sh b/hack/verify-spelling.sh index 27d92501d6a..a79778cece7 100755 --- a/hack/verify-spelling.sh +++ b/hack/verify-spelling.sh @@ -25,7 +25,7 @@ export GOBIN="${KUBE_OUTPUT_BINPATH}" PATH="${GOBIN}:${PATH}" # Install tools we need, but only from vendor/... -go install ./vendor/github.com/client9/misspell/cmd/misspell +go install k8s.io/kubernetes/vendor/github.com/client9/misspell/cmd/misspell # Spell checking # All the skipping files are defined in hack/.spelling_failures