Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-src: add sccache support
@ 2021-05-06  9:33 Logarithmus
  2021-05-06 10:16 ` [PR REVIEW] " q66
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06  9:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

There is a new pull request by Logarithmus against master on the void-packages repository

https://github.com/Logarithmus/void-packages xbps-sccache
https://github.com/void-linux/void-packages/pull/30702

xbps-src: add sccache support
This PR adds support for using `sccache` when building `cargo` crates with `xbps-src`, just like `ccache`.
Unfortunately, this PR is blocked by https://github.com/void-linux/void-packages/pull/29756.


A patch file from https://github.com/void-linux/void-packages/pull/30702.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xbps-sccache-30702.patch --]
[-- Type: text/x-diff, Size: 5190 bytes --]

From 83032395e951148196faa2ac187f01751614e567 Mon Sep 17 00:00:00 2001
From: Artur Sinila <freesoftware@logarithmus.dev>
Date: Thu, 6 May 2021 11:31:58 +0300
Subject: [PATCH] xbps-src: add sccache support

---
 README.md                         |  4 +++-
 common/build-helper/rust.sh       |  4 ++++
 common/xbps-src/shutils/chroot.sh |  2 +-
 srcpkgs/base-chroot/template      |  6 +++---
 xbps-src                          | 10 +++++++++-
 5 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 315e6858bfaf..5a985360292f 100644
--- a/README.md
+++ b/README.md
@@ -201,6 +201,7 @@ The following directory hierarchy is used with a default configuration file:
             |- hostdir
             |  |- binpkgs ...
             |  |- ccache ...
+            |  |- sccache ...
             |  |- distcc-<arch> ...
             |  |- repocache ...
             |  |- sources ...
@@ -218,6 +219,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.
@@ -443,7 +445,7 @@ The default masterdir is created in the current working directory, i.e `void-pac
 <a name="remaking-masterdir"></a>
 ### Remaking the masterdir
 
-If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/distcc/host` directories intact):
+If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/sccache/distcc/host` directories intact):
 
     $ ./xbps-src zap
     $ ./xbps-src binary-bootstrap
diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index 431cb5f0fd43..994a66916b26 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -4,6 +4,10 @@
 export CARGO_BUILD_JOBS="$XBPS_MAKEJOBS"
 export CARGO_HOME="/host/cargo"
 
+if [ "$XBPS_SCCACHE" = "yes" ]; then
+	export RUSTC_WRAPPER="sccache"
+fi
+
 if [ "$CROSS_BUILD" ]; then
 	# Define equivalent of TOML config in environment
 	# [target.${RUST_TARGET}]
diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh
index c7ada3151618..735dcfebd12f 100644
--- a/common/xbps-src/shutils/chroot.sh
+++ b/common/xbps-src/shutils/chroot.sh
@@ -88,7 +88,7 @@ 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" \
+    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
 
diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index 78f6d0cc2a1d..cf4f8504de1e 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.66
-revision=3
+version=0.67
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -17,6 +17,6 @@ esac
 depends+="
  base-files binutils gcc gcc-ada libada-devel
  patch sed findutils diffutils make gzip coreutils
- file bsdtar ccache xbps mpfr ncurses libreadline8
+ file bsdtar ccache rust-sccache>=0.2.15 xbps mpfr ncurses libreadline8
  chroot-bash chroot-grep chroot-gawk chroot-distcc
  chroot-util-linux chroot-git"
diff --git a/xbps-src b/xbps-src
index c3cd7e5db10b..d387b7a890d6 100755
--- a/xbps-src
+++ b/xbps-src
@@ -629,7 +629,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 \
@@ -672,6 +672,14 @@ if [ "$XBPS_CCACHE" ]; then
     mkdir -p $CCACHE_DIR
 fi
 
+#
+# Set up sccache
+#
+if [ "$XBPS_SCCACHE" ]; then
+    export SCCACHE_DIR="$XBPS_HOSTDIR/sccache"
+    mkdir -p $SCCACHE_DIR
+fi
+
 #
 # Set up distcc
 #

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
@ 2021-05-06 10:16 ` q66
  2021-05-06 10:24 ` Logarithmus
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: q66 @ 2021-05-06 10:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

