SHA256
1
0
forked from pool/sccache

- explicitly depend on cargo to pull in latest compiler revision

- Update to version 0.8.1~31:
  * Add experimental concurrent cache support
  * build(deps): bump quinn-proto from 0.11.3 to 0.11.8 (#2254)
  * build(deps): bump which from 6.0.0 to 6.0.3 (#2252)
  * Disable "warnings as errors" flag for CL preprocessing (#2251)
  * Add windows arm64 to the CI (#2243)
  * build(deps): bump log from 0.4.20 to 0.4.22 (#2218)
  * feat: Bump opendal to 0.48.0 (#2240)
  * deps: update winapi-util (#2236)
  * refactor: use windows-sys instead of winapi (#2233)
  * build(deps): bump vmactions/freebsd-vm from 1.0.7 to 1.0.8 (#2219)
  * Add cache hit percentage to stats (#2211)
  * Add custom zstd compression level (#2199)
  * Remove the heapsize feature
  * Add lost feature status
  * Update OpenDAL for fixing #2220
  * build(deps): bump reqwest from 0.12.4 to 0.12.5 (#2215)
  * build(deps): bump uuid from 1.7.0 to 1.9.0 (#2213)
  * Update CI version of macOS
  * build(deps): bump zstd from 0.13.0 to 0.13.1
  * build(deps): bump async-trait from 0.1.77 to 0.1.80
  * build(deps): bump anyhow from 1.0.81 to 1.0.86
  * Format toml
  * refactor: Bump OpenDAL to 0.47
  * Remove ref_env
  * Fix clippy
  * Fix clippy
  * refactor: Bump MSRV to 1.75 for async in trait
  * Log when preprocessor cache cannot be used (#2197)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/sccache?expand=0&rev=66
This commit is contained in:
William Brown 2024-09-12 00:41:32 +00:00 committed by Git OBS Bridge
commit 280b72c6f4
15 changed files with 1376 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

12
_constraints Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<constraints>
<hardware>
<disk>
<!-- Needed because PPC chronically runs out of disk because sigghhh -->
<size unit="G">25</size>
</disk>
<physicalmemory>
<size unit="G">8</size>
</physicalmemory>
</hardware>
</constraints>

32
_service Normal file
View File

@ -0,0 +1,32 @@
<services>
<service mode="disabled" name="obs_scm">
<!-- <param name="url">https://github.com/mozilla/sccache.git</param> -->
<param name="url">https://github.com/Firstyear/sccache.git</param>
<param name="versionformat">@PARENT_TAG@~@TAG_OFFSET@</param>
<param name="scm">git</param>
<!-- <param name="revision">v0.3.0</param> -->
<param name="revision">20240910-suse-maint-v0.8.1</param>
<param name="match-tag">*</param>
<param name="versionrewrite-pattern">v(\d+\.\d+\.\d+)</param>
<param name="versionrewrite-replacement">\1</param>
<param name="changesgenerate">enable</param>
<param name="changesauthor">william.brown@suse.com</param>
</service>
<service mode="disabled" name="set_version"/>
<service mode="disabled" name="tar" />
<service mode="disabled" name="recompress">
<param name="file">*.tar</param>
<param name="compression">zst</param>
</service>
<service name="cargo_vendor" mode="disabled">
<param name="srcdir">sccache</param>
<param name="compression">zst</param>
<param name="update">true</param>
<!-- difficult to exploit side channel, no mitigations available yet -->
<!-- https://rustsec.org/advisories/RUSTSEC-2023-0071.html -->
<param name="i-accept-the-risk">RUSTSEC-2023-0071</param>
</service>
<service name="cargo_audit" mode="disabled">
<param name="srcdir">sccache</param>
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/Firstyear/sccache.git</param>
<param name="changesrevision">a144cea8da256a7fad8c1574325233c22a70a0fc</param></service></servicedata>

28
builder.conf Normal file
View File

@ -0,0 +1,28 @@
# This is where client toolchains will be stored.
# You should not need to change this as it is configured to work with systemd.
cache_dir = "/var/cache/sccache-builder/toolchains"
# The maximum size of the toolchain cache, in bytes.
# If unspecified the default is 10GB.
# toolchain_cache_size = 10737418240
# A public IP address and port that clients will use to connect to this builder.
public_addr = "127.0.0.1:10501"
# public_addr = "[::1]:10501"
# The URL used to connect to the scheduler (should use https, given an ideal
# setup of a HTTPS server in front of the scheduler)
scheduler_url = "https://127.0.0.1:10600"
[builder]
type = "overlay"
# The directory under which a sandboxed filesystem will be created for builds.
# You should not need to change this as it is configured to work with systemd.
build_dir = "/var/cache/sccache-builder/tmp"
# The path to the bubblewrap version 0.3.0+ `bwrap` binary.
# You should not need to change this as it is configured for a default SUSE install.
bwrap_path = "/usr/bin/bwrap"
[scheduler_auth]
type = "jwt_token"
# This will be generated by the `generate-jwt-hs256-server-token` command or
# provided by an administrator of the sccache cluster. See /etc/sccache/scheduler.conf
token = "token goes here"

22
client.example Normal file
View File

@ -0,0 +1,22 @@
# This file should be copied to ~/.config/sccache/config for your client.
# You can debug client issues by starting the server with:
# SCCACHE_NO_DAEMON=1 RUST_LOG=info /home/william/.cargo/bin/sccache --dist-status
[dist]
# The URL used to connect to the scheduler (should use https, given an ideal
# setup of a HTTPS server in front of the scheduler)
scheduler_url = "http://x.x.x.x:10600"
# scheduler_url = "http://[::abcd]:10600"
# Used for mapping local toolchains to remote cross-compile toolchains. Empty in
# this example where the client and build server are both Linux.
toolchains = []
# Size of the local toolchain cache, in bytes (5GB here, 10GB if unspecified).
# toolchain_cache_size = 5368709120
# The location of the toolchain cache.
cache_dir = "/tmp/toolchains"
[dist.auth]
# This should match the `client_auth` section of the scheduler config.
type = "token"
token = "token here"

3
sccache-0.8.1~2.tar.zst Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e80e164da121efbb6c34ced67b213183f8ce0b0f0ba578dcd323a75eb15518cb
size 265371

3
sccache-0.8.1~31.tar.zst Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3a68a50a5723037f1f74b645d7e28bfc3e06e8baf5d6425aeaad85262a10b30
size 292869

View File

@ -0,0 +1,30 @@
[Unit]
Description=sccache-dist builder
After=chronyd.service ntpd.service network-online.target
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=read-only
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
User=0
Type=simple
CacheDirectory=sccache-builder
Environment="RUST_LOG=sccache=info"
Environment="SCCACHE_NO_DAEMON=1"
ExecStart=sccache-dist server --config /etc/sccache/builder.conf
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,29 @@
[Unit]
Description=sccache-dist server
After=chronyd.service ntpd.service network-online.target
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=read-only
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
DynamicUser=yes
Type=simple
Environment="RUST_LOG=sccache=info"
Environment="SCCACHE_NO_DAEMON=1"
ExecStart=sccache-dist scheduler --config /etc/sccache/scheduler.conf
[Install]
WantedBy=multi-user.target

1043
sccache.changes Normal file

File diff suppressed because it is too large Load Diff

120
sccache.spec Normal file
View File

@ -0,0 +1,120 @@
#
# spec file for package sccache
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define configdir %{_sysconfdir}/%{name}
Name: sccache
Version: 0.8.1~31
Release: 0
Summary: A compiler caching tool for Rust, C and C++ with optional cloud storage
License: (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT) AND (Apache-2.0 OR CC0-1.0) AND ((Apache-2.0 AND BSD-2-Clause) OR MIT) AND (Apache-2.0 OR MIT OR BSD-2-Clause) AND (Apache-2.0 OR MIT OR Zlib) AND (Apache-2.0 OR MIT OR Zlib) AND (MIT OR Unlicense) AND (Apache-2.0 OR Zlib OR MIT) AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT
Group: Development/Languages/Rust
URL: https://github.com/mozilla/%{name}
Source0: %{name}-%{version}.tar.zst
Source1: vendor.tar.zst
Source10: sccache-dist-builder.service
Source11: sccache-dist-scheduler.service
Source12: builder.conf
Source13: scheduler.conf
Source14: client.example
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: pkgconfig(openssl) >= 3
Requires: bubblewrap
%description
Sccache is a ccache-like tool. It is used as a compiler wrapper and
avoids compilation when possible, storing a cache in a remote storage
using the Amazon Simple Cloud Storage Service (S3) API, Redis or
the Google Cloud Storage (GCS) API.
%prep
%setup -q
%setup -qa1
# Remove exec bits to prevent an issue in fedora shebang checking
find vendor -type f -name \*.rs -exec chmod -x '{}' \;
%build
%ifarch x86_64
# 'dist-server' available only on x86_64 so far - https://github.com/mozilla/sccache/issues/656
features="azure,s3,redis,dist-server,dist-client,concurrent-cache"
%else
%ifarch aarch64
features="azure,s3,redis,concurrent-cache"
%else
# Most other arches have issues (especially with ring). Use FS cache only
features="concurrent-cache"
%endif
%endif
%{cargo_build} --no-default-features --features=$features
%install
install -D -d -m 0755 %{buildroot}%{_bindir}
install -D -d -m 0755 %{buildroot}%{_unitdir}
install -D -d -m 0755 %{buildroot}%{configdir}
install -m 0755 %{_builddir}/%{name}-%{version}/target/release/sccache %{buildroot}%{_bindir}/sccache
%ifarch x86_64
install -m 0755 %{_builddir}/%{name}-%{version}/target/release/sccache-dist %{buildroot}%{_bindir}/sccache-dist
%endif
%ifarch x86_64
install -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}/sccache-dist-builder.service
install -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/sccache-dist-scheduler.service
%endif
install -m 0644 %{SOURCE12} %{buildroot}%{configdir}/builder.conf
install -m 0644 %{SOURCE13} %{buildroot}%{configdir}/scheduler.conf
install -m 0644 %{SOURCE14} %{buildroot}%{configdir}/client.example
%ifarch x86_64
%pre
%service_add_pre sccache-dist-builder.service
%service_add_pre sccache-dist-scheduler.service
%post
%service_add_post sccache-dist-builder.service
%service_add_post sccache-dist-scheduler.service
%preun
%service_del_preun sccache-dist-builder.service
%service_del_preun sccache-dist-scheduler.service
%postun
%service_del_postun sccache-dist-builder.service
%service_del_postun sccache-dist-scheduler.service
%endif
%files
%license LICENSE
%doc README.md
%{_bindir}/sccache
%ifarch x86_64
%{_bindir}/sccache-dist
%{_unitdir}/sccache-dist-builder.service
%{_unitdir}/sccache-dist-scheduler.service
%endif
%dir %{configdir}
%config(noreplace) %{configdir}/scheduler.conf
%config(noreplace) %{configdir}/builder.conf
%config(noreplace) %{configdir}/client.example
%changelog

23
scheduler.conf Normal file
View File

@ -0,0 +1,23 @@
# The socket address the scheduler will listen on. It's strongly recommended
# to listen on localhost and put a HTTPS server in front of it.
public_addr = "127.0.0.1:10600"
# public_addr = "[::1]:10600"
[client_auth]
# This is how a client will authenticate to the scheduler.
# # sccache-dist auth generate-shared-token --help
type = "token"
token = "token here"
#
# type = "jwt_hs256"
# secret_key = ""
[server_auth]
# sccache-dist auth --help
# To generate the secret_key:
# # sccache-dist auth generate-jwt-hs256-key
# To generate a key for a builder, use the command:
# # sccache-dist auth generate-jwt-hs256-server-token --config /etc/sccache/scheduler.conf --secret-key "..." --server "builderip:builderport"
type = "jwt_hs256"
secret_key = "my secret key"

3
vendor.tar.zst Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a89b0767377f84bcedae015d7b249d2a51d26a637b8e3b064cbd7bfcb6692ee3
size 43900314