0.17.8 build error as a normal part of cargo build
I don't use ring directly. One of my project dependencies depends on ring. After running cargo update on my project, and then attempting cargo build, I get a compile error during the ring compile. I will be reverting my cargo.lock file. This looks like a simple fix, although I will leave that up to the original developer.
Compiling ring v0.17.8
error[E0283]: type annotations needed
--> /home/x/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.13.5/build.rs:482:52
|
482 | let _ = c.flag("-Wl,--gc-sections".into());
| ---- ^^^^
| |
| required by a bound introduced by this call
|
= note: multiple impls satisfying _: AsRef<OsStr> found in the following crates: cc, std:
- impl AsRef<OsStr> for OsStr;
- impl AsRef<OsStr> for OsString;
- impl AsRef<OsStr> for Path;
- impl AsRef<OsStr> for PathBuf;
- impl AsRef<OsStr> for String;
- impl AsRef<OsStr> for str;
- impl AsRef<OsStr> for windows_registry::Env;
note: required by a bound in Build::flag
--> /home/x/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cc-1.1.14/src/lib.rs:533:39
|
533 | pub fn flag(&mut self, flag: impl AsRef<OsStr>) -> &mut Build {
| ^^^^^^^^^^^^ required by this bound in Build::flag
help: try using a fully qualified path to specify the expected types
|
482 | let _ = c.flag(<&str as Into<T>>::into("-Wl,--gc-sections"));
| ++++++++++++++++++++++++ ~
help: consider removing this method call, as the receiver has type &'static str and &'static str: AsRef<OsStr> trivially holds
|
482 - let _ = c.flag("-Wl,--gc-sections".into());
482 + let _ = c.flag("-Wl,--gc-sections");
In the end, I removed the ".into()" as the compiler suggested, and it compiled. I didn't run any tests on it though, and thus won't be submitting a PR. But this worked for me.
We should do a new release of the current Git main branch, as I think the current main branch resolves this.
What version of cargo/rustc are you using? cargo --version? I tried it with cargo 1.81.0 (2dbb1af80 2024-08-20) and it worked fine.
I also have this issue -- It happens on 1.34.0, 1.76.0, 1.84.0-stable and 1.84.0-nightly. Exact error and output as this guy. My cargo.toml is:
[package]
name = "sdthemis"
version = "1.0.0"
authors = ["hidden"]
edition = "2018"
[features]
docker = []
[dependencies]
rumqtt = {git = "https://github.com/AtherEnergy/rumqtt.git"}
pretty_env_logger = "0.3.0"
bitfield = "0.13.1"
ruci_lib = {path = "../ruci-lib"}
sd_confs = {path = "../sd-confs"}
euiparser = {path = "../euiparser"}
serde = "1.0.80"
serde_json = "1.0.33"
uuid = { version = "0.7", features = ["serde", "v4"] }
log = "0.4.6"
quick-error = "1.2.2"
env_logger = "0.7.1"
libc = "0.2"
nix = "0.18"
privdrop = "0.5.0"
I also have the following dependency tree for ring:
> cargo tree -i ring
Updating crates.io index
Updating git repository `https://github.com/AtherEnergy/rumqtt.git`
Locking 169 packages to latest compatible versions
Adding bitfield v0.13.2 (available: v0.17.0)
Adding env_logger v0.7.1 (available: v0.11.5)
Adding nix v0.18.0 (available: v0.29.0)
Adding pretty_env_logger v0.3.1 (available: v0.5.0)
Adding quick-error v1.2.3 (available: v2.0.1)
Adding uuid v0.7.4 (available: v1.11.0)
Downloaded atty v0.2.14
Downloaded bitfield v0.13.2
Downloaded pretty_env_logger v0.3.1
Downloaded env_logger v0.6.2
Downloaded env_logger v0.7.1
Downloaded humantime v1.3.0
Downloaded nix v0.18.0
Downloaded 7 crates (321.4 KB) in 0.73s
ring v0.14.6
├── jsonwebtoken v6.0.1
│ └── rumqtt v0.31.0 (https://github.com/AtherEnergy/rumqtt.git#6b3c4398)
│ └── sdthemis v1.0.0 (/path/to/sdthemis)
├── rustls v0.15.2
│ └── tokio-rustls v0.9.4
│ └── rumqtt v0.31.0 (https://github.com/AtherEnergy/rumqtt.git#6b3c4398) (*)
├── sct v0.5.0
│ └── rustls v0.15.2 (*)
└── webpki v0.19.1
├── rumqtt v0.31.0 (https://github.com/AtherEnergy/rumqtt.git#6b3c4398) (*)
├── rustls v0.15.2 (*)
└── tokio-rustls v0.9.4 (*)
I am building with:
cargo build --release --target arm-unknown-linux-gnueabi --bin sdthemis
ring-0.13.5
Upgrade to ring 0.17.
ring v0.14.6
Upgrade to ring 0.17.