unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Canonical-packages restoration.
Date: Wed, 10 Jun 2020 11:35:49 +0200	[thread overview]
Message-ID: <87zh9bmfey.fsf@gnu.org> (raw)
In-Reply-To: <875zc0gpuf.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 09 Jun 2020 18:34:48 +0200")

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


Hey Ludo!

> What if, instead, we removed those “canonical” packages entirely from
> the reference graph?  Do you think that’s an option?

It seems to be a better option! So, as I did remove most of the explicit
references to 'canonical-packages' the only references left are
implicit.

A good example is "isc-dhcp", that refers to implicit canonical inputs
"coreutils" and "sed" in the "dhclient-script". The attached patch fixes
it. I could do the same for a few other packages and it should fix the
issue.

The problem is that approach is not very long-term. Maybe we should take
a step back. Would it be an option to add all the canonical-packages as
disallowed-references? Or could we use implicit inputs that are not
rooted in the bootstrap chain?

>> My idea is to define something like:
>>
>> (define (canonical-package* package)
>>   (let ((canonical
>>          (module-ref (resolve-interface '(gnu packages base))
>>                      'canonical-package)))
>>     (let-system (system target)
>>       (if target
>>           package
>>           (canonical package)))))
>
> Aren’t there pieces of code that expect these things to be <package>
> records?

Yes, but I was planning to change that, not a good idea after all.

> Bah yes, that’s why initially I didn’t push ‘let-system’:
>
>   https://issues.guix.gnu.org/29296#4
>
> Perhaps we could avoid the expander = #f special case.

Ok, I will try to fix it then.

Thanks,

Mathieu

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 1593 bytes --]

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 77981e520a..537b162ba8 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1004,10 +1004,10 @@ connection alive.")
                ;; if finds all the programs it needs.
                (let* ((out       (assoc-ref outputs "out"))
                       (libexec   (string-append out "/libexec"))
-                      (coreutils (assoc-ref inputs "coreutils"))
+                      (coreutils (assoc-ref inputs "coreutils*"))
                       (inetutils (assoc-ref inputs "inetutils"))
                       (net-tools (assoc-ref inputs "net-tools"))
-                      (sed       (assoc-ref inputs "sed")))
+                      (sed       (assoc-ref inputs "sed*")))
                  (substitute* "client/scripts/linux"
                    (("/sbin/ip")
                     (string-append (assoc-ref inputs "iproute")
@@ -1047,12 +1047,8 @@ connection alive.")
                      (base32
                       "0vws0zzb39mkphj4hhjrgfj9dzw951lc4pfa6pqg5ll5ma51mbsr"))))
 
-                ;; When cross-compiling, we need the cross Coreutils and sed.
-                ;; Otherwise just use those from %FINAL-INPUTS.
-                ,@(if (%current-target-system)
-                      `(("coreutils" ,coreutils)
-                        ("sed" ,sed))
-                      '())))
+                ("coreutils*" ,coreutils)
+                ("sed*" ,sed)))
 
       (home-page "https://www.isc.org/products/DHCP/")
       (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")

  reply	other threads:[~2020-06-10  9:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 10:22 Canonical-packages restoration Mathieu Othacehe
2020-06-09 11:18 ` Jan Nieuwenhuizen
2020-06-09 11:30   ` Mathieu Othacehe
2020-06-09 16:34 ` Ludovic Courtès
2020-06-10  9:35   ` Mathieu Othacehe [this message]
2020-06-10 15:24     ` Ludovic Courtès

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=87zh9bmfey.fsf@gnu.org \
    --to=othacehe@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.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.
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).