New review comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627290964

Comment:
nope

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
  2021-05-06 10:16 ` [PR REVIEW] " q66
@ 2021-05-06 10:24 ` Logarithmus
  2021-05-06 10:24 ` Logarithmus
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 10:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

New review comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627296288

Comment:
Why?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
  2021-05-06 10:16 ` [PR REVIEW] " q66
  2021-05-06 10:24 ` Logarithmus
@ 2021-05-06 10:24 ` Logarithmus
  2021-05-06 10:26 ` Logarithmus
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 10:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

New review comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627296288

Comment:
@q66 why?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (2 preceding siblings ...)
  2021-05-06 10:24 ` Logarithmus
@ 2021-05-06 10:26 ` Logarithmus
  2021-05-06 10:48 ` q66
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 10:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New review comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627296288

Comment:
@q66 why? Should I omit version requirement on `rust-sccache`?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (3 preceding siblings ...)
  2021-05-06 10:26 ` Logarithmus
@ 2021-05-06 10:48 ` q66
  2021-05-06 12:19 ` Logarithmus
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: q66 @ 2021-05-06 10:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

New review comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627310750

Comment:
base-chroot only depends on bootstrap packages and sccache is not one, and will not be one, as that'd impose rust toolchain dependency for bootstrap and we!re not doing that

besides, sccache is limited to a small fraction of CPU architectures, which is another reason even if rust was bootstrap

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (4 preceding siblings ...)
  2021-05-06 10:48 ` q66
@ 2021-05-06 12:19 ` Logarithmus
  2021-05-06 12:23 ` Logarithmus
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 12:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

New review comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627366464

Comment:
OK, I'll remove `rust-sccache` from the dependencies. Instead, I'll add a note into README.md that in order to use `sccache` with `xbps-src`, one should run `xbps-install -r masterdir/ rust-sccache`.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (5 preceding siblings ...)
  2021-05-06 12:19 ` Logarithmus
@ 2021-05-06 12:23 ` Logarithmus
  2021-05-06 12:28 ` Piraty
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 12:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

New review comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627369423

Comment:
> besides, sccache is limited to a small fraction of CPU architectures, which is another reason even if rust was bootstrap

AFAIK plain `sccache` (local cache) should work as long as you have Rust for the architecture. `sccache-dist` (distributed compilation) works on Linux x86_64 only, but this PR isn't about `sccache-dist`.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (6 preceding siblings ...)
  2021-05-06 12:23 ` Logarithmus
@ 2021-05-06 12:28 ` Piraty
  2021-05-06 12:39 ` [PR REVIEW] " q66
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Piraty @ 2021-05-06 12:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

New comment by Piraty on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#issuecomment-833482908

Comment:
interesting. i looked into icecc for xbps-src myself, scache could be a viable alternative.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (7 preceding siblings ...)
  2021-05-06 12:28 ` Piraty
@ 2021-05-06 12:39 ` q66
  2021-05-06 12:40 ` q66
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: q66 @ 2021-05-06 12:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

New review comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627380472

Comment:
it doesn't, read the template you are updating

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (8 preceding siblings ...)
  2021-05-06 12:39 ` [PR REVIEW] " q66
@ 2021-05-06 12:40 ` q66
  2021-05-06 12:45 ` [PR PATCH] [Updated] " Logarithmus
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: q66 @ 2021-05-06 12:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

New review comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627381128

