Github messages for voidlinux
 help / color / mirror / Atom feed
From: icp1994 <icp1994@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] codeberg-cli: fix build
Date: Tue, 25 Apr 2023 22:09:54 +0200	[thread overview]
Message-ID: <20230425200954.A_Ie6YVHRH7d2j0w4mJ4edI3E7DoScgq7mVdMZQ_OhI@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-43614@inbox.vuxu.org>

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

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

https://github.com/icp1994/void-packages codeberg-cli
https://github.com/void-linux/void-packages/pull/43614

codeberg-cli: fix build
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture: **x86_64**

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-codeberg-cli-43614.patch --]
[-- Type: text/x-diff, Size: 4875 bytes --]

From 01dba46d5a92e78887df8dfe0e34011bf75ac9b2 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Wed, 26 Apr 2023 01:07:50 +0530
Subject: [PATCH 1/2] codeberg-cli: fix build

---
 srcpkgs/codeberg-cli/patches/update-lockfile.patch | 11 +++++++++++
 srcpkgs/codeberg-cli/template                      |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/codeberg-cli/patches/update-lockfile.patch

diff --git a/srcpkgs/codeberg-cli/patches/update-lockfile.patch b/srcpkgs/codeberg-cli/patches/update-lockfile.patch
new file mode 100644
index 000000000000..733a7c5fe850
--- /dev/null
+++ b/srcpkgs/codeberg-cli/patches/update-lockfile.patch
@@ -0,0 +1,11 @@
+--- a/Cargo.lock
++++ b/Cargo.lock
+@@ -195,7 +195,7 @@
+ 
+ [[package]]
+ name = "codeberg-cli"
+-version = "0.3.3"
++version = "0.3.4"
+ dependencies = [
+  "anyhow",
+  "chrono",
diff --git a/srcpkgs/codeberg-cli/template b/srcpkgs/codeberg-cli/template
index 7105ef51a309..5cf09bc3bb8c 100644
--- a/srcpkgs/codeberg-cli/template
+++ b/srcpkgs/codeberg-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'codeberg-cli'
 pkgname=codeberg-cli
 version=0.3.4
-revision=1
+revision=2
 build_style=cargo
 build_helper=qemu
 hostmakedepends="pkg-config"

From 6aacd42ee649b73ce0b639a8fb012c048b642651 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Fri, 13 Jan 2023 22:21:19 +0530
Subject: [PATCH 2/2] Enable usage of rust-sccache for cargo builds

---
 common/build-helper/rust.sh             | 5 +++++
 common/environment/build-style/cargo.sh | 4 ++++
 common/xbps-src/shutils/chroot.sh       | 4 ++--
 etc/defaults.conf                       | 6 ++++++
 xbps-src                                | 2 +-
 5 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index f689f7c7f9d9..3326d5eabf8f 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -30,6 +30,11 @@ else
 	unset CARGO_BUILD_TARGET
 fi
 
+if [ -n "$XBPS_SCCACHE" ]; then
+	export RUSTC_WRAPPER="/usr/bin/sccache"
+	export SCCACHE_DIR="${XBPS_HOSTDIR}/sccache"
+fi
+
 # For cross-compiling rust -sys crates
 export PKG_CONFIG_ALLOW_CROSS=1
 
diff --git a/common/environment/build-style/cargo.sh b/common/environment/build-style/cargo.sh
index bc836b06cf06..3a610b6993e8 100644
--- a/common/environment/build-style/cargo.sh
+++ b/common/environment/build-style/cargo.sh
@@ -4,6 +4,10 @@ if ! [[ "$pkgname" =~ ^cargo-auditable(-bootstrap)?$ ]]; then
 	hostmakedepends+=" cargo-auditable"
 fi
 
+if [ -n "$XBPS_SCCACHE" ] && [ "$pkgname" != "rust-sccache" ]; then
+	hostmakedepends+=" rust-sccache"
+fi
+
 if [ "$CROSS_BUILD" ]; then
 	makedepends+=" rust-std"
 fi
diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh
index d65d8d7e3074..65d1f6d71978 100644
--- a/common/xbps-src/shutils/chroot.sh
+++ b/common/xbps-src/shutils/chroot.sh
@@ -88,8 +88,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
diff --git a/etc/defaults.conf b/etc/defaults.conf
index f70e4ea3d006..422f85113625 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -55,6 +55,12 @@ 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.
+#
+#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 cdb5f8c6d643..49ac4c9b4bd2 100755
--- a/xbps-src
+++ b/xbps-src
@@ -658,7 +658,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_SCCACHE XBPS_CCACHE 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 \

  reply	other threads:[~2023-04-25 20:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 19:44 [PR PATCH] " icp1994
2023-04-25 20:09 ` icp1994 [this message]
2023-04-25 20:10 ` [PR PATCH] [Updated] " icp1994
2023-04-27  2:26 ` [PR PATCH] [Merged]: " abenson

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=20230425200954.A_Ie6YVHRH7d2j0w4mJ4edI3E7DoScgq7mVdMZQ_OhI@z \
    --to=icp1994@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).