Skip to content

Commit

Permalink
Ignore RPM environment variables (#1613)
Browse files Browse the repository at this point in the history
RPM sets a number of environment variables by default that interfere
with the sccache's ability to cache artefacts. Some of these
variables are also used by other applications.

This extends the default ignore list to allow sccache to be used
under different environments for caching.
  • Loading branch information
Firstyear authored Feb 22, 2023
1 parent 50747e1 commit b0dd958
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/cmdline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,19 @@ pub fn try_parse() -> Result<Command> {
//
// FIXME: Maybe we should strip out `LD_PRELOAD` always?
if env::var_os("RUNNING_UNDER_RR").is_some() {
env_vars.retain(|(k, _v)| k != "LD_PRELOAD" && k != "RUNNING_UNDER_RR");
env_vars.retain(|(k, _v)| {
k != "LD_PRELOAD"
&& k != "RUNNING_UNDER_RR"
&& k != "HOSTNAME"
&& k != "PWD"
&& k != "HOST"
&& k != "RPM_BUILD_ROOT"
&& k != "SOURCE_DATE_EPOCH"
&& k != "RPM_PACKAGE_RELEASE"
&& k != "MINICOM"
&& k != "DESTDIR"
&& k != "RPM_PACKAGE_VERSION"
});
}

let cmd = matches
Expand Down

0 comments on commit b0dd958

Please sign in to comment.