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}}'