Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] fix sort-dependencies to use checkdepends
@ 2023-12-23 22:56 tornaria
  2023-12-25  8:30 ` sgn
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: tornaria @ 2023-12-23 22:56 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tornaria/void-packages sort-deps
https://github.com/void-linux/void-packages/pull/47888

fix sort-dependencies to use checkdepends
As it is now, if `pkgA` checkdepends on `pkgB`, sort-dependencies will still print `pkgA` before `pkgB`. This causes CI to build `pkgB` twice: first build `pkgA` which forces implicit build of `pkgB`; then build of `pkgB` (explicit, so it will ignore the package is already built).

A concrete example:

```
$ ./xbps-src sort-dependencies python3-process-tests python3-pytest-cov
python3-pytest-cov
python3-process-tests
```
After this commit, the order above is the other way around.

The example above causes `python-process-tests` to be built twice, as shown in:
https://github.com/void-linux/void-packages/actions/runs/7107346278/job/19348602412?pr=47610

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sort-deps-47888.patch --]
[-- Type: text/x-diff, Size: 2817 bytes --]

From 416aa296a43c51cf224de81a632ea8d30a0efcc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 23 Dec 2023 19:40:53 -0300
Subject: [PATCH] fix sort-dependencies to use checkdepends

As it is now, if pkgA checkdepends on pkgB, sort-dependencies will still
print pkgA before pkgB. This causes CI to build pkgB twice: first build
pkgA which forces implicit build of pkgB; then build of pkgB (explicit,
so it will ignore the package is already built).

A concrete example:

$ ./xbps-src sort-dependencies python3-process-tests python3-pytest-cov
python3-pytest-cov
python3-process-tests

After this commit, the order above is the other way around.
---
 common/xbps-src/shutils/bulk.sh | 3 ++-
 common/xbps-src/shutils/show.sh | 4 ++++
 xbps-src                        | 7 +++++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/common/xbps-src/shutils/bulk.sh b/common/xbps-src/shutils/bulk.sh
index 69e36f4a43f4e..15a7dc6c94d12 100644
--- a/common/xbps-src/shutils/bulk.sh
+++ b/common/xbps-src/shutils/bulk.sh
@@ -35,7 +35,8 @@ bulk_sortdeps() {
     # Perform a topological sort of all pkgs but only with build dependencies
     # that are found in previous step.
     for pkg in ${pkgs}; do
-        _pkgs="$($XBPS_DISTDIR/xbps-src show-build-deps $pkg 2>/dev/null)"
+        _pkgs="$($XBPS_DISTDIR/xbps-src show-build-deps $pkg 2>/dev/null)
+               $($XBPS_DISTDIR/xbps-src show-check-deps $pkg 2>/dev/null)"
         found=0
         for x in ${_pkgs}; do
             _pkg=$(bulk_getlink $x)
diff --git a/common/xbps-src/shutils/show.sh b/common/xbps-src/shutils/show.sh
index 606396d2b4b1a..8af32295d25d5 100644
--- a/common/xbps-src/shutils/show.sh
+++ b/common/xbps-src/shutils/show.sh
@@ -120,6 +120,10 @@ show_pkg_build_deps() {
     show_pkg_build_depends "${makedepends} $(setup_pkg_depends '' 1 1)" "${hostmakedepends}"
 }
 
+show_pkg_check_deps() {
+    show_pkg_build_depends "${checkdepends}" ""
+}
+
 show_pkg_hostmakedepends() {
     show_pkg_build_depends "" "${hostmakedepends}"
 }
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643e..cf0d31ff903d4 100755
--- a/xbps-src
+++ b/xbps-src
@@ -91,6 +91,9 @@ show-avail <pkgname>
 show-build-deps <pkgname>
     Show required build dependencies for <pkgname>.
 
+show-check-deps <pkgname>
+    Show required check dependencies for <pkgname>.
+
 show-deps <pkgname>
     Show required run-time dependencies for <pkgname>. Package must be
     installed into destdir.
@@ -861,6 +864,10 @@ case "$XBPS_TARGET" in
         read_pkg ignore-problems
         show_pkg_build_deps
         ;;
+    show-check-deps)
+        read_pkg ignore-problems
+        show_pkg_check_deps
+        ;;
     show-hostmakedepends)
         read_pkg ignore-problems
         show_pkg_hostmakedepends

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

end of thread, other threads:[~2024-04-08  1:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-23 22:56 [PR PATCH] fix sort-dependencies to use checkdepends tornaria
2023-12-25  8:30 ` sgn
2023-12-25 14:41 ` tornaria
2023-12-25 14:52 ` tornaria
2023-12-25 15:18 ` [PR PATCH] [Updated] " tornaria
2023-12-25 15:34 ` tornaria
2023-12-26  3:19 ` [PR PATCH] [Updated] " tornaria
2023-12-26  3:37 ` tornaria
2023-12-26 15:48 ` [PR PATCH] [Updated] " tornaria
2023-12-26 16:10 ` Include checkdepends in show-build-deps / fix sort-dependencies for CI tornaria
2024-02-15 15:15 ` Accept -Q / -K in show-build-deps, sort-dependencies, xbps-cycles.py tornaria
2024-03-18  2:58 ` tornaria
2024-04-07 21:06 ` tornaria
2024-04-08  1:57 ` [PR PATCH] [Merged]: " sgn

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