unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: Ulf Herrman <striness@tilde.club>, 65665@debbugs.gnu.org
Subject: bug#65665: package-mapping with #:deep? #t doesn't get all the implicit inputs
Date: Sat, 14 Oct 2023 16:47:22 +0200	[thread overview]
Message-ID: <87jzrpgt1h.fsf@gnu.org> (raw)
In-Reply-To: <87h6mv96fy.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 12 Oct 2023 12:00:33 -0400")

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

Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

>> It’s indeed the case that arguments can capture references to packages
>> that won’t be caught by ‘package-mapping’.  For instance, if you write:
>>
>>   (package
>>     …
>>     (arguments (list … #~(whatever #$coreutils))))
>>
>> … then ‘coreutils’ here cannot be replaced.
>>
>> To address this, the recommendation is to always add dependencies to
>> input fields and to use self-references within arguments.  The example
>> above should be written like this:
>>
>>   (package
>>     …
>>     (arguments
>>      (list … #~(whatever #$(this-package-input "coreutils")))))
>>
>> It’s just a recommendation and one can perfectly ignore it, and I
>> suppose that was the impetus for this patch.
>>
>> This is one of the things discussed while designing this change:
>>
>>   https://guix.gnu.org/en/blog/2021/the-big-change/
>>   (search for “self-referential records”)
>>
>>   https://issues.guix.gnu.org/49169
>>
>> My take was and still is that it’s an acceptable limitation.  Packagers
>> need to follow the guideline above if they want proper support for
>> rewriting, ‘guix graph’, and other tools.
>>
>> WDYT?
>
> But not all packages found in a bag come from inputs; they may be
> provided as an argument to the build system (cmake, meson, qt, etc. all
> allow for this).

Yes, but these packages (#:cmake for ‘cmake-build-system’, #:python for
‘python-build-system’, etc.) become inputs of the bag, and are taken
into account, as in this example:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix show tinyxml2
name: tinyxml2
version: 8.0.0
outputs:
+ out: everything
systems: x86_64-linux i686-linux
dependencies: 
location: gnu/packages/xml.scm:1295:2
homepage: http://www.grinninglizard.com/tinyxml2/
license: Zlib
synopsis: Small XML parser for C++  
description: TinyXML2 is a small and simple XML parsing library for the C++ programming
+ language.

$ ./pre-inst-env guix build tinyxml2
The following graft will be made:
   /gnu/store/qf8w8ch1mrxk6k34g2d6bisny5pq8gnv-tinyxml2-8.0.0.drv
applying 2 grafts for tinyxml2-8.0.0 ...
grafting '/gnu/store/ndzyiwhypsbgrbaz7rmz3649b6ghlfal-tinyxml2-8.0.0' -> '/gnu/store/2da5frl36gd51653bjjypqvwdk0bh25v-tinyxml2-8.0.0'...
successfully built /gnu/store/qf8w8ch1mrxk6k34g2d6bisny5pq8gnv-tinyxml2-8.0.0.drv
/gnu/store/2da5frl36gd51653bjjypqvwdk0bh25v-tinyxml2-8.0.0
$ ./pre-inst-env guix build tinyxml2 --with-input=cmake-minimal=cmake
The following derivation will be built:
  /gnu/store/hx0hx1nrmxzdhy9yw1d0md2q78y4spd4-tinyxml2-8.0.0.drv
8.4 MB will be downloaded:
  /gnu/store/qwy25ivr63087x9fdl9km0m44hn5bimg-cmake-3.25.1
  /gnu/store/3vh9b2i93na8wwdrj6n0q2qbgd2fzxik-tinyxml2-8.0.0-checkout

[...]

/gnu/store/cmn551x8iksy44cdqypyq2129lm8ym60-tinyxml2-8.0.0
--8<---------------cut here---------------end--------------->8---

(In this case I had to apply the patch below because ‘cmake-minimal’ was
mistakenly marked as hidden which, as implemented by
eee95b5a879b7096dffd533f24107cf8926b621e, meant that it could not be
replaced.)

I gave a similar example with ‘python-build-system’ here:

  https://issues.guix.gnu.org/65665#10

My understanding is that understanding is that this patch series is
about addressing cases as I explained above, where ‘arguments’ refer to
packages directly instead of using self references.  Do I get this
right, Ulf?

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 515 bytes --]

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index bc14286070..1592703f8d 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -263,6 +263,7 @@ (define-public cmake-minimal
   (package
     (inherit cmake-bootstrap)
     (name "cmake-minimal")
+    (properties (alist-delete 'hidden? (package-properties cmake-bootstrap)))
     (source (origin
               (inherit (package-source cmake-bootstrap))
               ;; Purge CMakes bundled dependencies as they are no longer needed.

  reply	other threads:[~2023-10-14 14:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 20:14 bug#65665: package-mapping with #:deep? #t doesn't get all the implicit inputs Ulf Herrman
2023-09-01 18:08 ` Csepp
2023-09-03 13:02 ` Maxim Cournoyer
2023-09-05 14:57 ` Simon Tournier
2023-09-16  9:45 ` bug#65665: [PATCH] Really " Ulf Herrman
2023-10-06  2:36   ` Maxim Cournoyer
2023-10-06  7:37     ` Ulf Herrman
2023-10-07  3:47       ` Ulf Herrman
2023-10-12 13:47       ` bug#65665: package-mapping with #:deep? #t doesn't " Ludovic Courtès
2023-10-12  7:07     ` bug#65665: [PATCH] Really " Ludovic Courtès
2023-10-12 14:22     ` Simon Tournier
2023-10-12 14:06   ` bug#65665: package-mapping with #:deep? #t doesn't " Ludovic Courtès
2023-10-12 16:00     ` Maxim Cournoyer
2023-10-14 14:47       ` Ludovic Courtès [this message]
2023-10-13  3:11     ` Ulf Herrman
2023-10-14 15:18       ` Ludovic Courtès
2023-10-15  7:12         ` Ulf Herrman
2023-10-21 14:31           ` Ludovic Courtès
2023-10-21 22:22             ` Ulf Herrman
2023-10-23 13:53               ` Simon Tournier
2023-10-12 13:53 ` Ludovic Courtès
2023-10-12 15:53   ` Maxim Cournoyer
2023-10-13  1:49     ` Ulf Herrman

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzrpgt1h.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=65665@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=striness@tilde.club \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).