cloudflare / cloudflare/pingora
sfv 0.11 breaks pingora cargo build
- Dominant language
- Rust
- Stars
- 27.4k
- Forks
- 1.7k
- Avg merge
- 6h 22m
- Merged PRs (30d)
- 3
Description
## Describe the bug
[sfv](https://github.com/undef1nd/sfv) was recently updated to 0.11 and now `cargo build` in the pingora root fails with this error:
```
Checking pingora-core v0.4.0 (/home/braden/GitHub/pingora/pingora-core)
error[E0308]: mismatched types
--> pingora-core/src/protocols/http/compression/mod.rs:416:39
|
416 | match sfv::Parser::parse_list(ac.as_bytes()) {
| ----------------------- ^^^^^^^^^^^^^ expected `Parser<'_>`, found `&[u8]`
| |
| arguments to this function are incorrect
|
note: method defined here
--> /home/braden/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/sfv-0.11.0/src/parser.rs:166:12
|
166 | pub fn parse_list(self) -> SFVResult {
| ^^^^^^^^^^
error[E0277]: the trait bound `protocols::http::compression::Algorithm: std::convert::From<&sfv::TokenRef>` is not satisfied
--> pingora-core/src/protocols/http/compression/mod.rs:422:45
|
422 | ... let algorithm = Algorithm::from(s);
| ^^^^^^^^^ the trait `std::convert::From<&sfv::TokenRef>` is not implemented for `protocols::http::compression::Algorithm`
|
= help: the trait `From<&sfv::TokenRef>` is not implemented for `protocols::http::compression::Algorithm`
but trait `From<&str>` is implemented for it
= help: for that trait implementation, expected `str`, found `sfv::TokenRef`
error[E0277]: the trait bound `protocols::http::compression::Algorithm: std::convert::From<&sfv::TokenRef>` is not satisfied
--> pingora-core/src/protocols/http/compression/mod.rs:425:43
|
425 | ... list.push(Algorithm::from(s));
| ^^^^^^^^^ the trait `std::convert::From<&sfv::TokenRef>` is not implemented for `protocols::http::compression::Algorithm`
|
= help: the trait `From<&sfv::TokenRef>` is not implemented for `protocols::http::compression::Algorithm`
but trait `From<&str>` is implemented for it
= help: for that trait implementation, expected `str`, found `sfv::TokenRef`
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `pingora-core` (lib) due to 3 previous errors
```
## Pingora info
**Pingora version**: caa6a0879e41d45b9d2798d9791a981c7a45de5c
**Rust version**: cargo 1.85.1 (d73d2caf9 2024-12-31)
**Operating system version**: nixos
## Steps to reproduce
Checkout latest `main` and run `cargo build`
## Expected results
The crate should build successfully
## Observed results
The above error output
Contributor guide
Assessment
This issue has not been assessed yet.