From patchwork Wed Jun 14 09:29:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 50885 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9160127BBE2; Wed, 14 Jun 2023 10:37:50 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5038327BC01 for ; Wed, 14 Jun 2023 10:30:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9MpK-0001sR-1Y; Wed, 14 Jun 2023 05:30:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9MpH-0001ry-5j for guix-patches@gnu.org; Wed, 14 Jun 2023 05:30:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q9MpG-0005uk-Rx for guix-patches@gnu.org; Wed, 14 Jun 2023 05:30:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q9MpG-0003SZ-LI for guix-patches@gnu.org; Wed, 14 Jun 2023 05:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63641] [PATCH 0/8] Add libc specific to Hurd and update components Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Jun 2023 09:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63641 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: Janneke Nieuwenhuizen Cc: Josselin Poiret , 63641@debbugs.gnu.org Received: via spool by 63641-submit@debbugs.gnu.org id=B63641.168673497313231 (code B ref 63641); Wed, 14 Jun 2023 09:30:02 +0000 Received: (at 63641) by debbugs.gnu.org; 14 Jun 2023 09:29:33 +0000 Received: from localhost ([127.0.0.1]:43728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9Mom-0003RK-ML for submit@debbugs.gnu.org; Wed, 14 Jun 2023 05:29:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9Mok-0003R7-4C for 63641@debbugs.gnu.org; Wed, 14 Jun 2023 05:29:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9Moe-0005pv-Oh; Wed, 14 Jun 2023 05:29:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=J8gkumbQxsFh+K+yXBSH+1bwJkgxuBZU7omFFxfV6n4=; b=fpclrkQF2zBLxLnaNFfP O92ETXoK55mwfg7OY7bsGhOuy9A2NJJWvt3/ZTnF7tgL8y7zOOu8IAoxz0AM+0BTmI1q+kKJ7ShLN TQD6yjjwWQvVAL11K0n6bQ88GEQ5uMbBVkD/sAVRscmCvSr/QMHIxMMmJUktiWxz6E29InQWCnKRj VyrLKghpDxFPjV1NZg3uiNXhU3cBf11AD+ujb02EYjqbzKmwthXw4Rdw/HFUGBUfSzhe3b9YuDw9A xIJV9C5IGje09juQ7XqCwzq2Gp25UU1xCEjvI/cJW0GfJU2cf4SmSAiHU+pYSPrz/0rWGLv1b/YNx xpOpwHVDPyE+cg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9Moe-00050w-Bw; Wed, 14 Jun 2023 05:29:24 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <87jzx07lmr.fsf@jpoiret.xyz> <37e9697f42aecfb83757989f8172beba8faf32ab.1684748476.git.dev@jpoiret.xyz> <87y1l2moh1.fsf@gnu.org> <87a5xa1i7a.fsf@gnu.org> Date: Wed, 14 Jun 2023 11:29:21 +0200 In-Reply-To: <87a5xa1i7a.fsf@gnu.org> (Janneke Nieuwenhuizen's message of "Thu, 08 Jun 2023 10:17:29 +0200") Message-ID: <87zg52s87i.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello Janneke & Josselin, Janneke Nieuwenhuizen skribis: > Janneke Nieuwenhuizen writes: [...] >> As discussed on IRC, I found that we're still building glibc-2.35 during >> commencement. I overlooked that this recent patch of yours made these >> changes in commencement, so I already made patches for this (attached). > > Even with these patches (on wip-hurd now), gcc-toolchain still depends > on glibc-2.35 for offload builds, as you can see when doing > > ./pre-inst-env guix build --system=i568-gnu -d gcc-toolchain > > from GNU/Linux. When running this same build in a childhurd, the > glibc-2.35 dependency is gone. Note that gcc-final, i.e. > > ./pre-inst-env guix build --system=i568-gnu -d \ > -e '(@@ (gnu packages commencement) gcc-final)' > > does not depend ond glibc-2.35, but both glibc-final and > glibc-final-with-bootstrap-bash build 2.35 when using --system. Turns out that this was because ‘%final-inputs’ now also needs to be parameterized by system type so it returns the right ‘glibc-final’ package. Patch below. Josselin, Janneke: could you squash this with the original ‘libc-for-target’ patch? (Eventually we should update callers of ‘standard-packages’ so they pass the ‘system’ argument.) Thanks, Ludo’. diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 9435161969..7fb02cb3e8 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1677,6 +1677,6 @@ (define-public (%final-inputs) "Return the list of \"final inputs\"." ;; Avoid circular dependency by lazily resolving 'commencement'. (let ((iface (resolve-interface '(gnu packages commencement)))) - (module-ref iface '%final-inputs))) + ((module-ref iface '%final-inputs) (%current-system)))) ;;; base.scm ends here diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 055e14ba68..fb67b272a1 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3406,45 +3406,49 @@ (define sed-final (package/inherit sed (native-inputs `(("perl" ,perl-boot0)))))) (define-public %final-inputs - ;; Final derivations used as implicit inputs by 'gnu-build-system'. We - ;; still use 'package-with-bootstrap-guile' so that the bootstrap tools are - ;; used for origins that have patches, thereby avoiding circular - ;; dependencies. - (let ((finalize (compose with-boot6 - package-with-bootstrap-guile))) - `(,@(map (match-lambda - ((name package) - (list name (finalize package)))) - `(("tar" ,tar) - ("gzip" ,gzip) - ("bzip2" ,bzip2) - ("file" ,file) - ("diffutils" ,diffutils) - ("patch" ,patch) - ("findutils" ,findutils) - ("gawk" ,gawk))) - ("sed" ,sed-final) - ("grep" ,grep-final) - ("xz" ,xz-final) - ("coreutils" ,coreutils-final) - ("make" ,gnu-make-final) - ("bash" ,bash-final) - ("ld-wrapper" ,ld-wrapper) - ("binutils" ,binutils-final) - ("gcc" ,gcc-final) - ("libc" ,glibc-final) - ("libc:static" ,glibc-final "static") - ("locales" ,glibc-utf8-locales-final)))) + ;; The 'glibc-final' package is not the same depending on what system is + ;; targeted, so this whole list must be parameterized. + (mlambda (system) + ;; Final derivations used as implicit inputs by 'gnu-build-system'. We + ;; still use 'package-with-bootstrap-guile' so that the bootstrap tools are + ;; used for origins that have patches, thereby avoiding circular + ;; dependencies. + (let ((finalize (compose with-boot6 + package-with-bootstrap-guile))) + `(,@(map (match-lambda + ((name package) + (list name (finalize package)))) + `(("tar" ,tar) + ("gzip" ,gzip) + ("bzip2" ,bzip2) + ("file" ,file) + ("diffutils" ,diffutils) + ("patch" ,patch) + ("findutils" ,findutils) + ("gawk" ,gawk))) + ("sed" ,sed-final) + ("grep" ,grep-final) + ("xz" ,xz-final) + ("coreutils" ,coreutils-final) + ("make" ,gnu-make-final) + ("bash" ,bash-final) + ("ld-wrapper" ,ld-wrapper) + ("binutils" ,binutils-final) + ("gcc" ,gcc-final) + ("libc" ,glibc-final) + ("libc:static" ,glibc-final "static") + ("locales" ,glibc-utf8-locales-final))))) (define-public canonical-package - (let ((name->package (fold (lambda (input result) - (match input - ((_ package . outputs) - (vhash-cons (package-full-name package) - package result)))) - vlist-null - `(("guile" ,guile-final) - ,@%final-inputs)))) + (let ((name->package (mlambda (system) + (fold (lambda (input result) + (match input + ((_ package . outputs) + (vhash-cons (package-full-name package) + package result)))) + vlist-null + `(("guile" ,guile-final) + ,@(%final-inputs system)))))) (lambda (package) "Return the 'canonical' variant of PACKAGE---i.e., if PACKAGE is one of the implicit inputs of 'gnu-build-system', return that one, otherwise return @@ -3454,7 +3458,8 @@ (define-public canonical-package COREUTILS-FINAL vs. COREUTILS, etc." ;; XXX: This doesn't handle dependencies of the final inputs, such as ;; libunistring, GMP, etc. - (match (vhash-assoc (package-full-name package) name->package) + (match (vhash-assoc (package-full-name package) + (name->package (%current-system))) ((_ . canon) ;; In general we want CANON, except if we're cross-compiling: CANON ;; uses explicit inputs, so it is "anchored" in the bootstrapped @@ -3536,7 +3541,8 @@ (define* (make-gcc-toolchain gcc ;; install everything that we need, and (2) to make sure ld-wrapper comes ;; before Binutils' ld in the user's profile. (inputs `(("gcc" ,gcc) - ("ld-wrapper" ,(car (assoc-ref %final-inputs "ld-wrapper"))) + ("ld-wrapper" ,(car (assoc-ref (%final-inputs (%current-system)) + "ld-wrapper"))) ("binutils" ,binutils-final) ("libc" ,libc) ("libc-debug" ,libc "debug") diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 3308302472..c1aa187c42 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -266,13 +266,13 @@ (define (package-with-restricted-references p refs) p)) -(define (standard-packages) +(define* (standard-packages #:optional (system (%current-system))) "Return the list of (NAME PACKAGE OUTPUT) or (NAME PACKAGE) tuples of standard packages used as implicit inputs of the GNU build system." ;; Resolve (gnu packages commencement) lazily to hide circular dependency. (let ((distro (resolve-module '(gnu packages commencement)))) - (module-ref distro '%final-inputs))) + ((module-ref distro '%final-inputs) system))) (define* (lower name #:key source inputs native-inputs outputs target @@ -303,7 +303,7 @@ (define* (lower name (standard-cross-packages target 'host) '()) ,@(if implicit-inputs? - (standard-packages) + (standard-packages system) '()))) (host-inputs (if target inputs '())) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 9676271542..02716abc12 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -228,7 +228,8 @@ (define (options->update-specs opts) (let* ((input->package (match-lambda ((name (? package? package) _ ...) package) (_ #f))) - (final-inputs (map input->package %final-inputs)) + (final-inputs (map input->package + (%final-inputs (%current-system)))) (core (append final-inputs (append-map (compose (cut filter-map input->package <>) package-transitive-inputs)