Accepting request 965123 from devel:languages:rust
OBS-URL: https://build.opensuse.org/request/show/965123 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sccache?expand=0&rev=16
This commit is contained in:
commit
edd1fcaacc
37
0001-Ignore-some-env-vars.patch
Normal file
37
0001-Ignore-some-env-vars.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From b1af4f10aa3ec94b2f16d092cfd9f0025a1c5f58 Mon Sep 17 00:00:00 2001
|
||||
From: William Brown <william@blackhats.net.au>
|
||||
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<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"
|
||||
+ );
|
||||
}
|
||||
|
||||
Ok(Command::Compile {
|
||||
--
|
||||
2.32.0 (Apple Git-132)
|
||||
|
@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 27 01:25:36 UTC 2022 - William Brown <william.brown@suse.com>
|
||||
|
||||
- 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 <william.brown@suse.com>
|
||||
|
||||
- Ungate sccache from other arches
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 14 04:28:25 UTC 2022 - william.brown@suse.com
|
||||
|
||||
|
21
sccache.spec
21
sccache.spec
@ -33,10 +33,10 @@ 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
|
||||
ExclusiveArch: x86_64 i586 i686 %{arm} aarch64 s390x
|
||||
|
||||
%description
|
||||
Sccache is a ccache-like tool. It is used as a compiler wrapper and
|
||||
@ -47,24 +47,27 @@ 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
|
||||
find vendor -type f -name \*.rs -exec chmod -x '{}' \;
|
||||
|
||||
%build
|
||||
# 'dist-server' available only on x86_64 so far - https://github.com/mozilla/sccache/issues/656
|
||||
features="azure,s3,memcached,redis"
|
||||
|
||||
%ifarch x86_64
|
||||
features="$features,dist-server,dist-client"
|
||||
%endif
|
||||
# s390x can NOT build gcs support, ring fails. Use FS only
|
||||
%ifarch s390x
|
||||
# 'dist-server' available only on x86_64 so far - https://github.com/mozilla/sccache/issues/656
|
||||
features="azure,s3,redis,dist-server,dist-client"
|
||||
%else
|
||||
%ifarch aarch64
|
||||
features="azure,s3,redis"
|
||||
%else
|
||||
# Most other arches have issues (especially with ring). Use FS cache only
|
||||
features=""
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%{cargo_build} --features=$features
|
||||
%{cargo_build} --no-default-features --features=$features
|
||||
|
||||
%install
|
||||
install -D -d -m 0755 %{buildroot}%{_bindir}
|
||||
|
Loading…
x
Reference in New Issue
Block a user