Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build codecgen from Godeps in verify scripts #16017

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions hack/update-codecgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ generated_files=$(

# Build codecgen binary from Godeps.
function cleanup {
rm -rf "${KUBE_ROOT}/codecgen_binary"
rm -f "${CODECGEN:-}"
}
trap cleanup EXIT
godep go build -o codecgen_binary github.com/ugorji/go/codec/codecgen
CODECGEN="${PWD}/codecgen_binary"
godep go build -o "${CODECGEN}" github.com/ugorji/go/codec/codecgen

for generated_file in ${generated_files}; do
initial_dir=${PWD}
Expand Down
12 changes: 8 additions & 4 deletions hack/verify-codecgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ function cleanup {
}
trap cleanup EXIT

# build codecgen tool
# Build codecgen from Godeps.
# However, we need to install godep first.
# We make some tricks with GOPATH variable to make it work with Travis.
_gopath=${GOPATH}
export GOPATH="${_tmpdir}"
go get -u github.com/ugorji/go/codec/codecgen 2>/dev/null
go install github.com/ugorji/go/codec/codecgen 2>/dev/null
CODECGEN="${_tmpdir}/bin/codecgen"
go get -u github.com/tools/godep 2>/dev/null
go install github.com/tools/godep 2>/dev/null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need the install line - just go get -u github.com/tools/godep should be sufficient

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, Travis, Shippable, and Jenkins all install godep before running any checks. So this may not be strictly necessary here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried without install line and it doesn't work.
Also, it seems that godep is not in PATH, so it seems not obvious to use.
So I would prefer leaving as is - we can consider unifying scripts at some point.

GODEP="${_tmpdir}/bin/godep"
export GOPATH=${_gopath}

CODECGEN="${_tmpdir}/codecgen_binary"
${GODEP} go build -o "${CODECGEN}" github.com/ugorji/go/codec/codecgen

for generated_file in ${generated_files}; do
initial_dir=${PWD}
file=${generated_file//\.generated\.go/.go}
Expand Down