From: Logarithmus <Logarithmus@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] xbps-src: add sccache support
Date: Thu, 06 May 2021 11:33:29 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-30702@inbox.vuxu.org> (raw)
[-- 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
#
next reply other threads:[~2021-05-06 9:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 9:33 Logarithmus [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-30702@inbox.vuxu.org \
--to=logarithmus@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).