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

Minimum version of tonic dependency is too low #592

Closed
divergentdave opened this issue Nov 4, 2024 · 2 comments · Fixed by #593
Closed

Minimum version of tonic dependency is too low #592

divergentdave opened this issue Nov 4, 2024 · 2 comments · Fixed by #593
Labels
C-api Crate: console-api S-bug Severity: bug

Comments

@divergentdave
Copy link
Contributor

What crate(s) in this repo are involved in the problem?

console-api

What is the issue?

FYI, version 0.8.1 of console-api uses the tonic::Status::GRPC_STATUS constant, which was introduced in tonic v0.12.3, but its dependency on tonic only specifies 0.12.

How can the bug be reproduced?

Update console-api or console-subscriber in a project with an old Cargo.lock.

Logs, error output, etc

    Checking console-api v0.8.1
error[E0599]: no associated item named `GRPC_STATUS` found for struct `Status` in the current scope
   --> /home/david/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-api-0.8.1/src/generated/rs.tokio.console.instrument.rs:577:48
    |
577 | ...                   tonic::Status::GRPC_STATUS,
    |                                      ^^^^^^^^^^^ associated item not found in `Status`

error[E0599]: no associated item named `GRPC_STATUS` found for struct `Status` in the current scope
   --> /home/david/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-api-0.8.1/src/generated/rs.tokio.console.trace.rs:357:48
    |
357 | ...                   tonic::Status::GRPC_STATUS,
    |                                      ^^^^^^^^^^^ associated item not found in `Status`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `console-api` (lib) due to 2 previous errors

Versions

console-api v0.8.1

Possible solution

Change the dependency specification to version = "0.12.3".

Additional context

No response

Would you like to work on fixing this bug?

maybe

@divergentdave divergentdave added the S-bug Severity: bug label Nov 4, 2024
@hds
Copy link
Collaborator

hds commented Nov 4, 2024

@divergentdave thanks for the report. If you feel like submitting a PR to fix, feel free. In any event I'll try to get a fix and a point release out tomorrow.

divergentdave added a commit to divergentdave/console that referenced this issue Nov 4, 2024
Change the minimum version of tonic from 0.12 to 0.12.3. This fixes
compilation in downstream projects with old lock files, since the
generated code now uses a constant only present in tonic 0.12.3.

Closes tokio-rs#592
@hds hds closed this as completed in #593 Nov 4, 2024
@hds hds closed this as completed in 1f41b61 Nov 4, 2024
@hds hds added the C-api Crate: console-api label Nov 4, 2024
hds added a commit that referenced this issue Nov 5, 2024
As reported in issue #592, in our release of `console-api` 0.8.1, we
specified that we required a tonic version of 0.12 in teh Cargo.toml
file. However, since we had generated Rust code with `tonic-build`
0.12.3, we had some code that was only present in `tonic` from 0.12.3
as well.

This error was fixed in #593.

However, this showed a gap in our CI testing, we don't test against
minimum versions of our dependencies to catch this kind of error.

This change adds a CI job to check the minimal versions of our direct
dependencies. We perform a cargo update with the `-Z
direct-minimal-versions` flag and then perform cargo check. This would
have caught the previous error and will catch any new ones of a similar
type.

One downside to this approach is that we must explicitly give a minimum
version for our direct dependencies that is equal to or greater than the
minimum version that any of of transitive dependencies specify for that
same crate. However this check is probably worth the annoyance.
hds added a commit that referenced this issue Nov 5, 2024
As reported in issue #592, in our release of `console-api` 0.8.1, we
specified that we required a tonic version of 0.12 in teh Cargo.toml
file. However, since we had generated Rust code with `tonic-build`
0.12.3, we had some code that was only present in `tonic` from 0.12.3
as well.

This error was fixed in #593.

However, this showed a gap in our CI testing, we don't test against
minimum versions of our dependencies to catch this kind of error.

This change adds a CI job to check the minimal versions of our direct
dependencies. We perform a cargo update with the `-Z
direct-minimal-versions` flag and then perform cargo check. This would
have caught the previous error and will catch any new ones of a similar
type.

One downside to this approach is that we must explicitly give a minimum
version for our direct dependencies that is equal to or greater than the
minimum version that any of of transitive dependencies specify for that
same crate. However this check is probably worth the annoyance.
hds added a commit that referenced this issue Nov 5, 2024
As reported in issue #592, in our release of `console-api` 0.8.1, we
specified that we required a tonic version of 0.12 in teh Cargo.toml
file. However, since we had generated Rust code with `tonic-build`
0.12.3, we had some code that was only present in `tonic` from 0.12.3
as well.

