From c72527831ede9f04c892b7b14d1c4772f800a187 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 30 Jan 2026 09:27:03 -0500 Subject: [PATCH 1/3] scache: update to 0.14.0, rename from rust-sccache, adopt --- srcpkgs/rust-sccache | 1 + srcpkgs/rust-sccache/template | 22 ---------------------- srcpkgs/sccache/template | 27 +++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 22 deletions(-) create mode 120000 srcpkgs/rust-sccache delete mode 100644 srcpkgs/rust-sccache/template create mode 100644 srcpkgs/sccache/template diff --git a/srcpkgs/rust-sccache b/srcpkgs/rust-sccache new file mode 120000 index 00000000000000..99b9e818dfe8dd --- /dev/null +++ b/srcpkgs/rust-sccache @@ -0,0 +1 @@ +sccache \ No newline at end of file diff --git a/srcpkgs/rust-sccache/template b/srcpkgs/rust-sccache/template deleted file mode 100644 index be0bd23e1d8ba6..00000000000000 --- a/srcpkgs/rust-sccache/template +++ /dev/null @@ -1,22 +0,0 @@ -# Template file for 'rust-sccache' -pkgname=rust-sccache -version=0.10.0 -revision=1 -build_style=cargo -make_check_args="-- --skip test_s3_invalid_args --skip test_sccache_command - --skip test_ldd_parse_v2_30 --skip test_rlib_dep_reader_call - --skip cache_hit_rate --skip log_no_perm --skip rust_cargo" -hostmakedepends="pkg-config" -makedepends="openssl-devel libzstd-devel" -short_desc="Sccache is a ccache-like tool" -maintainer="Enno Boland " -license="Apache-2.0" -homepage="https://crates.io/crates/sccache" -changelog="https://github.com/mozilla/sccache/releases" -distfiles="https://static.crates.io/crates/sccache/sccache-${version}.crate" -checksum=77727cb9a7b4e5cbc718811053088235d19e442079f43c01b77c8adfe818b40f - -case "$XBPS_TARGET_MACHINE" in - x86_64*|i686*|arm*|aarch64*) ;; - *) broken="ftbfs in ring" ;; -esac diff --git a/srcpkgs/sccache/template b/srcpkgs/sccache/template new file mode 100644 index 00000000000000..aaae445e9f5911 --- /dev/null +++ b/srcpkgs/sccache/template @@ -0,0 +1,27 @@ +# Template file for 'sccache' +pkgname=sccache +version=0.14.0 +revision=1 +build_style=cargo +make_check_args="-- --skip test_run_log_no_perm --skip test_ldd_parse_v2_30" +hostmakedepends="pkg-config" +makedepends="openssl-devel libzstd-devel" +checkdepends="clang" +short_desc="Ccache-like tool for rust and more" +maintainer="classabbyamp " +license="Apache-2.0" +homepage="https://crates.io/crates/sccache" +changelog="https://github.com/mozilla/sccache/releases" +distfiles="https://github.com/mozilla/sccache/archive/refs/tags/v${version}.tar.gz" +checksum=f2f194874e6b435896201655432f623d749f5583256f773743c376a6d06cede5 + +case "$XBPS_TARGET_MACHINE" in + x86_64*|i686*|arm*|aarch64*) ;; + *) broken="ftbfs in ring" ;; +esac + +rust-sccache_package() { + short_desc+=" (transitional dummy package)" + depends="${sourcepkg}>=${version}_${revision}" + metapackage=yes +} From d1cb537475f8d0cbb222e543f1d3499bd2953615 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 30 Jan 2026 09:28:22 -0500 Subject: [PATCH 2/3] base-chroot: depend on sccache for rust caching --- srcpkgs/base-chroot/template | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template index fa56045df0b174..ff14415fc5aadb 100644 --- a/srcpkgs/base-chroot/template +++ b/srcpkgs/base-chroot/template @@ -1,7 +1,7 @@ # Template file for 'base-chroot' pkgname=base-chroot version=0.67 -revision=4 +revision=5 bootstrap=yes metapackage=yes short_desc="Minimal set of packages required for chroot with xbps-src" @@ -25,4 +25,8 @@ depends+=" if [ "$CHROOT_READY" ]; then depends+=" ccache" + case "$XBPS_TARGET_MACHINE" in + # broken on other platforms due to ring + x86_64*|i686*|arm*|aarch64*) depends+=" sccache" ;; + esac fi From e0c78cccef23d4b18ca38082f4084e038d362a07 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 30 Jan 2026 09:28:49 -0500 Subject: [PATCH 3/3] xbps-src, common: support using sccache for rust compiler caching --- README.md | 1 + common/build-helper/rust.sh | 4 ++++ common/environment/configure/sccache.sh | 4 ++++ common/environment/setup/sourcepkg.sh | 2 ++ common/xbps-src/shutils/chroot.sh | 4 ++-- etc/defaults.conf | 5 +++++ xbps-src | 12 +++++++++++- 7 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 common/environment/configure/sccache.sh diff --git a/README.md b/README.md index 31680d84d79935..6b1d9951f05e77 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,7 @@ The description of these directories is as follows: - `builddir`: to unpack package source tarballs and where packages are built. - `destdir`: to install packages, aka **fake destdir**. - `hostdir/ccache`: to store ccache data if the `XBPS_CCACHE` option is enabled. + - `hostdir/sccache`: to store sccache data if the `XBPS_SCCACHE` option is enabled. - `hostdir/distcc-`: to store distcc data if the `XBPS_DISTCC` option is enabled. - `hostdir/repocache`: to store binary packages from remote repositories. - `hostdir/sources`: to store package sources. diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh index c28065f1a67624..11ad71eb5e36d9 100644 --- a/common/build-helper/rust.sh +++ b/common/build-helper/rust.sh @@ -93,3 +93,7 @@ exec /usr/bin/cargo auditable "$@" _EOF chmod 755 ${XBPS_WRAPPERDIR}/cargo + +if [ -n "$XBPS_SCCACHE" ]; then + export RUSTC_WRAPPER="/usr/bin/sccache" +fi diff --git a/common/environment/configure/sccache.sh b/common/environment/configure/sccache.sh new file mode 100644 index 00000000000000..bad813604d6a5c --- /dev/null +++ b/common/environment/configure/sccache.sh @@ -0,0 +1,4 @@ +# export SCCACHE_BASEDIRS="$wrksrc/$build_wrksrc" +export SCCACHE_BASEDIRS="$wrksrc" +export SCCACHE_ERROR_LOG="/tmp/sccache.log" +export SCCACHE_LOG="sccache::util=trace" diff --git a/common/environment/setup/sourcepkg.sh b/common/environment/setup/sourcepkg.sh index ea2409841a6542..fc7e26c2071b1f 100644 --- a/common/environment/setup/sourcepkg.sh +++ b/common/environment/setup/sourcepkg.sh @@ -27,6 +27,8 @@ for var in $(awk 'BEGIN{for (i in ENVIRON) {print i}}'