Skip to content

Commit

Permalink
allow cachepot als alternative to sccache (#599)
Browse files Browse the repository at this point in the history
* chore: enable cachepot as an alternative to sccache

* refactor: make valid_wrappers const
  • Loading branch information
drahnr committed Jul 16, 2021
1 parent f0d5c2a commit a11e066
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2210,13 +2210,13 @@ impl Build {
// No explicit CC wrapper was detected, but check if RUSTC_WRAPPER
// is defined and is a build accelerator that is compatible with
// C/C++ compilers (e.g. sccache)
let valid_wrappers = ["sccache"];
const VALID_WRAPPERS: &[&'static str] = &["sccache", "cachepot"];

let rustc_wrapper = std::env::var_os("RUSTC_WRAPPER")?;
let wrapper_path = Path::new(&rustc_wrapper);
let wrapper_stem = wrapper_path.file_stem()?;

if valid_wrappers.contains(&wrapper_stem.to_str()?) {
if VALID_WRAPPERS.contains(&wrapper_stem.to_str()?) {
Some(rustc_wrapper.to_str()?.to_owned())
} else {
None
Expand Down

0 comments on commit a11e066

Please sign in to comment.