From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: Re: Cross-compilation broken on canonical packages. Date: Tue, 31 Dec 2019 10:55:03 +0100 Message-ID: <87tv5gbz0o.fsf@gmail.com> References: <878snff7pv.fsf@gmail.com> <877e2zf7kv.fsf@gmail.com> <871rt0ntvy.fsf@gnu.org> <87fthc9vav.fsf@gmail.com> <87y2ut645u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59575) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imEF3-0006PC-M6 for guix-devel@gnu.org; Tue, 31 Dec 2019 04:55:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imEF1-0004mM-Nm for guix-devel@gnu.org; Tue, 31 Dec 2019 04:55:09 -0500 In-reply-to: <87y2ut645u.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hola, > However, the hack doesn=E2=80=99t work for things like the =E2=80=98packa= ges=E2=80=99 field of > because it=E2=80=99s not a thunked field. I see! Thanks for explaining. > > Two simple solutions here, I think: > > 1. Make =E2=80=98packages=E2=80=99 a thunked field. > > 2. Stop using =E2=80=98canonical-package=E2=80=99 altogether in =E2=80= =98%base-packages=E2=80=99. > > I actually have a preference for #2. We=E2=80=99d need to check what imp= act it > has on the system closure size, but I suspect it=E2=80=99s going to be mi= nimal. > > Thoughts? Option #2 seems nicer. There are other canonical-package calls when building services. I have a patch attached that removes all those calls. The image produced when running "guix system disk-image bare-bones.tmpl" increases by: * 30MB when removing the canonical-package of %base-packages * 30MB for all other calls. So altogether, that's a 60MB increase on a 1.5GB image (4%). I find it acceptable, WDYT? Thanks, Mathieu --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-system-Stop-using-canonical-package.patch >From a55eb86975c5f1c2783b0af265364821259e3351 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 31 Dec 2019 09:56:51 +0100 Subject: [PATCH] system: Stop using canonical-package. Usage of canonical-package outside of thunked fields breaks cross-compilation, see: https://lists.gnu.org/archive/html/guix-devel/2019-12/msg00410.html. * gnu/installer.scm (installer-program): Remove canonical-package. * gnu/services/base.scm (): Ditto, (%base-services): ditto. * gnu/services/xorg.scm: Remove useless canonical-package import. * gnu/system.scm (%base-packages): Remove canonical-package. * gnu/system/install.scm (%installation-services): Ditto, (installation-os): ditto. * gnu/system/locale.scm (single-locale-directory): Ditto, (%default-locale-libcs): ditto. --- gnu/installer.scm | 22 +++++++++++----------- gnu/services/base.scm | 10 ++++------ gnu/services/xorg.scm | 2 +- gnu/system.scm | 11 ++--------- gnu/system/install.scm | 7 +++---- gnu/system/locale.scm | 4 ++-- 6 files changed, 23 insertions(+), 33 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 167653263f..7f12b39ffc 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -290,17 +290,17 @@ selected keymap." (define set-installer-path ;; Add the specified binary to PATH for later use by the installer. #~(let* ((inputs - '#$(append (list bash ;start subshells - connman ;call connmanctl - cryptsetup - dosfstools ;mkfs.fat - e2fsprogs ;mkfs.ext4 - btrfs-progs - kbd ;chvt - guix ;guix system init call - util-linux ;mkwap - shadow) - (map canonical-package (list coreutils))))) + '#$(list bash ;start subshells + connman ;call connmanctl + cryptsetup + dosfstools ;mkfs.fat + e2fsprogs ;mkfs.ext4 + btrfs-progs + kbd ;chvt + guix ;guix system init call + util-linux ;mkwap + shadow + coreutils))) (with-output-to-port (%make-void-port "w") (lambda () (set-path-environment-variable "PATH" '("bin" "sbin") inputs))))) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index b1eff89ecc..b7cde09611 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -44,7 +44,7 @@ #:select (alsa-utils crda eudev e2fsprogs fuse gpm kbd lvm2 rng-tools)) #:use-module (gnu packages bash) #:use-module ((gnu packages base) - #:select (canonical-package coreutils glibc glibc-utf8-locales)) + #:select (coreutils glibc glibc-utf8-locales)) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (gnu packages linux) @@ -1208,7 +1208,7 @@ the tty to run, among other things." (name-services nscd-configuration-name-services ;list of (default '())) (glibc nscd-configuration-glibc ; - (default (canonical-package glibc)))) + (default glibc))) (define-record-type* nscd-cache make-nscd-cache nscd-cache? @@ -2441,9 +2441,7 @@ to handle." (rules (list lvm2 fuse alsa-utils crda)))) (service special-files-service-type - `(("/bin/sh" ,(file-append (canonical-package bash) - "/bin/sh")) - ("/usr/bin/env" ,(file-append (canonical-package coreutils) - "/bin/env")))))) + `(("/bin/sh" ,(file-append bash "/bin/sh")) + ("/usr/bin/env" ,(file-append coreutils "/bin/env")))))) ;;; base.scm ends here diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 9c84f7413f..4f6a8aec1e 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -29,7 +29,7 @@ #:use-module (gnu system keyboard) #:use-module (gnu services base) #:use-module (gnu services dbus) - #:use-module ((gnu packages base) #:select (canonical-package)) + #:use-module (gnu packages base) #:use-module (gnu packages guile) #:use-module (gnu packages xorg) #:use-module (gnu packages fonts) diff --git a/gnu/system.scm b/gnu/system.scm index abdbb081e6..3efa496194 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -591,18 +591,11 @@ of PROVENANCE-SERVICE-TYPE to its services." bash-completion - ;; XXX: We don't use (canonical-package guile-2.2) here because that - ;; would create a collision in the global profile between the GMP - ;; variant propagated by 'guile-final' and the GMP variant propagated - ;; by 'gnutls', itself propagated by 'guix'. guile-2.2 guile-readline guile-colorized - ;; The packages below are also in %FINAL-INPUTS, so take them from - ;; there to avoid duplication. - (map canonical-package - (list bash coreutils findutils grep sed - diffutils patch gawk tar gzip bzip2 xz lzip)))) + bash coreutils findutils grep sed + diffutils patch gawk tar gzip bzip2 xz lzip)) (define %default-issue ;; Default contents for /etc/issue. diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 4d1612ac7f..64fd1d1747 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -383,8 +383,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m ;; Having /bin/sh is a good idea. In particular it allows Tramp ;; connections to this system to work. (service special-files-service-type - `(("/bin/sh" ,(file-append (canonical-package bash) - "/bin/sh")))) + `(("/bin/sh" ,(file-append bash "/bin/sh")))) ;; Loopback device, needed by OpenSSH notably. (service static-networking-service-type @@ -407,7 +406,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m (list bare-bones-os glibc-utf8-locales texinfo - (canonical-package guile-2.2)))))) + guile-2.2))))) (define %issue ;; Greeting. @@ -479,7 +478,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m ;; Explicitly allow for empty passwords. (base-pam-services #:allow-empty-passwords? #t)) - (packages (cons* (canonical-package glibc) ;for 'tzselect' & co. + (packages (cons* glibc ;for 'tzselect' & co. parted gptfdisk ddrescue fontconfig font-dejavu font-gnu-unifont diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index 8466d5b07d..c7a371e9bf 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -86,7 +86,7 @@ or #f on failure." #f))) (define* (single-locale-directory locales - #:key (libc (canonical-package glibc))) + #:key (libc glibc)) "Return a directory containing all of LOCALES for LIBC compiled. Because locale data formats are incompatible when switching from one libc to @@ -147,7 +147,7 @@ data format changes between libc versions." (define %default-locale-libcs ;; The libcs for which we build locales by default. - (list (canonical-package glibc))) + (list glibc)) (define %default-locale-definitions ;; Arbitrary set of locales that are built by default. They are here mostly -- 2.24.1 --=-=-=--