unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40272: linux-module-build-system don't support an inferior package as a kernel
@ 2020-03-28 12:58 Brice Waegeneire
  2021-08-01 15:30 ` Brice Waegeneire
  0 siblings, 1 reply; 8+ messages in thread
From: Brice Waegeneire @ 2020-03-28 12:58 UTC (permalink / raw)
  To: 40272


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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40272: linux-module-build-system don't support an inferior package as a kernel
  2020-03-28 12:58 bug#40272: linux-module-build-system don't support an inferior package as a kernel Brice Waegeneire
@ 2021-08-01 15:30 ` Brice Waegeneire
  2021-08-01 16:46   ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Brice Waegeneire @ 2021-08-01 15:30 UTC (permalink / raw)
  To: 40272

Brice Waegeneire <brice@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@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@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@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@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




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40272: linux-module-build-system don't support an inferior package as a kernel
  2021-08-01 15:30 ` Brice Waegeneire
@ 2021-08-01 16:46   ` Ludovic Courtès
  2021-08-01 20:59     ` Brice Waegeneire
  2021-08-02 19:03     ` Danny Milosavljevic
  0 siblings, 2 replies; 8+ messages in thread
From: Ludovic Courtès @ 2021-08-01 16:46 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 40272

Hi,

Brice Waegeneire <brice@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@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’.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40272: linux-module-build-system don't support an inferior package as a kernel
  2021-08-01 16:46   ` Ludovic Courtès
@ 2021-08-01 20:59     ` Brice Waegeneire
  2021-08-02 17:12       ` Maxime Devos
  2021-08-02 19:03     ` Danny Milosavljevic
  1 sibling, 1 reply; 8+ messages in thread
From: Brice Waegeneire @ 2021-08-01 20:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 40272

Hello Ludo’,

Ludovic Courtès <ludo@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@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@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@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@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@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@5.12.19 7f8aed887420>) #<origin #<<git-reference> url: …> …) …) …) …) …) …))
   293:34  4 (_ #(#(#<directory (guix build-system linux-module) 7f8af0d1ef00>) #<inferior-package linux-libre@5.12.19 7f8aed887420>))
    159:9  3 (_ #(#(#<directory (guix build-system linux-module) 7f8af0d1ef00>) #<inferior-package linux-libre@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@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




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#40272: linux-module-build-system don't support an inferior package as a kernel
  2021-08-01 20:59     ` Brice Waegeneire
@ 2021-08-02 17:12       ` Maxime Devos
  2021-08-03 13:32         ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Devos @ 2021-08-02 17:12 UTC (permalink / raw)
  To: Brice Waegeneire, Ludovic Courtès; +Cc: 40272

[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40272: linux-module-build-system don't support an inferior package as a kernel
  2021-08-01 16:46   ` Ludovic Courtès
  2021-08-01 20:59     ` Brice Waegeneire
@ 2021-08-02 19:03     ` Danny Milosavljevic
  2021-08-03 13:34       ` Ludovic Courtès
  1 sibling, 1 reply; 8+ messages in thread
From: Danny Milosavljevic @ 2021-08-02 19:03 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 40272, Brice Waegeneire

[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]

Hi,

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

> Brice Waegeneire <brice@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@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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40272: linux-module-build-system don't support an inferior package as a kernel
  2021-08-02 17:12       ` Maxime Devos
@ 2021-08-03 13:32         ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2021-08-03 13:32 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 40272, Brice Waegeneire

Maxime Devos <maximedevos@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@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’.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40272: linux-module-build-system don't support an inferior package as a kernel
  2021-08-02 19:03     ` Danny Milosavljevic
@ 2021-08-03 13:34       ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2021-08-03 13:34 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 40272, Brice Waegeneire

Hi Danny!

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> On Sun, 01 Aug 2021 18:46:00 +0200
> Ludovic Courtès <ludo@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’.




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-08-03 13:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28 12:58 bug#40272: linux-module-build-system don't support an inferior package as a kernel Brice Waegeneire
2021-08-01 15:30 ` Brice Waegeneire
2021-08-01 16:46   ` Ludovic Courtès
2021-08-01 20:59     ` Brice Waegeneire
2021-08-02 17:12       ` Maxime Devos
2021-08-03 13:32         ` Ludovic Courtès
2021-08-02 19:03     ` Danny Milosavljevic
2021-08-03 13:34       ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).