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

Upgrade to dep 0.5.0, go 1.10.3 #1479

Merged
merged 3 commits into from
Aug 17, 2018
Merged

Upgrade to dep 0.5.0, go 1.10.3 #1479

merged 3 commits into from
Aug 17, 2018

Conversation

klingerf
Copy link
Contributor

This branch updates bin/dep to install dep v0.5.0 which was recently released. The new release includes golang/dep#1912, which substantially speeds up re-running bin/dep ensure.

I'm also upgrading the repo from go 1.10.2 to 1.10.3 as part of this change. And I've modified the bin/dep script to pull checksums from the github release, so that we don't have to hardcode them in that script.

Signed-off-by: Kevin Lingerfelt <[email protected]>
@klingerf klingerf self-assigned this Aug 16, 2018
@klingerf klingerf requested a review from rmars August 16, 2018 02:05
Copy link

@rmars rmars left a comment

Choose a reason for hiding this comment

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

🌟 🐐 🏬 yayyy thank you for making this upgrade!

Removing my .dep before running bin/dep worked for me!

@klingerf klingerf requested a review from olix0r August 17, 2018 18:50
bin/dep Outdated
if [ "$version" != "$depversion" ]; then
rm "$depbin"
fi
fi
Copy link
Member

Choose a reason for hiding this comment

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

I think you could probably do this more easily--without relying on the output formatting of dep, for instance--by storing the $depversion in the $depbin (i think we do this for protoc in the api repo, for instance). I.e., if the version is encoded in the file name, there's no reason to discover what version the local file is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, that's a great point -- thanks. Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took that approach in 54d9e78.

bin/dep Outdated
depurl="${dep_base_url}dep-${os}-amd64${exe}"

if [ -f "$depbin" ]; then
version=$($depbin version | grep "^ version" | awk '{print $3}' | awk -F '-' '{print $1}')
Copy link
Member

@olix0r olix0r Aug 17, 2018

Choose a reason for hiding this comment

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

also, code golf note:

grep "^ version" | awk '{print $3}' | ...

is better expressed as

awk '$1 ~ /^version$/ { print $3 }' | ...

echo Actual digest of $depbin does not match expected digest.
curl -L --silent --fail -o depbin "$depurl"
sha=$(curl -L --silent --fail "${depurl}.sha256" | awk '{ print $1 }')
(echo "$sha *depbin" | shasum -c -a 256 -p -s -) || {
Copy link
Member

Choose a reason for hiding this comment

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

should this be $depbin or perhaps it doesn't matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can't be $depbin since $depbin is now an absolute path, and that won't work here in the tmp dir. So instead I'm using the filename "depbin" everywhere in tmp.

Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

lgtm

@klingerf klingerf merged commit 7c07ba0 into master Aug 17, 2018
@klingerf klingerf deleted the kl/dep-0.5.0 branch August 20, 2018 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants