diff --git a/0001-Ignore-some-env-vars.patch b/0001-Ignore-some-env-vars.patch new file mode 100644 index 0000000..fa36fe5 --- /dev/null +++ b/0001-Ignore-some-env-vars.patch @@ -0,0 +1,37 @@ +From b1af4f10aa3ec94b2f16d092cfd9f0025a1c5f58 Mon Sep 17 00:00:00 2001 +From: William Brown +Date: Sun, 27 Mar 2022 11:19:09 +1000 +Subject: [PATCH] Ignore some env vars + +--- + src/cmdline.rs | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/src/cmdline.rs b/src/cmdline.rs +index 13773c7..bd89cb3 100644 +--- a/src/cmdline.rs ++++ b/src/cmdline.rs +@@ -208,7 +208,19 @@ pub fn parse() -> Result { + // + // 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" ++ ); + } + + Ok(Command::Compile { +-- +2.32.0 (Apple Git-132) + diff --git a/sccache.changes b/sccache.changes index 36afee3..11f5e1d 100644 --- a/sccache.changes +++ b/sccache.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Mar 27 01:25:36 UTC 2022 - William Brown + +- 0001-Ignore-some-env-vars.patch - sccache will ignore rebuilds if + env vars change. As a result, we need to filter a number of values + that rpm/osc-build injects that change frequently that disrupts + the ability for sccache to cache effectively. + ------------------------------------------------------------------- Fri Mar 25 05:23:56 UTC 2022 - William Brown diff --git a/sccache.spec b/sccache.spec index 62700c8..43b385f 100644 --- a/sccache.spec +++ b/sccache.spec @@ -33,6 +33,7 @@ Source11: sccache-dist-scheduler.service Source12: builder.conf Source13: scheduler.conf Source14: client.example +Patch1: 0001-Ignore-some-env-vars.patch BuildRequires: cargo-packaging BuildRequires: pkgconfig(openssl) Requires: bubblewrap @@ -46,6 +47,8 @@ the Google Cloud Storage (GCS) API. %prep %setup -q %setup -qa1 +%patch1 -p1 + mkdir .cargo cp %{SOURCE2} .cargo/config # Remove exec bits to prevent an issue in fedora shebang checking