Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] fix sort-dependencies to use checkdepends
Date: Mon, 25 Dec 2023 16:18:39 +0100	[thread overview]
Message-ID: <20231225151839.93chARXDT3oUfv9MtJ3OMJMFpuCKGS9YXM8dz8GbEtc@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-47888@inbox.vuxu.org>

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

There is an updated 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: 2356 bytes --]

From 4bbf81d2b865ad7b1c1cf4959128b0af8f443c89 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] have show-build-deps include checkdepends when using -Q or -K

This makes sort-dependencies take checkdepends into account when using -Q or -K.

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:

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

Note that nothing is changed unless -Q or -K flag is passed.
---
 common/xbps-src/shutils/show.sh | 4 ++++
 xbps-src                        | 8 ++++++++
 2 files changed, 12 insertions(+)

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..f4afdd13f5f70 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.
@@ -860,6 +863,11 @@ case "$XBPS_TARGET" in
     show-build-deps)
         read_pkg ignore-problems
         show_pkg_build_deps
+        [ -n "$XBPS_CHECK_PKGS" ] && show_pkg_check_deps
+        ;;
+    show-check-deps)
+        read_pkg ignore-problems
+        show_pkg_check_deps
         ;;
     show-hostmakedepends)
         read_pkg ignore-problems

  parent reply	other threads:[~2023-12-25 15:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-23 22:56 [PR PATCH] " tornaria
2023-12-25  8:30 ` sgn
2023-12-25 14:41 ` tornaria
2023-12-25 14:52 ` tornaria
2023-12-25 15:18 ` tornaria [this message]
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

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=20231225151839.93chARXDT3oUfv9MtJ3OMJMFpuCKGS9YXM8dz8GbEtc@z \
    --to=tornaria@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).