Comment:
(but also we're not gonna make rust toolchain a bootstrap package, so the point is moot)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (9 preceding siblings ...)
  2021-05-06 12:40 ` q66
@ 2021-05-06 12:45 ` Logarithmus
  2021-05-06 12:45 ` [PR REVIEW] " q66
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 12:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

There is an updated pull request by Logarithmus against master on the void-packages repository

https://github.com/Logarithmus/void-packages xbps-sccache
https://github.com/void-linux/void-packages/pull/30702

xbps-src: add sccache support
This PR adds support for using `sccache` when building `cargo` crates with `xbps-src`, just like `ccache`.
Unfortunately, this PR is blocked by https://github.com/void-linux/void-packages/pull/29756.


A patch file from https://github.com/void-linux/void-packages/pull/30702.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xbps-sccache-30702.patch --]
[-- Type: text/x-diff, Size: 6884 bytes --]

From e053e08717ab26d0e75d7d5ae144be86431e8871 Mon Sep 17 00:00:00 2001
From: Artur Sinila <freesoftware@logarithmus.dev>
Date: Thu, 6 May 2021 11:31:58 +0300
Subject: [PATCH] xbps-src: add sccache support

---
 README.md                         | 25 ++++++++++++++++++++++++-
 common/build-helper/rust.sh       |  4 ++++
 common/xbps-src/shutils/chroot.sh |  2 +-
 etc/defaults.conf                 |  8 ++++++++
 srcpkgs/base-chroot/template      |  4 ++--
 xbps-src                          | 10 +++++++++-
 6 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 315e6858bfaf..6874991c08ca 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,8 @@ See [Contributing](./CONTRIBUTING.md) for a general overview of how to contribut
 - [Package build options](#build-options)
 - [Sharing and signing your local repositories](#sharing-and-signing)
 - [Rebuilding and overwriting existing local packages](#rebuilding)
+- [Enabling ccache for caching C and C++ compilation](#ccache)
+- [Enabling sccache for caching Rust compilation](#sccache)
 - [Enabling distcc for distributed compilation](#distcc)
 - [Distfiles mirrors](#distfiles-mirrors)
 - [Cross compiling packages for a target architecture](#cross-compiling)
@@ -201,6 +203,7 @@ The following directory hierarchy is used with a default configuration file:
             |- hostdir
             |  |- binpkgs ...
             |  |- ccache ...
+            |  |- sccache ...
             |  |- distcc-<arch> ...
             |  |- repocache ...
             |  |- sources ...
@@ -218,6 +221,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.
@@ -344,6 +348,25 @@ Reinstalling this package in your target `rootdir` can be easily done too:
 > Please note that the `package expression` must be properly defined to explicitly pick up
 the package from the desired repository.
 
+
+<a name="ccache"></a>
+### Enabling ccache for caching C and C++ compilation
+
+Add this line to `void-packages/etc/conf` file:
+
+    XBPS_CCACHE=yes
+
+<a name="sccache"></a>
+### Enabling sccache for caching Rust compilation
+
+Install `rust-sccache` into `void-packages/masterdir/`:
+
+    xbps-install -r masterdir/ rust-sccache
+
+Add this line to `void-packages/etc/conf` file:
+
+    XBPS_SCCACHE=yes
+
 <a name="distcc"></a>
 ### Enabling distcc for distributed compilation
 
@@ -443,7 +466,7 @@ The default masterdir is created in the current working directory, i.e `void-pac
 <a name="remaking-masterdir"></a>
 ### Remaking the masterdir
 
-If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/distcc/host` directories intact):
+If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/sccache/distcc/host` directories intact):
 
     $ ./xbps-src zap
     $ ./xbps-src binary-bootstrap
diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index 431cb5f0fd43..994a66916b26 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -4,6 +4,10 @@
 export CARGO_BUILD_JOBS="$XBPS_MAKEJOBS"
 export CARGO_HOME="/host/cargo"
 
+if [ "$XBPS_SCCACHE" = "yes" ]; then
+	export RUSTC_WRAPPER="sccache"
+fi
+
 if [ "$CROSS_BUILD" ]; then
 	# Define equivalent of TOML config in environment
 	# [target.${RUST_TARGET}]
diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh
index c7ada3151618..735dcfebd12f 100644
--- a/common/xbps-src/shutils/chroot.sh
+++ b/common/xbps-src/shutils/chroot.sh
@@ -88,7 +88,7 @@ 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" \
+    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
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6147954a18af..5ab84a8eacc8 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -50,6 +50,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 #
 #XBPS_CCACHE=yes
 
