rust-lang / cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
https://docs.rs/cc
Apache License 2.0
1.76k stars 425 forks source link

cc-1.0.99 build failed #1104

Open lim-yoona opened 1 week ago

lim-yoona commented 1 week ago

My project relies on cc, but there are the following errors in the compilation times, how to solve this generally? Thank you!

error[E0277]: `[OsString; 6]` is not an iterator
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.99/src/lib.rs:2730:33
     |
2730 |                   cmd.args.extend([
     |  _________________________________^
2731 | |                     // Header search path
2732 | |                     OsString::from("-isystem"),
2733 | |                     ios_support.join("usr/include").into(),
...    |
2751 | |                     },
2752 | |                 ]);
     | |_________________^ expected an implementor of trait `IntoIterator`
     |
     = note: the trait bound `[OsString; 6]: IntoIterator` is not satisfied
     = note: required because of the requirements on the impl of `IntoIterator` for `[OsString; 6]`
help: consider borrowing here
     |
2730 |                 cmd.args.extend(&[
2731 |                     // Header search path
2732 |                     OsString::from("-isystem"),
2733 |                     ios_support.join("usr/include").into(),
2734 |                     // Framework header search path
2735 |                     OsString::from("-iframework"),
   ...

   Compiling opaque-debug v0.3.1
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `cc`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
madsmtm commented 1 week ago

Hmm, which version of Rust are you using? Could you try running rustc --version and cargo --version?