%bcond check 1 %global crate sccache Name: sccache # Fedora ships `sccache` without the Redis backend; Epoch ensures this # Redis/GHA-enabled build outranks it when both repos are enabled. Epoch: 1 Version: 0.16.0 Release: 1%{?dist} Summary: Compiler cache with Redis/GitHub-Actions backends and distributed compilation # Cumulative SPDX over sccache, sccache-dist, and every statically-linked crate # (cargo2rpm license-summary over the dist-client,redis,gha,dist-server set). License: ((Apache-2.0 OR MIT) AND BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 AND ISC) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND BSD-3-Clause AND (CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (CC0-1.0 OR MIT-0 OR Apache-2.0) AND CDLA-Permissive-2.0 AND ISC AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Apache-2.0 OR LGPL-2.1-or-later) AND (MIT OR Zlib OR Apache-2.0) AND MPL-2.0 AND Unicode-3.0 AND (Unlicense OR MIT) AND Zlib URL: https://github.com/mozilla/sccache # GitHub tag archive (guarantees Cargo.lock for `cargo vendor --locked`); the # crate is `sccache`, so the archive top dir is sccache-%%{version}. Source0: %{url}/archive/refs/tags/v%{version}/%{crate}-%{version}.tar.gz Source1: %{name}-%{version}-vendor.tar.xz Source2: sccache-dist-scheduler.service Source3: sccache-dist-server.service Source4: sccache-dist.sysusers Source5: scheduler.toml.example Source6: server.toml.example ExclusiveArch: %{rust_arches} BuildRequires: cargo-rpm-macros >= 24 # Vendoring turns off %%cargo_generate_buildrequires. The openssl 0.10 crate # (pulled by the dist-server feature and by rouille[ssl]) links libssl/libcrypto # via openssl-sys; gcc covers the final link and ring's C/asm. BuildRequires: gcc BuildRequires: pkgconfig(openssl) # For the sccache-dist subpackage's unit scriptlets and sysusers file. BuildRequires: systemd-rpm-macros %description sccache is a ccache-like compiler cache: a compiler wrapper that caches compilation results in local or remote storage. This build enables the Redis and GitHub Actions cache backends and the distributed-compilation client. (Fedora's sccache omits the Redis backend.) %package -n sccache-dist Summary: Distributed compilation scheduler and build server for sccache # The server subcommand shells out to bwrap (>= 0.3.0) to sandbox jobs; the # scheduler does not, so this is a weak dep. Recommends: bubblewrap %description -n sccache-dist sccache-dist is the server side of sccache's distributed compilation: a scheduler that parcels compile requests out to build servers, and a build server that runs them in an overlayfs + bubblewrap sandbox. Ships hardened systemd units and a sccache system user. %prep %autosetup -n %{crate}-%{version} -p1 tar -xJf %{SOURCE1} %cargo_prep -v vendor %build # sccache's [profile.release] sets lto = true + codegen-units = 1, inherited by # [profile.rpm], which OOM-kills the linker in the clean-chroot gate. export CARGO_PROFILE_RPM_LTO=false # -n drops the default `all` set (webdav/memcached/s3/gcs/azure/oss/cos we don't # ship); we keep only the redis + GitHub-Actions client backends plus the dist # client and server. %cargo_build -n -f dist-client,redis,gha,dist-server %{cargo_vendor_manifest} %install install -Dpm0755 target/rpm/sccache %{buildroot}%{_bindir}/sccache install -Dpm0755 target/rpm/sccache-dist %{buildroot}%{_bindir}/sccache-dist install -Dpm0644 %{SOURCE2} %{buildroot}%{_unitdir}/sccache-dist-scheduler.service install -Dpm0644 %{SOURCE3} %{buildroot}%{_unitdir}/sccache-dist-server.service install -Dpm0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/sccache-dist.conf install -Dpm0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sccache/scheduler.toml.example install -Dpm0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sccache/server.toml.example %check %if %{with check} # Upstream's suite needs a dev layout / rustup / a live cluster; smoke-test the # installed binaries instead. %{buildroot}%{_bindir}/sccache --version %{buildroot}%{_bindir}/sccache-dist --version %endif %post -n sccache-dist %systemd_post sccache-dist-scheduler.service sccache-dist-server.service %preun -n sccache-dist %systemd_preun sccache-dist-scheduler.service sccache-dist-server.service %postun -n sccache-dist # Restart the (stateless) scheduler on upgrade, but NOT the build server — a # restart there would abort in-flight sandboxed compilations. %systemd_postun_with_restart sccache-dist-scheduler.service %systemd_postun sccache-dist-server.service %files %license LICENSE %license cargo-vendor.txt %doc README.md %{_bindir}/sccache %files -n sccache-dist %license LICENSE %license cargo-vendor.txt %doc docs/Distributed.md docs/DistributedQuickstart.md docs/Configuration.md docs/Architecture.md %{_bindir}/sccache-dist %{_unitdir}/sccache-dist-scheduler.service %{_unitdir}/sccache-dist-server.service %{_sysusersdir}/sccache-dist.conf %dir %{_sysconfdir}/sccache %config(noreplace) %{_sysconfdir}/sccache/scheduler.toml.example %config(noreplace) %{_sysconfdir}/sccache/server.toml.example %changelog * Mon Jul 06 2026 Bahtiar `kalkin-` Gadimov - 1:0.16.0-1 - Initial package