GNU bug report logs - #40272
linux-module-build-system don't support an inferior package as a kernel

Previous Next

Package: guix;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Sat, 28 Mar 2020 12:59:02 UTC

Severity: normal

To reply to this bug, email your comments to 40272 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#40272; Package guix. (Sat, 28 Mar 2020 12:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brice Waegeneire <brice <at> waegenei.re>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sat, 28 Mar 2020 12:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: bug-guix <at> gnu.org
Subject: linux-module-build-system don't support an inferior package as a
 kernel
Date: Sat, 28 Mar 2020 12:58:40 +0000
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 <at> 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.




Information forwarded to bug-guix <at> gnu.org:
bug#40272; Package guix. (Sun, 01 Aug 2021 15:31:01 GMT) Full text and rfc822 format available.

Message #8 received at 40272 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40272 <at> debbugs.gnu.org
Subject: Re: bug#40272: linux-module-build-system don't support an inferior
 package as a kernel
Date: Sun, 01 Aug 2021 17:30:31 +0200
Brice Waegeneire <brice <at> waegenei.re> writes:

> 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.

Hello Guix,

Gentle bump.

The core of this issue is that a package can't depend on a
<inferior-package> because build systems assume the inputs are
<package>.  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 <at> 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=999 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 #<procedure 7f4ddef9c720 at ice-9/boot-9.scm:1831:7 (exn)> _ #: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 #<procedure 7f4df6f491c0 at guix/scripts/build.scm:608:17 (system)> ("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 #<store-connection 256.99 7f4deefe2460> _ _)
In srfi/srfi-1.scm:
   586:17 10 (map1 (#<package ddcci-driver-linux <at> 0.3.3 /home/bricewge/project/guix-config/40272.scm:21 7f4de10d3d20>))
In guix/store.scm:
   1320:8  9 (call-with-build-handler #<procedure build-accumulator (continue store things mode)> _)
In guix/scripts/build.scm:
   569:18  8 (_ _)
In guix/packages.scm:
  1177:16  7 (package-derivation _ #<package ddcci-driver-linux <at> 0.3.3 /home/bricewge/project/guix-config/40272.scm:21 7f4de10d3d20> _ #: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 _ #: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: #<inferior-package linux-libre <at> 5.12.19 7f4ddef23bd0>
--8<---------------cut here---------------end--------------->8---

Issue #48082¹ is probably linked with that one but I couldn't reproduce
it.

¹ https://issues.guix.gnu.org/48082

Cheers,
- Brice




Information forwarded to bug-guix <at> gnu.org:
bug#40272; Package guix. (Sun, 01 Aug 2021 16:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 40272 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 40272 <at> debbugs.gnu.org
Subject: Re: bug#40272: linux-module-build-system don't support an inferior
 package as a kernel
Date: Sun, 01 Aug 2021 18:46:00 +0200
Hi,

Brice Waegeneire <brice <at> waegenei.re> skribis:

> 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: #<inferior-package linux-libre <at> 5.12.19 7f4ddef23bd0>

In this case, the problem is that (@ (guix build-system linux-module)
lower) assumes that ‘linux’ is a <package>:

    (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’d do the job.

If we want to go further, we’ll have to end up with GOOPS…

HTH!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#40272; Package guix. (Sun, 01 Aug 2021 21:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 40272 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40272 <at> debbugs.gnu.org
Subject: Re: bug#40272: linux-module-build-system don't support an inferior
 package as a kernel
Date: Sun, 01 Aug 2021 22:59:01 +0200
Hello Ludo’,

Ludovic Courtès <ludo <at> gnu.org> writes:

> [...]
> In this case, the problem is that (@ (guix build-system linux-module)
> lower) assumes that ‘linux’ is a <package>:
>
>     (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’d 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-module.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=999 ./pre-inst-env  guix build -f ./40272.scm
Backtrace:
In srfi/srfi-1.scm:
   673:15 19 (append-map #<procedure 7f8aebf46440 at guix/scripts/build.scm:608:17 (system)> ("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 #<store-connection 256.99 7f8afec1beb0> _ _)
In srfi/srfi-1.scm:
   586:17 15 (map1 (#<package ddcci-driver-linux <at> 0.3.3 /home/bricewge/project/guix-config/40272.scm:21 7f8aef33aa00>))
In guix/store.scm:
   1320:8 14 (call-with-build-handler #<procedure build-accumulator (continue store things mode)> _)
In guix/scripts/build.scm:
   569:18 13 (_ _)
In guix/packages.scm:
  1177:16 12 (package-derivation _ #<package ddcci-driver-linux <at> 0.3.3 /home/bricewge/project/guix-config/40272.scm:21 7f8aef33aa00> _ #:graft? _)
  1494:22 11 (thunk)
  1177:16 10 (package->bag _ _ _ #:graft? _)
  1279:21  9 (thunk)
In ice-9/eval.scm:
   293:34  8 (_ #(#(#(#(#(#(#(#<directory (guix build-system linux-module) 7f8af0d1ef00>) "ddcci-driver-linux-0.3.3" (#:system "x86_64-linux" #:source #<origin #<<git-reference> url: "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git" commit: "v0.3.3" recursive?: #f> #<content-hash sha256:0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f> () 7f8aef024060> #:inputs () #:native-inputs () #:outputs ("out") #:target #f #:tests? #f #:phases (modify-phases %standard-phases (replace (quote build) (lambda args (for-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) (with-directory-excursion module (apply (assoc-ref %standard-phases (quote install)) args))) (quote ("ddcci" "ddcci-backlight"))) #t))) #:linux #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>) #<origin #<<git-reference> url: …> …) …) …) …) …) …))
    159:9  7 (_ #(#(#(#(#(#(#(#<directory (guix build-system linux-module) 7f8af0d1ef00>) "ddcci-driver-linux-0.3.3" (#:system "x86_64-linux" #:source #<origin #<<git-reference> url: "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git" commit: "v0.3.3" recursive?: #f> #<content-hash sha256:0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f> () 7f8aef024060> #:inputs () #:native-inputs () #:outputs ("out") #:target #f #:tests? #f #:phases (modify-phases %standard-phases (replace (quote build) (lambda args (for-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) (with-directory-excursion module (apply (assoc-ref %standard-phases (quote install)) args))) (quote ("ddcci" "ddcci-backlight"))) #t))) #:linux #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>) #<origin #<<git-reference> url: …> …) …) …) …) …) …))
    159:9  6 (_ #(#(#(#(#(#(#(#<directory (guix build-system linux-module) 7f8af0d1ef00>) "ddcci-driver-linux-0.3.3" (#:system "x86_64-linux" #:source #<origin #<<git-reference> url: "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git" commit: "v0.3.3" recursive?: #f> #<content-hash sha256:0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f> () 7f8aef024060> #:inputs () #:native-inputs () #:outputs ("out") #:target #f #:tests? #f #:phases (modify-phases %standard-phases (replace (quote build) (lambda args (for-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) (with-directory-excursion module (apply (assoc-ref %standard-phases (quote install)) args))) (quote ("ddcci" "ddcci-backlight"))) #t))) #:linux #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>) #<origin #<<git-reference> url: …> …) …) …) …) …) …))
    159:9  5 (_ #(#(#(#(#(#(#(#<directory (guix build-system linux-module) 7f8af0d1ef00>) "ddcci-driver-linux-0.3.3" (#:system "x86_64-linux" #:source #<origin #<<git-reference> url: "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git" commit: "v0.3.3" recursive?: #f> #<content-hash sha256:0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f> () 7f8aef024060> #:inputs () #:native-inputs () #:outputs ("out") #:target #f #:tests? #f #:phases (modify-phases %standard-phases (replace (quote build) (lambda args (for-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) (with-directory-excursion module (apply (assoc-ref %standard-phases (quote install)) args))) (quote ("ddcci" "ddcci-backlight"))) #t))) #:linux #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>) #<origin #<<git-reference> url: …> …) …) …) …) …) …))
   293:34  4 (_ #(#(#<directory (guix build-system linux-module) 7f8af0d1ef00>) #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>))
    159:9  3 (_ #(#(#<directory (guix build-system linux-module) 7f8af0d1ef00>) #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>))
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: #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>
--8<---------------cut here---------------end--------------->8---

> If we want to go further, we’ll have to end up with GOOPS…
> [...]

Building a parent class of <package> and <inferior-package> looks really
involved to just fix this issue.  Is there another way, or are we forced to
use GOOPS in that case?

Cheers,
- Brice




Information forwarded to bug-guix <at> gnu.org:
bug#40272; Package guix. (Mon, 02 Aug 2021 17:13:01 GMT) Full text and rfc822 format available.

Message #17 received at 40272 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Brice Waegeneire <brice <at> waegenei.re>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 40272 <at> debbugs.gnu.org
Subject: Re: bug#40272: linux-module-build-system don't support an inferior
 package as a kernel
Date: Mon, 02 Aug 2021 19:12:18 +0200
[Message part 1 (text/plain, inline)]
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: #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>
> --8<---------------cut here---------------end--------------->8---
> 
> > If we want to go further, we’ll have to end up with GOOPS…
> > [...]
> 
> Building a parent class of <package> and <inferior-package> 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 <package>
  (if (eq? (struct-vtable package) <package>)
      (%package-inputs package) ; expects a <package>
      ((hashq-ref %inputs-hashtable (struct-vtable package)) package)))

;; In (guix inferior):
(hashq-set! %inputs-hashtable <inferior-package> %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)) 
        ((inferior-package? package) (inferior-package-inputs package))
        (#t (error (G_ "tried to use 'package-inputs' on a non-package object ~a") package))))

The idea of both suggestions is to let 'package-name', 'package-native-inputs',
... work on both regular <package> and <inferior-package> objects.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40272; Package guix. (Mon, 02 Aug 2021 19:04:01 GMT) Full text and rfc822 format available.

Message #20 received at 40272 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40272 <at> debbugs.gnu.org, Brice Waegeneire <brice <at> waegenei.re>
Subject: Re: bug#40272: linux-module-build-system don't support an inferior
 package as a kernel
Date: Mon, 2 Aug 2021 21:03:21 +0200
[Message part 1 (text/plain, inline)]
Hi,

On Sun, 01 Aug 2021 18:46:00 +0200
Ludovic Courtès <ludo <at> gnu.org> wrote:

> Brice Waegeneire <brice <at> waegenei.re> skribis:
> 
> > 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: #<inferior-package linux-libre <at> 5.12.19 7f4ddef23bd0>  
> 
> In this case, the problem is that (@ (guix build-system linux-module)
> lower) assumes that ‘linux’ is a <package>:
> 
>     (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’d 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.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40272; Package guix. (Tue, 03 Aug 2021 13:34:02 GMT) Full text and rfc822 format available.

Message #23 received at 40272 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 40272 <at> debbugs.gnu.org, Brice Waegeneire <brice <at> waegenei.re>
Subject: Re: bug#40272: linux-module-build-system don't support an inferior
 package as a kernel
Date: Tue, 03 Aug 2021 15:32:55 +0200
Maxime Devos <maximedevos <at> telenet.be> 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: #<inferior-package linux-libre <at> 5.12.19 7f8aed887420>
>> --8<---------------cut here---------------end--------------->8---
>> 
>> > If we want to go further, we’ll have to end up with GOOPS…
>> > [...]
>> 
>> Building a parent class of <package> and <inferior-package> 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’t 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,
‘define-gexp-compiler’, appears to be insufficient.

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#40272; Package guix. (Tue, 03 Aug 2021 13:35:02 GMT) Full text and rfc822 format available.

Message #26 received at 40272 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 40272 <at> debbugs.gnu.org, Brice Waegeneire <brice <at> waegenei.re>
Subject: Re: bug#40272: linux-module-build-system don't support an inferior
 package as a kernel
Date: Tue, 03 Aug 2021 15:34:40 +0200
Hi Danny!

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> On Sun, 01 Aug 2021 18:46:00 +0200
> Ludovic Courtès <ludo <at> gnu.org> wrote:

[...]

>> In this case, the problem is that (@ (guix build-system linux-module)
>> lower) assumes that ‘linux’ is a <package>:
>> 
>>     (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’d 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’.




This bug report was last modified 2 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.