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.81k stars 434 forks source link

Fix: Accept non utf-8 characters in compiler and archiver #998

Closed NobodyXu closed 6 months ago

NobodyXu commented 6 months ago

While the compiler automatically detected by cc always is a valid str, it is possible for user to override them using environment variable CC, CXX and AR, which could contain non utf-8 characters.

Before this PR is applied, cc uses to_string_lossy() to convert it to a valid str which might cause the creation of process to fail.

thomcc commented 6 months ago

Oh, it was already reviewed.