+# [OPTIONAL]
+# Enable or disable sccache when building packages. The sccache directory
+# is stored in the hostdir, i.e hostdir/sccache. In order to use sccache,
+# you should install it by running `xbps-install -r masterdir/ rust-sccache`
+# in the root directory of `void-packages` repository
+#
+#XBPS_SCCACHE=yes
+
 # [OPTIONAL]
 # Enable or disable distcc when building packages. The distcc directory
 # is stored in the hostdir, i.e hostdir/distcc.
diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index 78f6d0cc2a1d..5f139acbbbac 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.66
-revision=3
+version=0.67
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
diff --git a/xbps-src b/xbps-src
index c3cd7e5db10b..d387b7a890d6 100755
--- a/xbps-src
+++ b/xbps-src
@@ -629,7 +629,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 \
@@ -672,6 +672,14 @@ if [ "$XBPS_CCACHE" ]; then
     mkdir -p $CCACHE_DIR
 fi
 
+#
+# Set up sccache
+#
+if [ "$XBPS_SCCACHE" ]; then
+    export SCCACHE_DIR="$XBPS_HOSTDIR/sccache"
+    mkdir -p $SCCACHE_DIR
+fi
+
 #
 # Set up distcc
 #

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (10 preceding siblings ...)
  2021-05-06 12:45 ` [PR PATCH] [Updated] " Logarithmus
@ 2021-05-06 12:45 ` q66
  2021-05-06 12:47 ` [PR PATCH] [Updated] " Logarithmus
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: q66 @ 2021-05-06 12:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

New review comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627385420

Comment:
also, installing manually into masterdir won't work either

if you want to do this you will need to find a way to have the masterdir lazily install it the first time you use it, similarly to the crosstoolchain and so on

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (11 preceding siblings ...)
  2021-05-06 12:45 ` [PR REVIEW] " q66
@ 2021-05-06 12:47 ` Logarithmus
  2021-05-06 12:54 ` [PR REVIEW] " ericonr
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 12:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

There is an updated pull request by Logarithmus against master on the void-packages repository

https://github.com/Logarithmus/void-packages xbps-sccache
https://github.com/void-linux/void-packages/pull/30702

xbps-src: add sccache support
This PR adds support for using `sccache` when building `cargo` crates with `xbps-src`, just like `ccache`.
Unfortunately, this PR is blocked by https://github.com/void-linux/void-packages/pull/29756.


A patch file from https://github.com/void-linux/void-packages/pull/30702.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xbps-sccache-30702.patch --]
[-- Type: text/x-diff, Size: 6427 bytes --]

From 7525d3bbb99a13f5acb56a03f58653ca18baa42b Mon Sep 17 00:00:00 2001
From: Artur Sinila <freesoftware@logarithmus.dev>
Date: Thu, 6 May 2021 11:31:58 +0300
Subject: [PATCH] xbps-src: add sccache support