This error was fixed in #593.

However, this showed a gap in our CI testing, we don't test against
minimum versions of our dependencies to catch this kind of error.

This change adds a CI job to check the minimal versions of our direct
dependencies. We perform a cargo update with the `-Z
direct-minimal-versions` flag and then perform cargo check. This would
have caught the previous error and will catch any new ones of a similar
type.

One downside to this approach is that we must explicitly give a minimum
version for our direct dependencies that is equal to or greater than the
minimum version that any of of transitive dependencies specify for that
same crate. However this check is probably worth the annoyance.
hds added a commit that referenced this issue Nov 5, 2024
As reported in issue #592, in our release of `console-api` 0.8.1, we
specified that we required a tonic version of 0.12 in teh Cargo.toml
file. However, since we had generated Rust code with `tonic-build`
0.12.3, we had some code that was only present in `tonic` from 0.12.3
as well.

This error was fixed in #593.

However, this showed a gap in our CI testing, we don't test against
minimum versions of our dependencies to catch this kind of error.

This change adds a CI job to check the minimal versions of our direct
dependencies. We perform a cargo update with the `-Z
direct-minimal-versions` flag and then perform cargo check. This would
have caught the previous error and will catch any new ones of a similar
type.

One downside to this approach is that we must explicitly give a minimum
version for our direct dependencies that is equal to or greater than the
minimum version that any of of transitive dependencies specify for that
same crate. However this check is probably worth the annoyance.
hds added a commit that referenced this issue Nov 5, 2024
As reported in issue #592, in our release of `console-api` 0.8.1, we
specified that we required a tonic version of 0.12 in teh Cargo.toml
file. However, since we had generated Rust code with `tonic-build`
0.12.3, we had some code that was only present in `tonic` from 0.12.3
as well.

This error was fixed in #593.

However, this showed a gap in our CI testing, we don't test against
minimum versions of our dependencies to catch this kind of error.

This change adds a CI job to check the minimal versions of our direct
dependencies. We perform a cargo update with the `-Z
direct-minimal-versions` flag and then perform cargo check. This would
have caught the previous error and will catch any new ones of a similar
type.

One downside to this approach is that we must explicitly give a minimum
version for our direct dependencies that is equal to or greater than the
minimum version that any of of transitive dependencies specify for that
same crate. However this check is probably worth the annoyance.
hds added a commit that referenced this issue Nov 5, 2024
As reported in issue #592, in our release of `console-api` 0.8.1, we
specified that we required a tonic version of 0.12 in teh Cargo.toml
file. However, since we had generated Rust code with `tonic-build`
0.12.3, we had some code that was only present in `tonic` from 0.12.3
as well.

This error was fixed in #593.

However, this showed a gap in our CI testing, we don't test against
minimum versions of our dependencies to catch this kind of error.

This change adds a CI job to check the minimal versions of our direct
dependencies. We perform a cargo update with the `-Z
direct-minimal-versions` flag and then perform cargo check. This would
have caught the previous error and will catch any new ones of a similar
type.

One downside to this approach is that we must explicitly give a minimum
version for our direct dependencies that is equal to or greater than the
minimum version that any of of transitive dependencies specify for that
same crate. However this check is probably worth the annoyance.
@hds
Copy link
Collaborator

hds commented Nov 5, 2024

Adding CI tests in #596 to avoid this issue in the future.

hds added a commit that referenced this issue Nov 12, 2024
As reported in issue #592, in our release of `console-api` 0.8.1, we
specified that we required a tonic version of 0.12 in teh Cargo.toml
file. However, since we had generated Rust code with `tonic-build`
0.12.3, we had some code that was only present in `tonic` from 0.12.3
as well.

This error was fixed in #593.

However, this showed a gap in our CI testing, we don't test against
minimum versions of our dependencies to catch this kind of error.

This change adds a CI job to check the minimal versions of our direct
dependencies. We perform a cargo update with the `-Z
direct-minimal-versions` flag and then perform cargo check. This would
have caught the previous error and will catch any new ones of a similar
type.

One downside to this approach is that we must explicitly give a minimum
version for our direct dependencies that is equal to or greater than the
minimum version that any of of transitive dependencies specify for that
same crate. However this check is probably worth the annoyance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-api Crate: console-api S-bug Severity: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants