Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prometheus 0.12 crate fails to build with protobuf 0v2.27.1 with v2.27.1 #607

Closed
crusty-dave opened this issue Feb 10, 2022 · 7 comments
Closed

Comments

@crusty-dave
Copy link

crusty-dave commented Feb 10, 2022

rustc 1.47.0 (18bf6b4f0 2020-10-07)
cargo 1.47.0 (f3c7e066a 2020-08-28)

The work-around was to specify version = "=2.25.0", but that shouldn't have been required.

prometheus = {registry = "crates-io-mirror", version="0.12", features = ["process"]}
# fix issue with protobuf (used by prometheus)
protobuf = {registry = "crates-io-mirror", version = "=2.25.0" }

Our mirror was stale, or I probably would have hit the issue sooner. I am not sure if this would be considered a prometheus issue for using such a generic dependency (^2.0) or a protobuf issue for breaking with an existing toolchain...

The first issue with rustdoc::broken_intra_doc_links would seem to be a protobuf issue, perhaps related to building from a mirror. FYI: the mirror is based on JFrog.

error[E0710]: an unknown tool name found in scoped lint: `rustdoc::broken_intra_doc_links`
  --> /home/user/.cargo/registry/src/mirror-97e0f04ae14acc60/protobuf-2.27.1/src/lib.rs:94:9
   |
94 | #![deny(rustdoc::broken_intra_doc_links)]
   |         ^^^^^^^

error[E0658]: const generics are unstable
  --> /home/user/.cargo/registry/src/mirror-97e0f04ae14acc60/protobuf-2.27.1/src/misc.rs:35:62
   |
35 | pub(crate) unsafe fn maybe_ununit_array_assume_init<T, const N: usize>(
   |                                                              ^
   |
   = note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0658, E0710.
For more information about an error, try `rustc --explain E0658`.
error: could not compile `protobuf`.
@crusty-dave crusty-dave changed the title Prometheus 0.12 crate fails to build with protobug 0v2.27.1 with v2.27.1 Prometheus 0.12 crate fails to build with protobuf 0v2.27.1 with v2.27.1 Feb 10, 2022
@stepancheg
Copy link
Owner

Min supported rust version of latest rust-protobuf from v2 branch is 1.52.1.

@crusty-dave
Copy link
Author

There are over 6 million downloads of the prometheus crate, I am surprised that I am the only one reporting this.

Currently that is the only reason that I am pulling in this crate. We are already in version hell due to some crates requiring tokio 0.2, which keeps us from moving the compiler version forward. I haven't read up on the semver rules lately, but it seems like a compiler minimum version change should be considered a breaking change, and require a major version bump.

@stepancheg
Copy link
Owner

There are over 6 million downloads of the prometheus crate, I am surprised that I am the only one reporting this.

Rust release 1.52 happened 9 months ago. Most developers update rustc more often.

And non-developers probably pin versions with Cargo.lock, or even use versions built by someone else.

seems like a compiler minimum version change should be considered a breaking change

Supporting rust >= 1.26 It is practically impossible. Version 2.0 of rust-protobuf was released in 2018. There are too many important API and compiler features developed since then. Moreover, conditional compilation is required to make the same code work with new and old rust, and CI for all intermediate versions (there were several breaking changes in the last three years). Unfortunately, I don't have enough manpower to do that.

If someone want to help maintaining it, this would be possible.

@crusty-dave
Copy link
Author

@stepancheg fair enough...

@scottlamb
Copy link
Contributor

FYI, protobuf is an optional dependency of prometheus. Prometheus used to use protocol buffers in its metric format, but it hasn't for a really long time, so you can probably leave this dependency out without causing problems.

@stepancheg
Copy link
Owner

@scottlamb what they are using now by default?

@scottlamb
Copy link
Contributor

https://prometheus.io/docs/instrumenting/exposition_formats/

NOTE: Some earlier versions of Prometheus supported an exposition format based on Protocol Buffers (aka Protobuf) in addition to the current text-based format. As of version 2.0, however, Prometheus no longer supports the Protobuf-based format. You can read about the reasoning behind this change in this document.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants