help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with channel build system and package


From: Jesse
Subject: Re: Help with channel build system and package
Date: Thu, 15 Feb 2024 08:23:37 -0500
User-agent: Mozilla Thunderbird

About the warnings of invalid argument list: comment out the argument lists in
the toolchain packages (I do not remember fully the names, I do not have acces
to the big computer right now for easy reference). See how the change effects
the build.

I learned a lot by intentionally breaking code and reading the errors.

I ended up trying that, removing the arguments from the package, but I did not get any change in the output.

One thing I did try is trying to build with the repl. I made this script, named build-repl.scm:

(use-modules
 (guix store)
 (guix derivations)
 (guix packages)
 ;;(embedded-dev packages)
 )

(define (build-packages packages)
  (with-store store
    (let ((builds (map (lambda (package)
                         (package-derivation store package))
                       packages)))
      (build-derivations store builds))))
(define (build-package package)
  (build-packages (list package)))

Which i got from here: https://lists.gnu.org/archive/html/help-guix/2020-06/msg00173.html

I don't seem to be able to use my channel here for some reason but I think I got around that later.

For context, this is my directory layout:

embedded-dev-chan
├── build-repl.scm
├── .guix-channel
└── embedded-dev
    ├── build
    │   └── crosstool-ng-build-system.scm
    ├── build-system
    │   └── crosstool-ng.scm
    └── packages
        └── crosstool-ng.scm

My understanding is that by adding embedded-dev-chan to the load path I should be able to use the guile files inside with something like (use-modules embedded-dev packages crosstool-ng).

I invoked the repl: guix repl -L /home/jesse/Code/embedded-dev-chan

Then I loaded the "build-repl.scm" script and tried to build my package:

scheme@(guix-user)> ,load /home/jesse/Code/embedded-dev-chan/build-repl.scm
scheme@(guix-user) [2]> (use-modules (embedded-dev packages crosstool-ng))
While compiling expression:
Syntax error:
unknown location: lambda*: invalid argument list in subform ((phases (quote %standard-phases)) (outputs (quote ("out"))) (search-paths (quote ())) (system (%current-system)) (guile #f) (imported-modules %crosstool-ng-build-system-modules) (modules (quote ((embedded-dev build crosstool-ng-build-system) (guix build utils))))) of (name inputs (phases (quote %standard-phases)) (outputs (quote ("out"))) (search-paths (quote ())) (system (%current-system)) (guile #f) (imported-modules %crosstool-ng-build-system-modules) (modules (quote ((embedded-dev build crosstool-ng-build-system) (guix build utils)))))

This seems like it is giving me a little more to go off of. I pretified the output a bit:

((phases
  (quote %standard-phases))
 (outputs (quote ("out")))
 (search-paths (quote ()))
 (system (%current-system))
 (guile #f)
 (imported-modules %crosstool-ng-build-system-modules)
 (modules
  (quote ((embedded-dev build crosstool-ng-build-system)
          (guix build utils)))))

of

(name
 inputs
 (phases (quote %standard-phases))
 (outputs (quote ("out")))
 (search-paths (quote ()))
 (system (%current-system))
 (guile #f)
 (imported-modules %crosstool-ng-build-system-modules)
 (modules (quote ((embedded-dev build crosstool-ng-build-system)
                  (guix build utils)))))


I'm not quite sure what this is trying to tell me. It seems like it is an issue around here in embedded-dev/build-system/crosstool-ng.scm:

(define* (crosstool-ng-build name inputs
                             (phases '%standard-phases)
                             (outputs '("out"))
                             (search-paths '())
                             (system (%current-system))
                             (guile #f)
                             (imported-modules %crosstool-ng-build-system-modules)                              (modules '((embedded-dev build crosstool-ng-build-system)
                                        (guix build utils)))
                             )
  "Build Crosstool-ng toolchain"

  (define build
    #~(begin
        (use-modules #$@(sexp->gexp modules))

        #$(with-build-variables inputs outputs
            #~(crosstool-ng-build #:name #$name
                                  #:source #+source
                                  #:system #$system
                                  #:phases #$(if (pair? phases)
                                                 (sexp->gexp phases)
                                                 phases)
                                  #:outputs %outputs
                                  #:search-paths '#$(sexp->gexp
                                                     (map
search-path-specification->sexp
search-paths))
                                  #:inputs %build-inputs))))

  (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
                                                  system #:graft? #f)))
    (gexp->derivation name build
                      #:system system
                      #:target #f
                      #:modules imported-modules
                      #:guile-for-build guile)))


My first thought was that there was a mismatch between the arguments of crosstool-ng-build -> build -> gexp->derivation. But the arguments all seem to match up. I compared to build-system/ruby.scm and that part seems really close to that as well except for some arguments that seem like they are ruby specific.

There must be some nuance that I'm missing here.

Jesse


reply via email to

[Prev in Thread] Current Thread [Next in Thread]