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: Regenerate Rust code when we update dependencies #8

Merged
merged 3 commits into from
Nov 1, 2024

Conversation

apyrgio
Copy link
Owner

@apyrgio apyrgio commented Nov 1, 2024

Updating project dependencies during our tests may lead to an update in the protobuf crate. It seems that such an update does not work well with already generated Rust code from Protobuf definitions, and our CI fails with errors like this:

error[E0425]: cannot find value `VERSION_3_6_0` in crate `protobuf`
  --> src/../proto/metadata.rs:25:49
   |
25 | const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_6_0;
   |                                                 ^^^^^^^^^^^^^ help: a constant with a similar name exists: `VERSION_3_7_1`
   |
  ::: /home/apyrgio/playground/tindercrypt/target/debug/build/protobuf-81b136a5c49b834c/out/version.rs:7:1
   |
7  | pub const VERSION_3_7_1: () = ();
   | --------------------------- similarly named constant `VERSION_3_7_1` defined here

See this failed run for instance: https://github.com/apyrgio/tindercrypt/actions/runs/11622120587/job/32367072109#step:5:157

It's probably best to re-generate this Rust code in our CI, just to be on the safe side.

Allow missing docs for Rust code generated from Protobuf definitions.
The `deny(missing_docs)` rule applies to the whole codebase, but this
code is ultimately not under our control, so we have to make an
exception.
Updating project dependencies during our tests may lead to an update in
the `protobuf` crate. It seems that such an update does not work well
with already generated Rust code from Protobuf definitions, and our CI
fails with errors like this:

    error[E0425]: cannot find value `VERSION_3_6_0` in crate `protobuf`
      --> src/../proto/metadata.rs:25:49
       |
    25 | const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_6_0;
       |                                                 ^^^^^^^^^^^^^ help: a constant with a similar name exists: `VERSION_3_7_1`
       |
      ::: /home/apyrgio/playground/tindercrypt/target/debug/build/protobuf-81b136a5c49b834c/out/version.rs:7:1
       |
    7  | pub const VERSION_3_7_1: () = ();
       | --------------------------- similarly named constant `VERSION_3_7_1` defined here

See this failed run for instance:
https://github.com/apyrgio/tindercrypt/actions/runs/11622120587/job/32367072109#step:5:157

It's probably best to re-generate this Rust code in our CI, just to be
on the safe side.
@apyrgio apyrgio merged commit ad8647a into main Nov 1, 2024
34 checks passed
@apyrgio apyrgio deleted the feature-protobuf-build branch November 1, 2024 13:02
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.

1 participant