guix_mirror_bot pushed a commit to branch core-packages-team in repository guix.
commit 5d2523f58fd2097d1880cc42ec945fbb4d0eec30 Author: Nicolas Graves <[email protected]> AuthorDate: Sat Feb 21 12:13:10 2026 +0100 gnu: boostrap glibcs: Drop input labels. * gnu/packages/base.scm (glibc)[arguments] <#:configure-flags>: Avoid assoc-ref to drop modules, and... <#:phases>: In phase 'pre-configure, avoid assoc-ref similarly, and... <#:modules>: ...add necessary modules to do so. * gnu/packages/commencement.scm (glibc-final-with-bootstrap-bash) [propagated-inputs, inputs]: Drop input lables. (glibc-final): Likewise. Change-Id: I359623b6e4e69f693701d74749f340c0b55ec775 Signed-off-by: Ludovic Courtès <[email protected]> --- gnu/packages/base.scm | 41 ++++++++++++++++++++++++++++++---------- gnu/packages/commencement.scm | 44 +++++++++++++++++++++++-------------------- 2 files changed, 55 insertions(+), 30 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 516ba62f79f..c2e185c9861 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -953,8 +953,10 @@ the store.") #:validate-runpath? #f #:modules `((ice-9 ftw) + (ice-9 match) (srfi srfi-1) (srfi srfi-26) + (guix build gremlin) (guix build utils) (guix build gnu-build-system)) @@ -983,12 +985,24 @@ the store.") (string-append "libc_cv_complocaledir=/run/current-system/locale/" #$(version-major+minor version)) - (string-append "--with-headers=" - (assoc-ref #$(if (%current-target-system) - #~%build-target-inputs - #~%build-inputs) - "kernel-headers") - "/include") + ;; Here we need to refer to kernel headers and not glibc-mesboot + (string-append + "--with-headers=" + (and=> + (find + (match-lambda + ((label . input) + (and (directory-exists? + (string-append input "/include/" #$(if (system-hurd?) + "mach" + "linux"))) + ;; Ensure we're not refering to another libc. + (not (file-exists? + (string-append input "/include/locale.h")))))) + #$(if (%current-target-system) + #~%build-target-inputs + #~%build-inputs)) + cdr) "/include") ;; This is the default for most architectures as of GNU libc 2.26, ;; but we specify it explicitly for clarity and consistency. See @@ -1011,10 +1025,17 @@ the store.") (add-before 'configure 'pre-configure (lambda* (#:key inputs native-inputs #:allow-other-keys) (let* ((bin (string-append #$output "/bin")) - ;; FIXME: Normally we would look it up only in INPUTS - ;; but cross-base uses it as a native input. - (bash (or (assoc-ref inputs "bash-static") - (assoc-ref native-inputs "bash-static")))) + (bash (find + (match-lambda + ((label . input) + (let ((sh (string-append input "/bin/sh"))) + (and (file-exists? sh) + ;; Is it bash-static specifically? The + ;; label can't be used because of + ;; bash-mesboot during the bootstrap. + (not (file-dynamic-info sh)))))) + inputs)) + (bash (and=> bash cdr))) ;; Install the rpc data base file under `$out/etc/rpc'. (substitute* "inet/Makefile" (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index f5db9cce349..dcc2781241d 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3029,7 +3029,8 @@ memoized as a function of '%current-system'." ;; store path has no dependencies. Actually, the really-final libc is ;; built just below; the only difference is that this one uses the ;; bootstrap Bash. - (let ((libc (libc-for-target (%current-system)))) + (let ((libc (libc-for-target (%current-system))) + (kernel-headers (kernel-headers-boot0))) (package (inherit libc) (name "glibc-intermediate") @@ -3066,25 +3067,27 @@ memoized as a function of '%current-system'." "/lib/libihash.a") "\n")))) #~())))))))) - (propagated-inputs `(("kernel-headers" ,(kernel-headers-boot0)))) + (propagated-inputs (list kernel-headers)) (native-inputs (list bison-boot0 perl-boot0 python-boot0 texinfo-boot0)) (inputs - `( ;; The boot inputs. That includes the bootstrap libc. We don't want - ;; it in $CPATH, hence the 'pre-configure' phase above. - ,@(%boot1-inputs) - - ;; A native MiG is needed to build Glibc on Hurd. - ,@(if (system-hurd?) - `(("mig" ,mig-boot0)) - '()) - - ;; Here, we use the bootstrap Bash, which is not satisfactory - ;; because we don't want to depend on bootstrap tools. - ("bash-static" ,(%boot0-bash))))))) + (append + ;; Order matters here, as glibc-mesboot also contains the same + ;; header files. + (list kernel-headers) + ;; The boot inputs, including the bootstrap libc. We don't + ;; want it in $CPATH, hence the 'pre-configure' phase above. + (map cadr (%boot1-inputs)) + ;; A native MiG is needed to build Glibc on Hurd. + (if (system-hurd?) + (list mig-boot0) + '()) + ;; TODO Here, we use the bootstrap Bash, which is not satisfactory + ;; because we don't want to depend on bootstrap tools. + (list (%boot0-bash))))))) (define (cross-gcc-wrapper gcc binutils glibc bash) "Return a wrapper for the pseudo-cross toolchain GCC/BINUTILS/GLIBC @@ -3211,14 +3214,15 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (package/inherit libc (name "glibc") (source (bootstrap-origin (package-source libc))) - (inputs `(("bash-static" ,static-bash-for-glibc) - ,@(alist-delete - "bash-static" - (package-inputs glibc-final-with-bootstrap-bash)))) + (inputs + (modify-inputs (package-inputs glibc-final-with-bootstrap-bash) + (delete "bash-mesboot") + (prepend static-bash-for-glibc))) ;; This time we need 'msgfmt' to install all the libc.mo files. - (native-inputs `(,@(package-native-inputs glibc-final-with-bootstrap-bash) - ("gettext" ,gettext-boot0))) + (native-inputs + (modify-inputs (package-native-inputs glibc-final-with-bootstrap-bash) + (append gettext-boot0))) (propagated-inputs (package-propagated-inputs glibc-final-with-bootstrap-bash))
