Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-src: break out of following cyclic dependencies
@ 2020-04-14 20:05 Chocimier
  2020-04-14 20:16 ` xtraeme
  2020-04-15 18:34 ` [PR PATCH] [Merged]: " Chocimier
  0 siblings, 2 replies; 3+ messages in thread
From: Chocimier @ 2020-04-14 20:05 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Chocimier/void-packages-org xbps-src-cycle
https://github.com/void-linux/void-packages/pull/20991

xbps-src: break out of following cyclic dependencies
Exit with error instead of looping forever.

Cycles exist when building with XBPS_CHECK_PKGS, and there is no point to resolve cycle in such case. Also useful to find cycle introduced into regular build.

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

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

From 378bb28a92f2c3238202a42076161308ccc6b5dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 14 Apr 2020 20:04:31 +0200
Subject: [PATCH] xbps-src: break out of following cyclic dependencies

---
 common/xbps-src/libexec/build.sh              | 6 ++++++
 common/xbps-src/shutils/build_dependencies.sh | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/common/xbps-src/libexec/build.sh b/common/xbps-src/libexec/build.sh
index cba71fbacad..6abc988298b 100755
--- a/common/xbps-src/libexec/build.sh
+++ b/common/xbps-src/libexec/build.sh
@@ -26,6 +26,12 @@ for f in $XBPS_SHUTILSDIR/*.sh; do
     . $f
 done
 
+last="${XBPS_DEPENDS_CHAIN##*,}"
+case "$XBPS_DEPENDS_CHAIN" in
+    *,$last,*)
+        msg_error "Build-time cyclic dependency$last,${XBPS_DEPENDS_CHAIN##*,$last,} detected.\n"
+esac
+
 setup_pkg "$PKGNAME" $XBPS_CROSS_BUILD
 readonly SOURCEPKG="$sourcepkg"
 
diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index b5b61616019..e743c697cd7 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -359,7 +359,7 @@ install_pkg_deps() {
         (
         curpkgdepname=$($XBPS_UHELPER_CMD getpkgname "$i" 2>/dev/null)
         setup_pkg $curpkgdepname
-        exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 \
+        exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 XBPS_DEPENDS_CHAIN="$XBPS_DEPENDS_CHAIN, $sourcepkg(host)" \
             $XBPS_LIBEXECDIR/build.sh $sourcepkg $pkg $target $cross_prepare || exit $?
         ) || exit $?
         host_binpkg_deps+=("$i")
@@ -372,7 +372,7 @@ install_pkg_deps() {
 
         curpkgdepname=$($XBPS_UHELPER_CMD getpkgname "$i" 2>/dev/null)
         setup_pkg $curpkgdepname $cross
-        exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 \
+        exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 XBPS_DEPENDS_CHAIN="$XBPS_DEPENDS_CHAIN, $sourcepkg(${cross:-host})" \
             $XBPS_LIBEXECDIR/build.sh $sourcepkg $pkg $target $cross $cross_prepare || exit $?
         ) || exit $?
         binpkg_deps+=("$i")
@@ -390,7 +390,7 @@ install_pkg_deps() {
             fi
         fi
         setup_pkg $curpkgdepname $cross
-        exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 \
+        exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 XBPS_DEPENDS_CHAIN="$XBPS_DEPENDS_CHAIN, $sourcepkg(${cross:-host})" \
             $XBPS_LIBEXECDIR/build.sh $sourcepkg $pkg $target $cross $cross_prepare || exit $?
         ) || exit $?
     done

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

* Re: xbps-src: break out of following cyclic dependencies
  2020-04-14 20:05 [PR PATCH] xbps-src: break out of following cyclic dependencies Chocimier
@ 2020-04-14 20:16 ` xtraeme
  2020-04-15 18:34 ` [PR PATCH] [Merged]: " Chocimier
  1 sibling, 0 replies; 3+ messages in thread
From: xtraeme @ 2020-04-14 20:16 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/20991#issuecomment-613658895

Comment:
Looks ok, thanks

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

* Re: [PR PATCH] [Merged]: xbps-src: break out of following cyclic dependencies
  2020-04-14 20:05 [PR PATCH] xbps-src: break out of following cyclic dependencies Chocimier
  2020-04-14 20:16 ` xtraeme
@ 2020-04-15 18:34 ` Chocimier
  1 sibling, 0 replies; 3+ messages in thread
From: Chocimier @ 2020-04-15 18:34 UTC (permalink / raw)
  To: ml

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

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

xbps-src: break out of following cyclic dependencies
https://github.com/void-linux/void-packages/pull/20991

Description:
Exit with error instead of looping forever.

Cycles exist when building with XBPS_CHECK_PKGS, and there is no point to resolve cycle in such case. Also useful to find cycle introduced into regular build.

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

end of thread, other threads:[~2020-04-15 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 20:05 [PR PATCH] xbps-src: break out of following cyclic dependencies Chocimier
2020-04-14 20:16 ` xtraeme
2020-04-15 18:34 ` [PR PATCH] [Merged]: " Chocimier

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).