---
 README.md                         | 25 ++++++++++++++++++++++++-
 common/build-helper/rust.sh       |  4 ++++
 common/xbps-src/shutils/chroot.sh |  2 +-
 etc/defaults.conf                 |  8 ++++++++
 xbps-src                          | 10 +++++++++-
 5 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 315e6858bfaf..6874991c08ca 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,8 @@ See [Contributing](./CONTRIBUTING.md) for a general overview of how to contribut
 - [Package build options](#build-options)
 - [Sharing and signing your local repositories](#sharing-and-signing)
 - [Rebuilding and overwriting existing local packages](#rebuilding)
+- [Enabling ccache for caching C and C++ compilation](#ccache)
+- [Enabling sccache for caching Rust compilation](#sccache)
 - [Enabling distcc for distributed compilation](#distcc)
 - [Distfiles mirrors](#distfiles-mirrors)
 - [Cross compiling packages for a target architecture](#cross-compiling)
@@ -201,6 +203,7 @@ The following directory hierarchy is used with a default configuration file:
             |- hostdir
             |  |- binpkgs ...
             |  |- ccache ...
+            |  |- sccache ...
             |  |- distcc-<arch> ...
             |  |- repocache ...
             |  |- sources ...
@@ -218,6 +221,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.
@@ -344,6 +348,25 @@ Reinstalling this package in your target `rootdir` can be easily done too:
 > Please note that the `package expression` must be properly defined to explicitly pick up
 the package from the desired repository.
 
+
+<a name="ccache"></a>
+### Enabling ccache for caching C and C++ compilation
+
+Add this line to `void-packages/etc/conf` file:
+
+    XBPS_CCACHE=yes
+
+<a name="sccache"></a>
+### Enabling sccache for caching Rust compilation
+
+Install `rust-sccache` into `void-packages/masterdir/`:
+
+    xbps-install -r masterdir/ rust-sccache
+
+Add this line to `void-packages/etc/conf` file:
+
+    XBPS_SCCACHE=yes
+
 <a name="distcc"></a>
 ### Enabling distcc for distributed compilation
 
@@ -443,7 +466,7 @@ The default masterdir is created in the current working directory, i.e `void-pac
 <a name="remaking-masterdir"></a>
 ### Remaking the masterdir
 
-If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/distcc/host` directories intact):
+If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/sccache/distcc/host` directories intact):
 
     $ ./xbps-src zap
     $ ./xbps-src binary-bootstrap
diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index 431cb5f0fd43..994a66916b26 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -4,6 +4,10 @@
 export CARGO_BUILD_JOBS="$XBPS_MAKEJOBS"
 export CARGO_HOME="/host/cargo"
 
+if [ "$XBPS_SCCACHE" = "yes" ]; then
+	export RUSTC_WRAPPER="sccache"
+fi
+
 if [ "$CROSS_BUILD" ]; then
 	# Define equivalent of TOML config in environment
 	# [target.${RUST_TARGET}]
diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh
index c7ada3151618..735dcfebd12f 100644
--- a/common/xbps-src/shutils/chroot.sh
+++ b/common/xbps-src/shutils/chroot.sh
@@ -88,7 +88,7 @@ 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" \
+    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
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6147954a18af..5ab84a8eacc8 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -50,6 +50,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 #
 #XBPS_CCACHE=yes
 
+# [OPTIONAL]
+# Enable or disable sccache when building packages. The sccache directory
+# is stored in the hostdir, i.e hostdir/sccache. In order to use sccache,
+# you should install it by running `xbps-install -r masterdir/ rust-sccache`
+# in the root directory of `void-packages` repository
+#
+#XBPS_SCCACHE=yes
+
 # [OPTIONAL]
 # Enable or disable distcc when building packages. The distcc directory
 # is stored in the hostdir, i.e hostdir/distcc.
diff --git a/xbps-src b/xbps-src
index c3cd7e5db10b..d387b7a890d6 100755
--- a/xbps-src
+++ b/xbps-src
@@ -629,7 +629,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 \
@@ -672,6 +672,14 @@ if [ "$XBPS_CCACHE" ]; then
     mkdir -p $CCACHE_DIR
 fi
 
+#
+# Set up sccache
+#
+if [ "$XBPS_SCCACHE" ]; then
+    export SCCACHE_DIR="$XBPS_HOSTDIR/sccache"
+    mkdir -p $SCCACHE_DIR
+fi
+
 #
 # Set up distcc
 #

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (12 preceding siblings ...)
  2021-05-06 12:47 ` [PR PATCH] [Updated] " Logarithmus
@ 2021-05-06 12:54 ` ericonr
  2021-05-06 12:59 ` Duncaen
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: ericonr @ 2021-05-06 12:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627392158

Comment:
Have the cargo build style pull it in if we aren't building `rust`, `cargo` or `sccache`? With a `rust_bootstrap` flag or whatever.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (13 preceding siblings ...)
  2021-05-06 12:54 ` [PR REVIEW] " ericonr
@ 2021-05-06 12:59 ` Duncaen
  2021-05-06 13:36 ` Logarithmus
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Duncaen @ 2021-05-06 12:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New review comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627395900

Comment:
I don't think we ever test for "yes", this should be `[ -n "$XBPS_SCCACHE" ]`.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (14 preceding siblings ...)
  2021-05-06 12:59 ` Duncaen
@ 2021-05-06 13:36 ` Logarithmus
  2021-05-06 13:39 ` [PR PATCH] [Updated] " Logarithmus
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 13:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

New review comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627426118

Comment:
> also, installing manually into masterdir won't work either
> 
> if you want to do this you will need to find a way to have the masterdir lazily install it the first time you use it, similarly to the crosstoolchain and so on

I've just checked it out: `./xbps-src clean` doesn't remove manually installed `sccache` from the `masterdir/`. `hostdir/sccache` is also preserved. Then if I try to build some Rust package (e. g. `fd`), `SCCACHE_DIR=hostdir/binpkgs sccache -s` reports cache hits.

https://user-images.githubusercontent.com/29541480/117307385-3356a100-ae89-11eb-9f77-44f8c6b50de1.mp4

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (15 preceding siblings ...)
  2021-05-06 13:36 ` Logarithmus
@ 2021-05-06 13:39 ` Logarithmus
  2021-05-06 13:39 ` [PR REVIEW] " Logarithmus
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 13:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

There is an updated pull request by Logarithmus against master on the void-packages repository

https://github.com/Logarithmus/void-packages xbps-sccache
https://github.com/void-linux/void-packages/pull/30702

xbps-src: add sccache support
This PR adds support for using `sccache` when building `cargo` crates with `xbps-src`, just like `ccache`.
Unfortunately, this PR is blocked by https://github.com/void-linux/void-packages/pull/29756.


A patch file from https://github.com/void-linux/void-packages/pull/30702.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xbps-sccache-30702.patch --]
[-- Type: text/x-diff, Size: 6422 bytes --]

From ddb9ba55796e3227b04f0afd02c62dfb8fa8b8ad Mon Sep 17 00:00:00 2001
From: Artur Sinila <freesoftware@logarithmus.dev>
Date: Thu, 6 May 2021 11:31:58 +0300
Subject: [PATCH] xbps-src: add sccache support

---
 README.md                         | 25 ++++++++++++++++++++++++-
 common/build-helper/rust.sh       |  4 ++++
 common/xbps-src/shutils/chroot.sh |  2 +-
 etc/defaults.conf                 |  8 ++++++++
 xbps-src                          | 10 +++++++++-
 5 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 315e6858bfaf..6874991c08ca 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,8 @@ See [Contributing](./CONTRIBUTING.md) for a general overview of how to contribut
 - [Package build options](#build-options)
 - [Sharing and signing your local repositories](#sharing-and-signing)
 - [Rebuilding and overwriting existing local packages](#rebuilding)
+- [Enabling ccache for caching C and C++ compilation](#ccache)
+- [Enabling sccache for caching Rust compilation](#sccache)
 - [Enabling distcc for distributed compilation](#distcc)
 - [Distfiles mirrors](#distfiles-mirrors)
 - [Cross compiling packages for a target architecture](#cross-compiling)
@@ -201,6 +203,7 @@ The following directory hierarchy is used with a default configuration file:
             |- hostdir
             |  |- binpkgs ...
             |  |- ccache ...
+            |  |- sccache ...
             |  |- distcc-<arch> ...
             |  |- repocache ...
             |  |- sources ...
@@ -218,6 +221,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.
@@ -344,6 +348,25 @@ Reinstalling this package in your target `rootdir` can be easily done too:
 > Please note that the `package expression` must be properly defined to explicitly pick up
 the package from the desired repository.
 
+
+<a name="ccache"></a>
+### Enabling ccache for caching C and C++ compilation
+
+Add this line to `void-packages/etc/conf` file:
+
+    XBPS_CCACHE=yes
+
+<a name="sccache"></a>
+### Enabling sccache for caching Rust compilation
+
+Install `rust-sccache` into `void-packages/masterdir/`:
+
+    xbps-install -r masterdir/ rust-sccache
+
+Add this line to `void-packages/etc/conf` file:
+
+    XBPS_SCCACHE=yes
+
 <a name="distcc"></a>
 ### Enabling distcc for distributed compilation
 
@@ -443,7 +466,7 @@ The default masterdir is created in the current working directory, i.e `void-pac
 <a name="remaking-masterdir"></a>
 ### Remaking the masterdir
 
-If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/distcc/host` directories intact):
+If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/sccache/distcc/host` directories intact):
 
     $ ./xbps-src zap
     $ ./xbps-src binary-bootstrap
diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index 431cb5f0fd43..e52212852d1c 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -4,6 +4,10 @@
 export CARGO_BUILD_JOBS="$XBPS_MAKEJOBS"
 export CARGO_HOME="/host/cargo"
 
+if [ -n "$XBPS_SCCACHE" ]; then
+	export RUSTC_WRAPPER="sccache"
+fi
+
 if [ "$CROSS_BUILD" ]; then
 	# Define equivalent of TOML config in environment
 	# [target.${RUST_TARGET}]
diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh
index c7ada3151618..735dcfebd12f 100644
--- a/common/xbps-src/shutils/chroot.sh
+++ b/common/xbps-src/shutils/chroot.sh
@@ -88,7 +88,7 @@ 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" \
+    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
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6147954a18af..5ab84a8eacc8 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -50,6 +50,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 #
 #XBPS_CCACHE=yes
 
+# [OPTIONAL]
+# Enable or disable sccache when building packages. The sccache directory
+# is stored in the hostdir, i.e hostdir/sccache. In order to use sccache,
+# you should install it by running `xbps-install -r masterdir/ rust-sccache`
+# in the root directory of `void-packages` repository
+#
+#XBPS_SCCACHE=yes
+
 # [OPTIONAL]
 # Enable or disable distcc when building packages. The distcc directory
 # is stored in the hostdir, i.e hostdir/distcc.
diff --git a/xbps-src b/xbps-src
index c3cd7e5db10b..d387b7a890d6 100755
--- a/xbps-src
+++ b/xbps-src
@@ -629,7 +629,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 \
@@ -672,6 +672,14 @@ if [ "$XBPS_CCACHE" ]; then
     mkdir -p $CCACHE_DIR
 fi
 
+#
+# Set up sccache
+#
+if [ "$XBPS_SCCACHE" ]; then
+    export SCCACHE_DIR="$XBPS_HOSTDIR/sccache"
+    mkdir -p $SCCACHE_DIR
+fi
+
 #
 # Set up distcc
 #

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (16 preceding siblings ...)
  2021-05-06 13:39 ` [PR PATCH] [Updated] " Logarithmus
@ 2021-05-06 13:39 ` Logarithmus
  2021-05-06 14:07 ` Johnnynator
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 13:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

New review comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#discussion_r627428727

Comment:
Fixed

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (17 preceding siblings ...)
  2021-05-06 13:39 ` [PR REVIEW] " Logarithmus
@ 2021-05-06 14:07 ` Johnnynator
  2021-05-06 14:48 ` Logarithmus
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Johnnynator @ 2021-05-06 14:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#issuecomment-833552762

Comment:
This will blow up once you run parallel builds in different masterdirs. sccache always listens on some tcp port on localhost. You would need to figure out how to either allocate a TCP port per masterdir or implement the communication via unix sockets and upstream it.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (18 preceding siblings ...)
  2021-05-06 14:07 ` Johnnynator
@ 2021-05-06 14:48 ` Logarithmus
  2021-05-06 14:52 ` ericonr
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Logarithmus @ 2021-05-06 14:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

New comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#issuecomment-833583789

Comment:
> This will blow up once you run parallel builds in different masterdirs. sccache always listens on some tcp port on localhost. You would need to figure out how to either allocate a TCP port per masterdir or implement the communication via unix sockets and upstream it.

I should definitely test this scenario. I still think this PR can be merged in its current state, because `$XBPS_SCCACHE` is turned off by default. Maybe I should add a disclaimer in `README.md` about parallel builds in differrent masterdirs though.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (19 preceding siblings ...)
  2021-05-06 14:48 ` Logarithmus
@ 2021-05-06 14:52 ` ericonr
  2021-05-06 14:52 ` ericonr
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: ericonr @ 2021-05-06 14:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#issuecomment-833587060

Comment:
- how faster do builds get?
- does it work for cooperation between different packages using the same crate?
- I'm against the need to install the package manually, it should be automated in some way (I suggested a solution above)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (20 preceding siblings ...)
  2021-05-06 14:52 ` ericonr
@ 2021-05-06 14:52 ` ericonr
  2022-05-19  2:16 ` github-actions
  2022-06-03  2:11 ` [PR PATCH] [Closed]: " github-actions
  23 siblings, 0 replies; 25+ messages in thread
From: ericonr @ 2021-05-06 14:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#issuecomment-833587060

Comment:
- how faster do builds get?
- does it work for cooperation between different packages using the same crate?
- I'm against the need to install the package manually, it should be automated in some way (I suggested a solution above)

And it can't be merged if it's waiting on another PR.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (21 preceding siblings ...)
  2021-05-06 14:52 ` ericonr
@ 2022-05-19  2:16 ` github-actions
  2022-06-03  2:11 ` [PR PATCH] [Closed]: " github-actions
  23 siblings, 0 replies; 25+ messages in thread
From: github-actions @ 2022-05-19  2:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/30702#issuecomment-1131014269

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Closed]: xbps-src: add sccache support
  2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
                   ` (22 preceding siblings ...)
  2022-05-19  2:16 ` github-actions
@ 2022-06-03  2:11 ` github-actions
  23 siblings, 0 replies; 25+ messages in thread
From: github-actions @ 2022-06-03  2:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

There's a closed pull request on the void-packages repository

xbps-src: add sccache support
https://github.com/void-linux/void-packages/pull/30702

Description:
This PR adds support for using `sccache` when building `cargo` crates with `xbps-src`, just like `ccache`.
Unfortunately, this PR is blocked by https://github.com/void-linux/void-packages/pull/29756.

Roadmap:
- [ ] Perform some benchmarks of build time speedups and share the results.
- [ ] Test caching crates across different packages.
- [ ] Implement `rust_bootstrap` flag into `xbps-src`, see #30702 (comment)
- [ ] Test parallel builds in different masterdirs, see https://github.com/void-linux/void-packages/pull/30702#issuecomment-833552762

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-06-03  2:11 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  9:33 [PR PATCH] xbps-src: add sccache support Logarithmus
2021-05-06 10:16 ` [PR REVIEW] " q66
2021-05-06 10:24 ` Logarithmus
2021-05-06 10:24 ` Logarithmus
2021-05-06 10:26 ` Logarithmus
2021-05-06 10:48 ` q66
2021-05-06 12:19 ` Logarithmus
2021-05-06 12:23 ` Logarithmus
2021-05-06 12:28 ` Piraty
2021-05-06 12:39 ` [PR REVIEW] " q66
2021-05-06 12:40 ` q66
2021-05-06 12:45 ` [PR PATCH] [Updated] " Logarithmus
2021-05-06 12:45 ` [PR REVIEW] " q66
2021-05-06 12:47 ` [PR PATCH] [Updated] " Logarithmus
2021-05-06 12:54 ` [PR REVIEW] " ericonr
2021-05-06 12:59 ` Duncaen
2021-05-06 13:36 ` Logarithmus
2021-05-06 13:39 ` [PR PATCH] [Updated] " Logarithmus
2021-05-06 13:39 ` [PR REVIEW] " Logarithmus
2021-05-06 14:07 ` Johnnynator
2021-05-06 14:48 ` Logarithmus
2021-05-06 14:52 ` ericonr
2021-05-06 14:52 ` ericonr
2022-05-19  2:16 ` github-actions
2022-06-03  2:11 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).