From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 28 08:58:50 2020 Received: (at submit) by debbugs.gnu.org; 28 Mar 2020 12:58:50 +0000 Received: from localhost ([127.0.0.1]:33732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIB34-000481-2W for submit@debbugs.gnu.org; Sat, 28 Mar 2020 08:58:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:52212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIB33-00047u-AE for submit@debbugs.gnu.org; Sat, 28 Mar 2020 08:58:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53151) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIB30-0001uY-U3 for bug-guix@gnu.org; Sat, 28 Mar 2020 08:58:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIB2z-0000vo-Bf for bug-guix@gnu.org; Sat, 28 Mar 2020 08:58:46 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:37879) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jIB2z-0000qm-0E for bug-guix@gnu.org; Sat, 28 Mar 2020 08:58:45 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: brice@waegenei.re) by relay8-d.mail.gandi.net (Postfix) with ESMTPA id C2DD41BF208 for ; Sat, 28 Mar 2020 12:58:40 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sat, 28 Mar 2020 12:58:40 +0000 From: Brice Waegeneire To: bug-guix@gnu.org Subject: linux-module-build-system don't support an inferior package as a kernel Message-ID: <4ace97d14da81f85ee833cacda791edb@waegenei.re> X-Sender: brice@waegenei.re User-Agent: Roundcube Webmail/1.3.8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.183.201 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Message Body Hello, The linux-module-build-system crash when using an inferior package as the kernel. I have first reported the issue in the second part of[0] and latter, reading[1] made me realize that the root cause was in `(guix `build-system linux-module)' and not directly related to the `kernel-loadable-modules' field. I tried fixing it myself but (guix inferior) seems to be missing some important procedures so I can manage to do it by myself - I don't have the skills to modify that part of the code base. A way to make a package by inheriting from a inferior-package would greatly help because `make-linux-module-builder' assume that it's argument is straight forward package. Following is the file `linux-module-inferior.scm' to reproduce the error: --8<---------------cut here---------------start------------->8--- (use-modules (gnu) (gnu system) (srfi srfi-1) (guix inferior) (guix utils) (guix packages) (guix channels)) (use-package-modules linux) (define channels (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "591faabd8c93bfb6879910d8a424f0db835066c2")))) (define my-linux (let ((inferior (inferior-for-channels channels))) (first (lookup-inferior-packages inferior "linux-libre" "4.4.217")))) (package/inherit ddcci-driver-linux (arguments (ensure-keyword-arguments (package-arguments ddcci-driver-linux) ;; `(#:linux ,(specification->package "linux-libre@4.4.217")) ; NOTE It works `(#:linux ,my-linux) ; NOTE It doesn't work ))) --8<---------------cut here---------------end--------------->8--- Here is the error: --8<---------------cut here---------------start------------->8--- LANGUAGE=C guix build -f linux-module-inferior.scm Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'... Backtrace: 1 (primitive-load "/home/bricewge/.config/guix/current/bi…") In guix/ui.scm: 1894:12 0 (run-guix-command _ . _) --8<---------------cut here---------------end--------------->8--- [0]: https://lists.gnu.org/archive/html/guix-devel/2020-03/msg00381.html [1]: https://issues.guix.info/issue/33719 Brice. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 01 11:30:45 2021 Received: (at 40272) by debbugs.gnu.org; 1 Aug 2021 15:30:45 +0000 Received: from localhost ([127.0.0.1]:36882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mADQK-0003RL-Sl for submit@debbugs.gnu.org; Sun, 01 Aug 2021 11:30:45 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:48397) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mADQI-0003R3-Gw for 40272@debbugs.gnu.org; Sun, 01 Aug 2021 11:30:43 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 085C5E0006 for <40272@debbugs.gnu.org>; Sun, 1 Aug 2021 15:30:35 +0000 (UTC) From: Brice Waegeneire To: 40272@debbugs.gnu.org Subject: Re: bug#40272: linux-module-build-system don't support an inferior package as a kernel References: <4ace97d14da81f85ee833cacda791edb@waegenei.re> Date: Sun, 01 Aug 2021 17:30:31 +0200 In-Reply-To: <4ace97d14da81f85ee833cacda791edb@waegenei.re> (Brice Waegeneire's message of "Sat, 28 Mar 2020 12:58:40 +0000") Message-ID: <87k0l5i3mw.fsf@waegenei.re> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40272 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Brice Waegeneire writes: > Message Body > Hello, > > The linux-module-build-system crash when using an inferior package as=20 > the > kernel. I have first reported the issue in the second part of[0] and > latter, reading[1] made me realize that the root cause was in `(guix > `build-system linux-module)' and not directly related to the > `kernel-loadable-modules' field. > > I tried fixing it myself but (guix inferior) seems to be missing some > important procedures so I can manage to do it by myself - I don't have=20 > the > skills to modify that part of the code base. A way to make a package by > inheriting from a inferior-package would greatly help because > `make-linux-module-builder' assume that it's argument is straight=20 > forward > package. Hello Guix, Gentle bump. The core of this issue is that a package can't depend on a because build systems assume the inputs are . Having a procedure 'inferior-package->package' would solve it, but I'm guessing this isn't possible. Here is an updated package file to reproduce the issue: --8<---------------cut here---------------start------------->8--- (use-modules (gnu) (gnu system) (srfi srfi-1) (guix inferior) (guix utils) (guix packages) (guix channels)) (use-package-modules linux) (define channels (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "6886c4960dd4d8913113ae0330cd8b2d27947a57")))) (define my-linux (let ((inferior (inferior-for-channels channels))) (first (lookup-inferior-packages inferior "linux-libre" "5.12")))) (package/inherit ddcci-driver-linux (arguments (ensure-keyword-arguments (package-arguments ddcci-driver-linux) ;; It works! ;; `(#:linux ,(specification->package ;; "linux-libre@5.12")) ;; It doesn't work... `(#:linux ,my-linux) ))) --8<---------------cut here---------------end--------------->8--- Here is the backtrace outputed when building the package: --8<---------------cut here---------------start------------->8--- $ COLUMNS=3D999 guix build -f ./40272.scm Backtrace: In guix/ui.scm: 463:3 19 (_) In ice-9/boot-9.scm: 1747:15 18 (with-exception-handler # _ #:unwind? _ #:unwind-for-type _) 1752:10 17 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) In guix/ui.scm: 450:6 16 (_) In guix/scripts/build.scm: 608:5 15 (_) In srfi/srfi-1.scm: 673:15 14 (append-map # ("x86_64-linux")) 586:17 13 (map1 ("x86_64-linux")) In guix/scripts/build.scm: 610:20 12 (_ _) In guix/store.scm: 1362:4 11 (map/accumulate-builds #= _ _) In srfi/srfi-1.scm: 586:17 10 (map1 (#)) In guix/store.scm: 1320:8 9 (call-with-build-handler # _) In guix/scripts/build.scm: 569:18 8 (_ _) In guix/packages.scm: 1177:16 7 (package-derivation _ # _ #:graft? _) 1494:22 6 (thunk) 1177:16 5 (package->bag _ _ _ #:graft? _) 1279:21 4 (thunk) In guix/build-system/linux-module.scm: 132:22 3 (lower "ddcci-driver-linux-0.3.3" #:source _ #:inputs _ #:nati= ve-inputs _ #:outputs _ #:system _ #:target _ #:linux _ . _) In ice-9/boot-9.scm: 1685:16 2 (raise-exception _ #:continuable? _) 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure %package-native-inputs-real: Wrong type argument: # --8<---------------cut here---------------end--------------->8--- Issue #48082=C2=B9 is probably linked with that one but I couldn't reproduce it. =C2=B9 https://issues.guix.gnu.org/48082 Cheers, - Brice From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 01 12:46:09 2021 Received: (at 40272) by debbugs.gnu.org; 1 Aug 2021 16:46:09 +0000 Received: from localhost ([127.0.0.1]:36920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAEbJ-0005GA-6L for submit@debbugs.gnu.org; Sun, 01 Aug 2021 12:46:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAEbH-0005Fr-PW for 40272@debbugs.gnu.org; Sun, 01 Aug 2021 12:46:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48636) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAEbC-0003ZM-2z; Sun, 01 Aug 2021 12:46:02 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45354 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAEbB-0001K0-Rg; Sun, 01 Aug 2021 12:46:02 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Brice Waegeneire Subject: Re: bug#40272: linux-module-build-system don't support an inferior package as a kernel References: <4ace97d14da81f85ee833cacda791edb@waegenei.re> <87k0l5i3mw.fsf@waegenei.re> Date: Sun, 01 Aug 2021 18:46:00 +0200 In-Reply-To: <87k0l5i3mw.fsf@waegenei.re> (Brice Waegeneire's message of "Sun, 01 Aug 2021 17:30:31 +0200") Message-ID: <875ywpxgdz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 40272 Cc: 40272@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Brice Waegeneire skribis: > In guix/build-system/linux-module.scm: > 132:22 3 (lower "ddcci-driver-linux-0.3.3" #:source _ #:inputs _ #:na= tive-inputs _ #:outputs _ #:system _ #:target _ #:linux _ . _) > In ice-9/boot-9.scm: > 1685:16 2 (raise-exception _ #:continuable? _) > 1685:16 1 (raise-exception _ #:continuable? _) > 1685:16 0 (raise-exception _ #:continuable? _) > > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > In procedure %package-native-inputs-real: Wrong type argument: # In this case, the problem is that (@ (guix build-system linux-module) lower) assumes that =E2=80=98linux=E2=80=99 is a : (build-inputs `(,@(if source `(("source" ,source)) '()) ,@native-inputs ;; TODO: Remove "gmp", "mpfr", "mpc" since they are ;; only needed to compile the gcc plugins. Maybe ;; remove "flex", "bison", "elfutils", "perl", ;; "openssl". That leaves very little ("bc", "gcc", ;; "kmod"). ,@(package-native-inputs linux) ;<----- HERE I suppose you could add a special-case for (inferior-package? linux). Not pretty, but it=E2=80=99d do the job. If we want to go further, we=E2=80=99ll have to end up with GOOPS=E2=80=A6 HTH! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 01 16:59:14 2021 Received: (at 40272) by debbugs.gnu.org; 1 Aug 2021 20:59:14 +0000 Received: from localhost ([127.0.0.1]:37014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAIYE-0005ZK-6Y for submit@debbugs.gnu.org; Sun, 01 Aug 2021 16:59:14 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:27413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAIYB-0005Z0-M2 for 40272@debbugs.gnu.org; Sun, 01 Aug 2021 16:59:13 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id C62B1240002; Sun, 1 Aug 2021 20:59:04 +0000 (UTC) From: Brice Waegeneire To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#40272: linux-module-build-system don't support an inferior package as a kernel References: <4ace97d14da81f85ee833cacda791edb@waegenei.re> <87k0l5i3mw.fsf@waegenei.re> <875ywpxgdz.fsf@gnu.org> Date: Sun, 01 Aug 2021 22:59:01 +0200 In-Reply-To: <875ywpxgdz.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sun, 01 Aug 2021 18:46:00 +0200") Message-ID: <87h7g8j2zu.fsf@waegenei.re> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40272 Cc: 40272@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Ludo=E2=80=99, Ludovic Court=C3=A8s writes: > [...] > In this case, the problem is that (@ (guix build-system linux-module) > lower) assumes that =E2=80=98linux=E2=80=99 is a : > > (build-inputs `(,@(if source > `(("source" ,source)) > '()) > ,@native-inputs > ;; TODO: Remove "gmp", "mpfr", "mpc" since they are > ;; only needed to compile the gcc plugins. Maybe > ;; remove "flex", "bison", "elfutils", "perl", > ;; "openssl". That leaves very little ("bc", "gcc", > ;; "kmod"). > ,@(package-native-inputs linux) ;<----- HERE > > I suppose you could add a special-case for (inferior-package? linux). > Not pretty, but it=E2=80=99d do the job. As I said on IRC, I had already tried that without success. I did the following change: --8<---------------cut here---------------start------------->8--- diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-m= odule.scm index fc3d959ce7..c30cac90f9 100644 --- a/guix/build-system/linux-module.scm +++ b/guix/build-system/linux-module.scm @@ -21,6 +21,7 @@ #:use-module (guix store) #:use-module (guix utils) #:use-module (guix derivations) + #:use-module (guix inferior) #:use-module (guix search-paths) #:use-module (guix build-system) #:use-module (guix build-system gnu) @@ -129,7 +130,10 @@ ;; remove "flex", "bison", "elfutils", "perl", ;; "openssl". That leaves very little ("bc", "gcc", ;; "kmod"). - ,@(package-native-inputs linux) + ;; ,@(package-native-inputs linux) + ,@(if (inferior-package? linux) + (inferior-package-native-inputs linux) + (package-native-inputs linux)) ,@if target ;; Use the standard cross inputs of ;; 'gnu-build-system'. --8<---------------cut here---------------end--------------->8--- Which produced this backtrace, which seems to indicate an issue in the 'package->bag' procedure: --8<---------------cut here---------------start------------->8--- $ COLUMNS=3D999 ./pre-inst-env guix build -f ./40272.scm Backtrace: In srfi/srfi-1.scm: 673:15 19 (append-map # ("x86_64-linux")) 586:17 18 (map1 ("x86_64-linux")) In guix/scripts/build.scm: 610:20 17 (_ _) In guix/store.scm: 1362:4 16 (map/accumulate-builds #= _ _) In srfi/srfi-1.scm: 586:17 15 (map1 (#)) In guix/store.scm: 1320:8 14 (call-with-build-handler # _) In guix/scripts/build.scm: 569:18 13 (_ _) In guix/packages.scm: 1177:16 12 (package-derivation _ # _ #:graft? _) 1494:22 11 (thunk) 1177:16 10 (package->bag _ _ _ #:graft? _) 1279:21 9 (thunk) In ice-9/eval.scm: 293:34 8 (_ #(#(#(#(#(#(#(#) "ddcci-driver-linux-0.3.3" (#:system "x86_64-linux" #:source= # url: "https://gitlab.com/ddcci-driver-linux/ddc= ci-driver-linux.git" commit: "v0.3.3" recursive?: #f> # () 7f8aef024060> #:i= nputs () #:native-inputs () #:outputs ("out") #:target #f #:tests? #f #:pha= ses (modify-phases %standard-phases (replace (quote build) (lambda args (fo= r-each (lambda (module) (with-directory-excursion module (apply (assoc-ref = %standard-phases (quote build)) args))) (quote ("ddcci" "ddcci-backlight"))= ) #t)) (replace (quote install) (lambda args (for-each (lambda (module) (wi= th-directory-excursion module (apply (assoc-ref %standard-phases (quote ins= tall)) args))) (quote ("ddcci" "ddcci-backlight"))) #t))) #:linux #) # url= : =E2=80=A6> =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80= =A6)) 159:9 7 (_ #(#(#(#(#(#(#(#) "ddcci-driver-linux-0.3.3" (#:system "x86_64-linux" #:source= # url: "https://gitlab.com/ddcci-driver-linux/ddc= ci-driver-linux.git" commit: "v0.3.3" recursive?: #f> # () 7f8aef024060> #:i= nputs () #:native-inputs () #:outputs ("out") #:target #f #:tests? #f #:pha= ses (modify-phases %standard-phases (replace (quote build) (lambda args (fo= r-each (lambda (module) (with-directory-excursion module (apply (assoc-ref = %standard-phases (quote build)) args))) (quote ("ddcci" "ddcci-backlight"))= ) #t)) (replace (quote install) (lambda args (for-each (lambda (module) (wi= th-directory-excursion module (apply (assoc-ref %standard-phases (quote ins= tall)) args))) (quote ("ddcci" "ddcci-backlight"))) #t))) #:linux #) # url= : =E2=80=A6> =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80= =A6)) 159:9 6 (_ #(#(#(#(#(#(#(#) "ddcci-driver-linux-0.3.3" (#:system "x86_64-linux" #:source= # url: "https://gitlab.com/ddcci-driver-linux/ddc= ci-driver-linux.git" commit: "v0.3.3" recursive?: #f> # () 7f8aef024060> #:i= nputs () #:native-inputs () #:outputs ("out") #:target #f #:tests? #f #:pha= ses (modify-phases %standard-phases (replace (quote build) (lambda args (fo= r-each (lambda (module) (with-directory-excursion module (apply (assoc-ref = %standard-phases (quote build)) args))) (quote ("ddcci" "ddcci-backlight"))= ) #t)) (replace (quote install) (lambda args (for-each (lambda (module) (wi= th-directory-excursion module (apply (assoc-ref %standard-phases (quote ins= tall)) args))) (quote ("ddcci" "ddcci-backlight"))) #t))) #:linux #) # url= : =E2=80=A6> =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80= =A6)) 159:9 5 (_ #(#(#(#(#(#(#(#) "ddcci-driver-linux-0.3.3" (#:system "x86_64-linux" #:source= # url: "https://gitlab.com/ddcci-driver-linux/ddc= ci-driver-linux.git" commit: "v0.3.3" recursive?: #f> # () 7f8aef024060> #:i= nputs () #:native-inputs () #:outputs ("out") #:target #f #:tests? #f #:pha= ses (modify-phases %standard-phases (replace (quote build) (lambda args (fo= r-each (lambda (module) (with-directory-excursion module (apply (assoc-ref = %standard-phases (quote build)) args))) (quote ("ddcci" "ddcci-backlight"))= ) #t)) (replace (quote install) (lambda args (for-each (lambda (module) (wi= th-directory-excursion module (apply (assoc-ref %standard-phases (quote ins= tall)) args))) (quote ("ddcci" "ddcci-backlight"))) #t))) #:linux #) # url= : =E2=80=A6> =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80= =A6)) 293:34 4 (_ #(#(#) #)) 159:9 3 (_ #(#(#) #)) In ice-9/boot-9.scm: 1685:16 2 (raise-exception _ #:continuable? _) 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure package-name: Wrong type argument: # --8<---------------cut here---------------end--------------->8--- > If we want to go further, we=E2=80=99ll have to end up with GOOPS=E2=80=A6 > [...] Building a parent class of and looks really involved to just fix this issue. Is there another way, or are we forced to use GOOPS in that case? Cheers, - Brice From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 02 13:12:30 2021 Received: (at 40272) by debbugs.gnu.org; 2 Aug 2021 17:12:30 +0000 Received: from localhost ([127.0.0.1]:39166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAbUM-0007AY-I4 for submit@debbugs.gnu.org; Mon, 02 Aug 2021 13:12:30 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:35242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAbUG-0007AM-Uc for 40272@debbugs.gnu.org; Mon, 02 Aug 2021 13:12:29 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by albert.telenet-ops.be with bizsmtp id chCP250090mfAB406hCPXE; Mon, 02 Aug 2021 19:12:23 +0200 Message-ID: Subject: Re: bug#40272: linux-module-build-system don't support an inferior package as a kernel From: Maxime Devos To: Brice Waegeneire , Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Mon, 02 Aug 2021 19:12:18 +0200 In-Reply-To: <87h7g8j2zu.fsf@waegenei.re> References: <4ace97d14da81f85ee833cacda791edb@waegenei.re> <87k0l5i3mw.fsf@waegenei.re> <875ywpxgdz.fsf@gnu.org> <87h7g8j2zu.fsf@waegenei.re> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-BwaDGIGZmfVJi1dnMenR" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1627924343; bh=5UR1zpcIaC1xJgusBE/O5RrRVMJVkG4jqZzi8Uk6X30=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Yg9Gb6AJWZio4/uyq8n9RTyb5177UIqCQLO4TzNwhivRjeHJLY6MJVfMzyuhMlHpx 4SG6Vppp2s37ZICa/09aO8CQv2QPnAb2rE8ZBZcbijRb2bqICpztYSnEJSLJWLge6T fkjQQFoolOoHuSHsp6Z95PjJo4Ec9iigawEsCkQgLC2rbg0yzIePawm87rx6tK/8Wo z1Xe+EsS+v8VdwnPrfQUKMdZY+wN/YMUbpnm11U4IecRtXmI0q3+sSuL6+klTPhQ2P +ZpAp31XL1VxQGXEi8xRaC8ZtFJ5MrbrdZD/dQ2ehT7h89sHiSF0TfLAvIGfItGnWj FHg2KzfW0fq5g== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40272 Cc: 40272@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-BwaDGIGZmfVJi1dnMenR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Brice Waegeneire schreef op zo 01-08-2021 om 22:59 [+0200]: > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > In procedure package-name: Wrong type argument: # > --8<---------------cut here---------------end--------------->8--- >=20 > > If we want to go further, we=E2=80=99ll have to end up with GOOPS=E2=80= =A6 > > [...] >=20 > Building a parent class of and looks really > involved to just fix this issue. Is there another way, or are we forced = to > use GOOPS in that case? Going full GOOPS isn't necessary. Something like 'define-gexp-compiler' could be useful here, to make 'package-inputs' and the like support inferior packages. More specifically, something like this: ;; In (guix packages) (define %inputs-hashtable (make-hash-table 2)) (define (package-inputs package) ;; Fast path: package is actually a (if (eq? (struct-vtable package) ) (%package-inputs package) ; expects a ((hashq-ref %inputs-hashtable (struct-vtable package)) package))) ;; In (guix inferior): (hashq-set! %inputs-hashtable %inferior-package-inputs) and likewise for native-inputs, propagated-inputs, name, version, ... (some macroology is recommended). Or, simpler, but less extensible (but probably good enough): (define-module (guix packages) [...] #:autoload (guix inferior) (inferior-package-inputs [...])) [...] (define (package-inputs package) (cond ((package? package) (%package-inputs package))=20 ((inferior-package? package) (inferior-package-inputs package)) (#t (error (G_ "tried to use 'package-inputs' on a non-package obje= ct ~a") package)))) The idea of both suggestions is to let 'package-name', 'package-native-inpu= ts', ... work on both regular and objects. Greetings, Maxime. --=-BwaDGIGZmfVJi1dnMenR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYQgnchccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mBGAPwOD7uwLEjgsI40fngUe52n8gp3 6X+rrZLYe8AtDMc9agD9FTyF5fgeKSlfZ08Ipj0SK5es3j+Ei0oA9UOymaVggAg= =v7sF -----END PGP SIGNATURE----- --=-BwaDGIGZmfVJi1dnMenR-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 02 15:03:36 2021 Received: (at 40272) by debbugs.gnu.org; 2 Aug 2021 19:03:36 +0000 Received: from localhost ([127.0.0.1]:39301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAdDs-0001QM-39 for submit@debbugs.gnu.org; Mon, 02 Aug 2021 15:03:36 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:39860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAdDq-0001QE-IR for 40272@debbugs.gnu.org; Mon, 02 Aug 2021 15:03:35 -0400 Received: from localhost (84-115-233-88.cable.dynamic.surfer.at [84.115.233.88]) by dd26836.kasserver.com (Postfix) with ESMTPSA id DFCCF336064D; Mon, 2 Aug 2021 21:03:32 +0200 (CEST) Date: Mon, 2 Aug 2021 21:03:21 +0200 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: bug#40272: linux-module-build-system don't support an inferior package as a kernel Message-ID: <20210802210129.0a281c96@scratchpost.org> In-Reply-To: <875ywpxgdz.fsf@gnu.org> References: <4ace97d14da81f85ee833cacda791edb@waegenei.re> <87k0l5i3mw.fsf@waegenei.re> <875ywpxgdz.fsf@gnu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/.l72Tw0W=3_+LVg.7fVP4y7"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40272 Cc: 40272@debbugs.gnu.org, Brice Waegeneire X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/.l72Tw0W=3_+LVg.7fVP4y7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On Sun, 01 Aug 2021 18:46:00 +0200 Ludovic Court=C3=A8s wrote: > Brice Waegeneire skribis: >=20 > > In guix/build-system/linux-module.scm: > > 132:22 3 (lower "ddcci-driver-linux-0.3.3" #:source _ #:inputs _ #:= native-inputs _ #:outputs _ #:system _ #:target _ #:linux _ . _) > > In ice-9/boot-9.scm: > > 1685:16 2 (raise-exception _ #:continuable? _) > > 1685:16 1 (raise-exception _ #:continuable? _) > > 1685:16 0 (raise-exception _ #:continuable? _) > > > > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > > In procedure %package-native-inputs-real: Wrong type argument: # =20 >=20 > In this case, the problem is that (@ (guix build-system linux-module) > lower) assumes that =E2=80=98linux=E2=80=99 is a : >=20 > (build-inputs `(,@(if source > `(("source" ,source)) > '()) > ,@native-inputs > ;; TODO: Remove "gmp", "mpfr", "mpc" since they are > ;; only needed to compile the gcc plugins. Maybe > ;; remove "flex", "bison", "elfutils", "perl", > ;; "openssl". That leaves very little ("bc", "gcc", > ;; "kmod"). > ,@(package-native-inputs linux) ;<----- HERE >=20 > I suppose you could add a special-case for (inferior-package? linux). > Not pretty, but it=E2=80=99d do the job. Or, as the comment says, it might be enough just to not get the package-native-inputs from the package ever, but do hard-code bc, gcc and kmod. Maybe add a comment why :) The reason I hadn't done that back then is because it's slightly less maintenance to not have Linux's native-inputs copy&pasted like this (one day, Linux could switch the GCC version they use). But really, we should be good for years anyway. I'm not sure whether Linux checks whether it's being compiled with the right compiler, though. If not, that could cause some nasty silent miscompilations in the future. --Sig_/.l72Tw0W=3_+LVg.7fVP4y7 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAmEIQXkACgkQ5xo1VCww uqWbXgf9ELvOELBWUV5fkNbULGxr31x0m7+ryIP+aYtLVpFgDegzpd2xbo6F8v/j H4wLqYJazUkVKWMkuuLZ7ogHRK6vWG5stmZXk+pYa1rY6Io+w+Vtt4U+hy/xAVwF abpssyhuXKV46QQwnIJDRtylpHjv5VbsUdHFla3/KBTwal7aWwMetyt7fwLtkFRk Gi5M0x9QwUMjqPp0xtlVps5oP41wQrVmG8J6a0uXdjNgA4ja1AgFN1oZGdUldln4 unepxWK2VXaHXyNWCfu493P4lRwL1Ww1TizYirADlrPxez2qqnVLHKkV5dbYDilG /LLU7x12w8yAQXTR11E40+SCXybrQA== =LQPm -----END PGP SIGNATURE----- --Sig_/.l72Tw0W=3_+LVg.7fVP4y7-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 03 09:33:06 2021 Received: (at 40272) by debbugs.gnu.org; 3 Aug 2021 13:33:06 +0000 Received: from localhost ([127.0.0.1]:40011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAuXa-0003MB-CR for submit@debbugs.gnu.org; Tue, 03 Aug 2021 09:33:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAuXY-0003Lg-Eu for 40272@debbugs.gnu.org; Tue, 03 Aug 2021 09:33:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49908) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAuXR-0006Ti-Oa; Tue, 03 Aug 2021 09:32:57 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43002 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAuXR-0000lY-A8; Tue, 03 Aug 2021 09:32:57 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxime Devos Subject: Re: bug#40272: linux-module-build-system don't support an inferior package as a kernel References: <4ace97d14da81f85ee833cacda791edb@waegenei.re> <87k0l5i3mw.fsf@waegenei.re> <875ywpxgdz.fsf@gnu.org> <87h7g8j2zu.fsf@waegenei.re> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 Thermidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 03 Aug 2021 15:32:55 +0200 In-Reply-To: (Maxime Devos's message of "Mon, 02 Aug 2021 19:12:18 +0200") Message-ID: <87zgtytzzs.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 40272 Cc: 40272@debbugs.gnu.org, Brice Waegeneire X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Maxime Devos skribis: > Brice Waegeneire schreef op zo 01-08-2021 om 22:59 [+0200]: >> ice-9/boot-9.scm:1685:16: In procedure raise-exception: >> In procedure package-name: Wrong type argument: # >> --8<---------------cut here---------------end--------------->8--- >>=20 >> > If we want to go further, we=E2=80=99ll have to end up with GOOPS=E2= =80=A6 >> > [...] >>=20 >> Building a parent class of and looks really >> involved to just fix this issue. Is there another way, or are we forced= to >> use GOOPS in that case? > > Going full GOOPS isn't necessary. Yes, I wasn=E2=80=99t seriously suggesting doing that just yet (I developed= an aversion to GOOPS for reasons that may be debatable ;-)), but it strikes me as a case where our ad-hoc extension mechanism, =E2=80=98define-gexp-compiler=E2=80=99, appears to be insufficient. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 03 09:34:51 2021 Received: (at 40272) by debbugs.gnu.org; 3 Aug 2021 13:34:51 +0000 Received: from localhost ([127.0.0.1]:40015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAuZG-0003OU-R5 for submit@debbugs.gnu.org; Tue, 03 Aug 2021 09:34:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAuZF-0003OI-3B for 40272@debbugs.gnu.org; Tue, 03 Aug 2021 09:34:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49964) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAuZ9-0007hE-6A; Tue, 03 Aug 2021 09:34:43 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43004 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAuZ8-0007uz-Tl; Tue, 03 Aug 2021 09:34:43 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Danny Milosavljevic Subject: Re: bug#40272: linux-module-build-system don't support an inferior package as a kernel References: <4ace97d14da81f85ee833cacda791edb@waegenei.re> <87k0l5i3mw.fsf@waegenei.re> <875ywpxgdz.fsf@gnu.org> <20210802210129.0a281c96@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 Thermidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 03 Aug 2021 15:34:40 +0200 In-Reply-To: <20210802210129.0a281c96@scratchpost.org> (Danny Milosavljevic's message of "Mon, 2 Aug 2021 21:03:21 +0200") Message-ID: <87v94mtzwv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 40272 Cc: 40272@debbugs.gnu.org, Brice Waegeneire X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Danny! Danny Milosavljevic skribis: > On Sun, 01 Aug 2021 18:46:00 +0200 > Ludovic Court=C3=A8s wrote: [...] >> In this case, the problem is that (@ (guix build-system linux-module) >> lower) assumes that =E2=80=98linux=E2=80=99 is a : >>=20 >> (build-inputs `(,@(if source >> `(("source" ,source)) >> '()) >> ,@native-inputs >> ;; TODO: Remove "gmp", "mpfr", "mpc" since they are >> ;; only needed to compile the gcc plugins. Maybe >> ;; remove "flex", "bison", "elfutils", "perl", >> ;; "openssl". That leaves very little ("bc", "gcc", >> ;; "kmod"). >> ,@(package-native-inputs linux) ;<----- HERE >>=20 >> I suppose you could add a special-case for (inferior-package? linux). >> Not pretty, but it=E2=80=99d do the job. > > Or, as the comment says, it might be enough just to not get the > package-native-inputs from the package ever, but do hard-code > bc, gcc and kmod. Maybe add a comment why :) True, that may be the easiest solution, and it certainly makes sense. Thanks, Ludo=E2=80=99.