briansmith / ring

Safe, fast, small crypto using Rust
Other
3.64k stars 682 forks source link

ring not compiling when used as a dependency for libotp #2123

Closed anthonybtedesco closed 4 days ago

anthonybtedesco commented 4 days ago
[mattricks@lauer api]$ cargo run
    Blocking waiting for file lock on build directory
   Compiling ring v0.14.6
error[E0283]: type annotations needed
   --> /home/mattricks/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.14.6/build.rs:475:52
    |
475 |                 let _ = c.flag("-Wl,--gc-sections".into());
    |                           ----                     ^^^^
    |                           |
    |                           required by a bound introduced by this call
    |
    = note: multiple `impl`s 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/mattricks/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cc-1.0.101/src/lib.rs:513:39
    |
513 |     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
    |
475 |                 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
    |
475 -                 let _ = c.flag("-Wl,--gc-sections".into());
475 +                 let _ = c.flag("-Wl,--gc-sections");
    |

For more information about this error, try `rustc --explain E0283`.
error: could not compile `ring` (build script) due to 1 previous error

I tried making a new project fresh with just ring, and everything worked fine that was ring 0.17.8

Problem arises with this repo https://github.com/naim94a/otp

briansmith commented 4 days ago

I tried making a new project fresh with just ring, and everything worked fine that was ring 0.17.8

Unfortunately, there's not going to be any patches for ring 0.14.x. If you really need to build ring 0.14.x then try forcing a lower version of cc-rs. Although I don't recommend anybody use those old versions of ring.