-
Notifications
You must be signed in to change notification settings - Fork 111
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
Vendor prost locally #1199
Vendor prost locally #1199
Conversation
And then there were two (#1200) 🙈 |
Which one will make it first to the main branch? 🏁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks David!
I'm happy to go with your PR 😄
scripts/vendor_prost.sh
Outdated
done | ||
|
||
# Check the local version builds, which also regenerates Cargo.lock | ||
cargo build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea!
Could we maybe do something like PROTOC=protoc cargo test
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done.
@@ -0,0 +1,51 @@ | |||
From df8d3e37563d373ac38cc90f75f97416ba766b61 Mon Sep 17 00:00:00 2001 | |||
From: Daan de Graaf <daandegraaf9@gmail.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also change this to daagra@google.com
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
scripts/vendor_prost.sh
Outdated
|
||
# Unzip and move into the vendored directory (stripping the prefix). | ||
unzip "$PROST_ZIP_PREFIX.zip" | ||
mv "$PROST_ZIP_PREFIX" vendored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this for a bit, maybe it's cleaner to put it under third_party/prost
instead of third_party/prost/vendored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that too, but didn't want to cause extra merge pain. If you're happy to include a directory change in your rebase, I'll move it.
Taken from https://github.com/danburkert/prost as of commit 802562779979 ("prost-build: fix compilation error when using --no-default-features"), with the exception of the prost-build/third-party subdirectory (which contains an unneeded copy of the protobuf distribution).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The changes look good to me.
scripts/vendor_prost.sh
Outdated
PROST_ZIP_URL="https://github.com/danburkert/prost/archive/80256277997975948d257faf3f35c2890bf12787.zip" | ||
PROST_ZIP_SHA256="02c086f2d1b7aad110745ac701f001618cd8343f882fc9ce034aa007c4c53773" | ||
PROST_ZIP_PREFIX="prost-80256277997975948d257faf3f35c2890bf12787" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readonly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
scripts/vendor_prost.sh
Outdated
# support for the message_type field option. | ||
|
||
# Master branch as of 2020-06-05 | ||
PROST_ZIP_URL="https://github.com/danburkert/prost/archive/80256277997975948d257faf3f35c2890bf12787.zip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps make the commit id a separate variable and reuse here and below, so it's the only thing we need to change when updating.
Also make it consistent with what we do in Dockerfile:
Lines 143 to 152 in 56e2996
ARG bazel_tools_version=2.2.1 | |
ARG buildifier_sha256=731a6a9bf8fca8a00a165cd5b3fbac9907a7cf422ec9c2f206b0a76c0a7e3d62 | |
ARG buildifier_dir=/usr/local/buildifier/bin | |
ARG buildifier_bin=${buildifier_dir}/buildifier | |
ENV PATH "${buildifier_dir}:${PATH}" | |
RUN mkdir --parents ${buildifier_dir} \ | |
&& curl --location https://github.com/bazelbuild/buildtools/releases/download/${bazel_tools_version}/buildifier > ${buildifier_bin} \ | |
&& sha256sum --binary ${buildifier_bin} && echo "${buildifier_sha256} *${buildifier_bin}" | sha256sum --check \ | |
&& chmod +x ${buildifier_bin} \ | |
&& buildifier --version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
scripts/vendor_prost.sh
Outdated
cd "${SCRIPTS_DIR}/../third_party" || exit | ||
|
||
# Download the prost zip only if it does not yet exist in the filesystem. | ||
if [ ! -f "$PROST_ZIP_PREFIX.zip" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[[
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
scripts/vendor_prost.sh
Outdated
|
||
# Download the prost zip only if it does not yet exist in the filesystem. | ||
if [ ! -f "$PROST_ZIP_PREFIX.zip" ]; then | ||
curl -L "$PROST_ZIP_URL" -o "$PROST_ZIP_PREFIX.zip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curl --location
(long options). also worth using shell redirect to write to the file, for consistency with dockerfile? or use --output
there too? (not sure there is any benefit in either of them)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
The scripts/vendor_prost.sh script updates the local copy of prost to the version included in it, applying our local patches. Also check in a fixed Cargo.lock for prost.
Thanks for this PR @daviddrysdale! I'll send a follow-up PR to switch all Rust code to use the vendored version once this is merged. |
Reproducibility Index:
Reproducibility Index diff: |
Checklist
Cloudbuild
cover any TODOs and/or unfinished work.
construction.