Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<arch>`: 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.
Expand Down
4 changes: 4 additions & 0 deletions common/build-helper/rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions common/environment/configure/sccache.sh
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 2 additions & 0 deletions common/environment/setup/sourcepkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ for var in $(awk 'BEGIN{for (i in ENVIRON) {print i}}' </dev/null); do
;;
CCACHE_DIR | CCACHE_COMPRESS)
;;
SCCACHE_DIR | SCCACHE_CACHE_ZSTD_LEVEL | SCCACHE_IDLE_TIMEOUT)
;;
HTTP_PROXY | HTTPS_PROXY | SOCKS_PROXY | NO_PROXY | HTTP_PROXY_AUTH)
;;
FTP_PROXY | FTP_RETRIES)
Expand Down
4 changes: 2 additions & 2 deletions common/xbps-src/shutils/chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ PATH=/void-packages:/usr/bin

exec env -i -- SHELL=/bin/sh PATH="\$PATH" DISTCC_HOSTS="\$XBPS_DISTCC_HOSTS" DISTCC_DIR="/host/distcc" \
${XBPS_ARCH+XBPS_ARCH=$XBPS_ARCH} ${XBPS_CHECK_PKGS+XBPS_CHECK_PKGS=$XBPS_CHECK_PKGS} \
CCACHE_DIR="/host/ccache" IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 TERM=linux HOME="/tmp" \
PS1="[\u@$XBPS_MASTERDIR \W]$ " /bin/bash +h "\$@"
CCACHE_DIR="/host/ccache" SCCACHE_DIR="/host/sccache" IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 \
TERM=linux HOME="/tmp" PS1="[\u@$XBPS_MASTERDIR \W]$ " /bin/bash +h "\$@"
_EOF

chmod 755 $XBPS_MASTERDIR/bin/xbps-shell
Expand Down
5 changes: 5 additions & 0 deletions etc/defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ XBPS_SUCMD="sudo /bin/sh -c"
#
#XBPS_CCACHE=yes

# [OPTIONAL]
# Enable or disable sccache when building rust packages. The sccache directory
# is stored in the hostdir, i.e hostdir/sccache.
#XBPS_SCCACHE=yes

# [OPTIONAL]
# Enable or disable distcc when building packages. The distcc directory
# is stored in the hostdir, i.e hostdir/distcc.
Expand Down
6 changes: 5 additions & 1 deletion srcpkgs/base-chroot/template
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
1 change: 1 addition & 0 deletions srcpkgs/rust-sccache
22 changes: 0 additions & 22 deletions srcpkgs/rust-sccache/template

This file was deleted.

27 changes: 27 additions & 0 deletions srcpkgs/sccache/template
Original file line number Diff line number Diff line change
@@ -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 <void@placeviolette.net>"
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
}
12 changes: 11 additions & 1 deletion xbps-src
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
XBPS_CMPVER_CMD XBPS_FETCH_CMD XBPS_VERSION XBPS_BUILDSTYLEDIR \
XBPS_CPPFLAGS XBPS_CFLAGS XBPS_CXXFLAGS XBPS_FFLAGS XBPS_LDFLAGS \
XBPS_MAKEJOBS XBPS_BUILD_FORCEMODE XBPS_USE_GIT_REVS XBPS_DEBUG_PKGS \
XBPS_CHECK_PKGS XBPS_CCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \
XBPS_CHECK_PKGS XBPS_CCACHE XBPS_SCCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \
XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_ARG_PKG_OPTIONS XBPS_CONFIG_FILE \
XBPS_KEEP_ALL XBPS_HOSTDIR XBPS_MASTERDIR XBPS_SRC_VERSION \
XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \
Expand Down Expand Up @@ -748,6 +748,16 @@ if [ "$XBPS_CCACHE" ]; then
mkdir -p $CCACHE_DIR
fi

#
# Set up sccache
#
if [ "$XBPS_SCCACHE" ]; then
export SCCACHE_DIR="${XBPS_HOSTDIR}/sccache"
export SCCACHE_IDLE_TIMEOUT=60
export SCCACHE_CACHE_ZSTD_LEVEL=3
mkdir -p "$SCCACHE_DIR"
fi

#
# Set up distcc
#
Expand Down
Loading