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

ci: add cargo-release to deps #4960

Merged
merged 1 commit into from
Dec 14, 2024
Merged

ci: add cargo-release to deps #4960

merged 1 commit into from
Dec 14, 2024

Conversation

conorsch
Copy link
Contributor

@conorsch conorsch commented Dec 14, 2024

Describe your changes

Issue ticket number and link

Adds two more packages to the nix dev again:

  • cargo-release
  • buf

Both of those tools are critical during release-engineering, so I'm adding them to provide a deterministic way to generate the necessary build inputs.

In this commit the nix env switches to the recently published stable release for 2024-11. That stable release pulls in buf version 1.47.0, which is sufficiently recent to satisfy the "at least 1.32" stipulation we've had in the docs [0] for a while now.

[0] https://guide.penumbra.zone/dev/protobuf#installing-buf

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    dev-only, does not change application source code.

Testing and review

If you want to verify behavior locally, following the docs for setting up the nix dev env https://guide.penumbra.zone/dev/dev-env and then check versions:

❯ buf --version
1.47.0

❯ cargo release --version
cargo-release 0.25.10

You should see exactly those versions. Additionally, you should be able to run just protos and confirm no files were modified.

Adds two more packages to the nix dev again:

  * cargo-release
  * buf

Both of those tools are critical during release-engineering,
so I'm adding them to provide a deterministic way to generate the
necessary build inputs.

In this commit the nix env switches to the recently published stable
release for 2024-11. That stable release pulls in `buf` version 1.47.0,
which is sufficiently recent to satisfy the "at least 1.32" stipulation
we've had in the docs [0] for a while now.

[0] https://guide.penumbra.zone/dev/protobuf#installing-buf
@conorsch
Copy link
Contributor Author

I regenerated the proto descriptors on main using the new codified version of buf. This opens the door to removing the slightly-too-forgiving check in CI where we ignore modifications to these files:

# We exclude the proto_descriptor file from diff inspection, since
# different versions of `protoc` can generate non-substantive changes,
# causing noisy CI failures.
- name: Compile protobuf specs into rust src files
shell: bash
run: |
./deployments/scripts/protobuf-codegen
# https://github.com/penumbra-zone/penumbra/issues/3038#issuecomment-1722534133
git checkout crates/proto/src/gen/proto_descriptor.bin.no_lfs
git checkout crates/cnidarium/src/gen/proto_descriptor.bin.no_lfs
s="$(git status --porcelain)"
if [[ -n "$s" ]]; then
echo "ERROR: protobuf files must be regenerated and committed."
echo "Run this command locally: ./deployments/scripts/protobuf-codegen"
echo "These are the files that reported differences:"
echo "$s"
exit 1
else
echo "OK: no changes required to protobuf specs"
fi
but I'm not altering the CI workflows right now. Can circle back on that on a rainy day, in the context of porting more of the CI to reuse the same nix env that we maintain for local dev.

@conorsch conorsch merged commit e2b06a0 into main Dec 14, 2024
14 checks passed
@conorsch conorsch deleted the release-tooling-in-nix branch December 14, 2024 00:29
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.

2 participants