unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Help with channel build system and package
@ 2024-02-08  3:27 Jesse
  2024-02-08  3:37 ` Carlo Zancanaro
  0 siblings, 1 reply; 7+ messages in thread
From: Jesse @ 2024-02-08  3:27 UTC (permalink / raw)
  To: help-guix

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

Hello,

I have a channel where I am trying to develop a few packages that need a 
new build system. I want to try and use guix to build toolchains from 
crosstool-ng[1] for embedded development. In an effort to guix-fiy some 
of my development environments I'd like to be able to use the same 
toolchains that I do normally but specified in a manifest for embedded 
projects. I have attached my channel here.

It seems to be able to build the crosstool-ng package fine with

guix build -v3 -L embedded-dev crosstool-ng
guix build: warning: invalid argument list
guix build: warning: source expression failed to match any pattern
guix build: warning: ambiguous package specification `crosstool-ng'
guix build: warning: choosing crosstool-ng@1.26.0 from 
embedded-dev/embedded-dev/packages/crosstool-ng.scm:26:2
/gnu/store/5adzqwspya97z59pgxfvchrlyddl7v6a-crosstool-ng-1.26.0

However, when I try to build one of my packages that depend on 
crosstool-ng I get this:

guix build -v3 -L embedded-dev ct-ng-riscv64-unknown-elf
guix build: warning: invalid argument list
guix build: warning: source expression failed to match any pattern
Backtrace:
In ice-9/boot-9.scm:
   1747:15 19 (with-exception-handler #<procedure 7fd0988d3ea0 at ic…> …)
   1752:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In guix/ui.scm:
     485:6 17 (_)
In guix/scripts/build.scm:
     711:5 16 (_)
In srfi/srfi-1.scm:
    673:15 15 (append-map #<procedure 7fd09b28b140 at guix/scripts/b…> …)
    586:17 14 (map1 ("x86_64-linux"))
In guix/scripts/build.scm:
    713:21 13 (_ _)
In guix/store.scm:
   1380:11 12 (map/accumulate-builds #<store-connection 256.99 7fd0a…> …)
    1298:8 11 (call-with-build-handler #<procedure 7fd0988d3e40 at g…> …)
In guix/scripts/build.scm:
    667:16 10 (_ #<package ct-ng-riscv64-unknown-elf@1.26.0 embedded-…>)
    656:24  9 (_ #<package ct-ng-riscv64-unknown-elf@1.26.0 embedded…> …)
In guix/packages.scm:
   1372:17  8 (supported-package? #<package ct-ng-riscv64-unknown-el…> …)
In guix/memoization.scm:
     101:0  7 (_ #<hash-table 7fd09923d640 0/31> #<package ct-ng-ris…> …)
In guix/packages.scm:
   1350:39  6 (_)
   1612:16  5 (package->bag _ _ _ #:graft? _)
   1709:22  4 (thunk)
In guix/build-system.scm:
      94:2  3 (make-bag _ _ #:source _ #:inputs _ #:native-inputs _ # …)
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:
Throw to key `match-error' with args `("match" "no matching pattern" 
#<package crosstool-ng@1.26.0 
embedded-dev/embedded-dev/packages/crosstool-ng.scm:26 7fd09cb334d0>)'.

I'm a little lost on how to proceed debugging this. It seems like it is 
saying it can't find the crosstool-ng package. It seemed to build fine 
and the package definition is in the same file.

For some background, when building a toolchain from crosstool-ng you 
provide it with a defconfig and it has a number of steps it goes through 
to bootstrap it and pull the versioned dependencies down and everything. 
So my plan was to have some of these packages that use crosstool-ng and 
just provide the defconfig as a plain file:

(define-public ct-ng-riscv64-unknown-elf
   (package
     (name "ct-ng-riscv64-unknown-elf")
     (source (plain-file "defconfig"
                         '("CT_CONFIG_VERSION=\"4\"\n"
                           "CT_EXPERIMENTAL=y\n"
                           "CT_ARCH_RISCV=y\n"
                           "# CT_DEMULTILIB is not set\n"
                           "CT_ARCH_USE_MMU=y\n"
                           "CT_ARCH_64=y\n"
                           "CT_DEBUG_GDB=y\n"
                           "# CT_GDB_CROSS_PYTHON is not set\n")))
     (version "1.26.0")
     (build-system crosstool-ng)
     (arguments `(#:sample "riscv64-unknown-elf"))
     (synopsis "A crosstool-ng based riscv64 unknown elf toolchain")
     (description "A crosstool-ng based riscv64 unknown elf toolchain")
     (home-page "https://crosstool-ng.github.io/docs/")
     (license (list gpl2 gpl2+ gpl3+ lgpl2.1 lgpl3+))
     ))

The actual guix build system that I put together mainly follows others 
that I saw in the guix source. It really just deletes a bunch of phases 
from the gnu standard phases and then just runs the crosstool-ng 
commands, one per phase.

There are some tweaks that I want to make here and there to clean things 
up before I see if this is upstreamable but I'd like to get this build 
debugged first.

Thanks for any tips.


1: https://crosstool-ng.github.io/

[-- Attachment #2: embedded-dev.tar.gz --]
[-- Type: application/gzip, Size: 2824 bytes --]

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

* Re: Help with channel build system and package
  2024-02-08  3:27 Help with channel build system and package Jesse
@ 2024-02-08  3:37 ` Carlo Zancanaro
  2024-02-08 14:32   ` Jesse
  0 siblings, 1 reply; 7+ messages in thread
From: Carlo Zancanaro @ 2024-02-08  3:37 UTC (permalink / raw)
  To: Jesse; +Cc: help-guix

Hi Jesse,

I know very little about what you're trying to do, but there's one thing
that looked wrong to me:

On Wed, Feb 07 2024, Jesse wrote:
> ...
>     (build-system crosstool-ng)
> ...

This isn't a build system, right? It's just the package? I think you may
want crosstool-ng-build-system here.

That might be what's causing the error:

> ...
> In guix/build-system.scm:
>      94:2  3 (make-bag _ _ #:source _ #:inputs _ #:native-inputs _ # …)
> 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:
> Throw to key `match-error' with args `("match" "no matching pattern"
> #<package crosstool-ng@1.26.0
> embedded-dev/embedded-dev/packages/crosstool-ng.scm:26
> 7fd09cb334d0>)'.

Looking in make-bag (in guix/build-system.scm), the first think it does
it pattern match on the build system expecting a record of the
<build-system> type. Your package doesn't match that pattern, so this
error is raised.

Carlo


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

* Re: Help with channel build system and package
  2024-02-08  3:37 ` Carlo Zancanaro
@ 2024-02-08 14:32   ` Jesse
  2024-02-08 17:00     ` Marek Paśnikowski
  0 siblings, 1 reply; 7+ messages in thread
From: Jesse @ 2024-02-08 14:32 UTC (permalink / raw)
  To: Carlo Zancanaro; +Cc: help-guix

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

Thanks for taking a look Carlo!

On 2/7/24 22:37, Carlo Zancanaro wrote:
> Hi Jesse,
>
> I know very little about what you're trying to do, but there's one thing
> that looked wrong to me:
>
> On Wed, Feb 07 2024, Jesse wrote:
>> ...
>>      (build-system crosstool-ng)
>> ...
> This isn't a build system, right? It's just the package? I think you may
> want crosstool-ng-build-system here.

You are totally correct here. I changed this to "(build-system 
crosstool-ng-build-system)" and I don't get the same error now. I also 
then realized I was missing "  #:use-module (embedded-dev build-system 
crosstool-ng)" from the list of modules in the package define-module 
expression in the packages/crosstool-ng.scm file. I also tracked down 
some other missing modules.

However, now I get this:

guix build -v3 -L embedded-dev ct-ng-riscv64-unknown-elf
guix build: warning: invalid argument list
guix build: warning: source expression failed to match any pattern
error: crosstool-ng-build-system: unbound variable
hint: Did you forget `(use-modules (embedded-dev build-system 
crosstool-ng))'?

guix build: error: ct-ng-riscv64-unknown-elf: unknown package

This confuses me a bit because it says that it is an unbound variable 
but it is defined in embedded-dev/build-system/crosstool-ng.scm. I 
believe I should be importing this module with the "#:use-module 
(embedded-dev build-system crosstool-ng)" line in the package file. The 
symbol should be exported with:

(define-module (embedded-dev build-system crosstool-ng)
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
   #:export (%crosstool-ng-build-system-modules
             crosstool-ng-build
             crosstool-ng-build-system))

which is in the embedded-dev/build-system/crosstool-ng.scm file of my 
channel. I was mainly trying to follow some build-system setups like 
ruby where there are build/ruby-build-system.scm, which is used by 
build-system/ruby.scm, which defines and exports the ruby-build-system 
symbol, and that is used by the packages in packages/ruby.scm.

If I was to manually trace how the build system guile files are used 
from a package definition, it would look like this:

1. In packages/crosstool-ng.scm I have a package definition that uses
        (build-system crosstool-ng-build-system)

2. In that same file I have a line that should include the entry point 
to the crosstool-ng build system:
         #:use-module (embedded-dev build-system crosstool-ng)

3. That line should use the guile module located at 
embedded-dev/build-system/crosstool-ng.scm, since my build invocation 
looks like: "guix build -v3 -L embedded-dev ct-ng-riscv64-unknown-elf" 
and my channel is in a directory called "embedded-dev". So the fulll 
path would be embedded-dev/embedded-dev/build-system/crosstool-ng.scm

4. In build-system/crosstool-ng.scm the beginning is defined as:

(define-module (embedded-dev build-system crosstool-ng)
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
   #:export (%crosstool-ng-build-system-modules
             crosstool-ng-build
             crosstool-ng-build-system))

(define %crosstool-ng-build-system-modules
   ;; Build-side modules imported by default.
   `((embedded-dev build crosstool-ng-build-system)
     ,@%gnu-build-system-modules))

(define (default-crosstool-ng )
   "Return the default crosstool-ng package"
   (let ((crosstool-ng (resolve-interface '(embedded-dev packages 
crosstool-ng))))
     (module-ref crosstool-ng 'crosstool-ng)))


Here I should be exporting the "crosstool-ng-build-system" symbol to be 
used by a guile script that uses it. The 
crosstool-ng-build-system-modules should be looking at 
embedded-dev/build/crosstool-ng-build-system.scm, again taking 
inspiration from other build system files like the ones associated with 
ruby. The default-crosstool-ng symbol should be grabbing from the 
embedded-dev/packages/crosstool-ng.scm file.

5. Later in that file I pass the crosstool-ng-build-system-modules 
symbol to the crosstool-ng-build function as well as the module located 
at embedded-dev/build/crosstool-ng-build-system.scm

(define* (crosstool-ng-build name inputs
                              #:key (sample "unknown")
                              (test-target "test")
                              (tests? #t)
                              (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)))
                              )

6. Then the actual build system symbol that is exported from the top is 
defined at the bottom of this file:

(define crosstool-ng-build-system
   (build-system
     (name 'crosstool-ng)
     (description "Crosstool-ng build system")
     (lower lower)))

It all seems just as threaded together as the ones in the guix source. I 
must be missing something small here.

I'm also confused about the "guix build: warning: invalid argument 
list". It looks like I'm invoking the build command properly.

Is there something else you have to do when setting up a channel to pull 
in the build and build-system directories? I thought that by adding my 
channel to the load path with "-L", the elements passed to use-module 
were essentially directory paths.

>
> That might be what's causing the error:
>
>> ...
>> In guix/build-system.scm:
>>       94:2  3 (make-bag _ _ #:source _ #:inputs _ #:native-inputs _ # …)
>> 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:
>> Throw to key `match-error' with args `("match" "no matching pattern"
>> #<package crosstool-ng@1.26.0
>> embedded-dev/embedded-dev/packages/crosstool-ng.scm:26
>> 7fd09cb334d0>)'.
> Looking in make-bag (in guix/build-system.scm), the first think it does
> it pattern match on the build system expecting a record of the
> <build-system> type. Your package doesn't match that pattern, so this
> error is raised.
Thanks for pointing this out, I didn't dig in enough.
>
> Carlo

I've attached the version with the changes mentioned.

Thanks,

Jesse

[-- Attachment #2: embedded-dev.tar.gz --]
[-- Type: application/gzip, Size: 2874 bytes --]

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

* Re: Help with channel build system and package
  2024-02-08 14:32   ` Jesse
@ 2024-02-08 17:00     ` Marek Paśnikowski
  2024-02-08 18:33       ` Jesse Millwood
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Paśnikowski @ 2024-02-08 17:00 UTC (permalink / raw)
  To: help-guix

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

08.02.2024 15:32:44 CET Jesse:
> Thanks for taking a look Carlo!
> 
> On 2/7/24 22:37, Carlo Zancanaro wrote:
> > Hi Jesse,
> > 
> > I know very little about what you're trying to do, but there's one thing
> > that looked wrong to me:
> > 
> > On Wed, Feb 07 2024, Jesse wrote:
> >> ...
> >> 
> >>      (build-system crosstool-ng)
> >> 
> >> ...
> > 
> > This isn't a build system, right? It's just the package? I think you may
> > want crosstool-ng-build-system here.

> 
> However, now I get this:
> 
> guix build -v3 -L embedded-dev ct-ng-riscv64-unknown-elf
> guix build: warning: invalid argument list
> guix build: warning: source expression failed to match any pattern
> error: crosstool-ng-build-system: unbound variable
> hint: Did you forget `(use-modules (embedded-dev build-system
> crosstool-ng))'?
> 
> guix build: error: ct-ng-riscv64-unknown-elf: unknown package
> 
> This confuses me a bit because it says that it is an unbound variable
> but it is defined in embedded-dev/build-system/crosstool-ng.scm. I
> believe I should be importing this module with the "#:use-module
> (embedded-dev build-system crosstool-ng)" line in the package file. The
> symbol should be exported with:

I am just starting to understand how packaging works, but one thing that 
stands out to me is the #:sample keyword in arguments of the *riscv64* package 
definition. Where is it defined? Is the source correctly imported?

My hypothesis is that guix, upon loading the module in question:
1. fails to parse the #:sample keyword (invalid argument list warning)
2. fails to parse the package definition due to the above (pattern failure)
3. fails to find the package definition due to the above (unbound variable)

This problem is educational to me, so give me the benefit of the doubt.

Sincerely,

Marek Paśnikowski

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

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

* Re: Help with channel build system and package
  2024-02-08 17:00     ` Marek Paśnikowski
@ 2024-02-08 18:33       ` Jesse Millwood
  2024-02-08 18:52         ` Marek Paśnikowski
  0 siblings, 1 reply; 7+ messages in thread
From: Jesse Millwood @ 2024-02-08 18:33 UTC (permalink / raw)
  To: help-guix

Thanks for the response Marek

On 2/8/24 12:00, Marek Paśnikowski wrote:
> 08.02.2024 15:32:44 CET Jesse:
>> Thanks for taking a look Carlo!
>>
>> On 2/7/24 22:37, Carlo Zancanaro wrote:
>>> Hi Jesse,
>>>
>>> I know very little about what you're trying to do, but there's one thing
>>> that looked wrong to me:
>>>
>>> On Wed, Feb 07 2024, Jesse wrote:
>>>> ...
>>>>
>>>>       (build-system crosstool-ng)
>>>>
>>>> ...
>>> This isn't a build system, right? It's just the package? I think you may
>>> want crosstool-ng-build-system here.
>> However, now I get this:
>>
>> guix build -v3 -L embedded-dev ct-ng-riscv64-unknown-elf
>> guix build: warning: invalid argument list
>> guix build: warning: source expression failed to match any pattern
>> error: crosstool-ng-build-system: unbound variable
>> hint: Did you forget `(use-modules (embedded-dev build-system
>> crosstool-ng))'?
>>
>> guix build: error: ct-ng-riscv64-unknown-elf: unknown package
>>
>> This confuses me a bit because it says that it is an unbound variable
>> but it is defined in embedded-dev/build-system/crosstool-ng.scm. I
>> believe I should be importing this module with the "#:use-module
>> (embedded-dev build-system crosstool-ng)" line in the package file. The
>> symbol should be exported with:
> I am just starting to understand how packaging works, but one thing that
> stands out to me is the #:sample keyword in arguments of the *riscv64* package
> definition. Where is it defined? Is the source correctly imported?

Ha, I am just trying to understand how packaging works too (or at least 
I think I am, lol).

That's a good catch and suggestion. I thought that by doing this in 
build-system/crosstool-ng.scm:

(define* (crosstool-ng-build name inputs
                              #:key (sample "unknown")
                              (test-target "test")
                              (tests? #t)
                              (phases '%standard-phases)
                              (outputs '("out"))
                              (search-paths '())
                              (system (%current-system))
                              (guile #f)
                              (imported-modules 
%crosstool-ng-build-system-modules)
                              (modules '((guix build 
crosstool-ng-build-system)
                                         (guix build utils)))
                              )

That the #:key (sample "unknown") was defining that as a keyword 
argument. It was a hold over from an idea I had that I kind of abandoned 
but didn't think it was causing any issues. I just removed that and the 
arguments line from the packages.

Now I get two invalid argument list errors:

guix build -v3 -L embedded-dev ct-ng-riscv64-unknown-elf
guix build: warning: invalid argument list
guix build: warning: invalid argument list
error: crosstool-ng-build-system: unbound variable
hint: Did you forget `(use-modules (embedded-dev build-system 
crosstool-ng))'?

guix build: error: ct-ng-riscv64-unknown-elf: unknown package

I guess I was thinking that it was saying that my invocation of the guix 
build command had an invalid argument given. I hadn't thought that it 
was talking about an argument given to one of the functions. That gives 
me some where to start looking at least.

>
> My hypothesis is that guix, upon loading the module in question:
> 1. fails to parse the #:sample keyword (invalid argument list warning)
> 2. fails to parse the package definition due to the above (pattern failure)
> 3. fails to find the package definition due to the above (unbound variable)
>
> This problem is educational to me, so give me the benefit of the doubt.

That's a sound hypothesis. It gives me a good idea of where to look, thanks!

Do you know of any way to increase the verbosity of error messages or 
logs to help debug where things are going awry?

>
> Sincerely,
>
> Marek Paśnikowski

Thanks,

Jesse



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

* Re: Help with channel build system and package
  2024-02-08 18:33       ` Jesse Millwood
@ 2024-02-08 18:52         ` Marek Paśnikowski
  2024-02-15 13:23           ` Jesse
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Paśnikowski @ 2024-02-08 18:52 UTC (permalink / raw)
  To: help-guix

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

08.02.2024 19:33:09 CET Jesse Millwood:
> Thanks for the response Marek
> 
> On 2/8/24 12:00, Marek Paśnikowski wrote:
> > 08.02.2024 15:32:44 CET Jesse:
> >> Thanks for taking a look Carlo!
> >> 
> >> On 2/7/24 22:37, Carlo Zancanaro wrote:
> >>> Hi Jesse,
> >>> 
> >>> I know very little about what you're trying to do, but there's one thing
> >>> that looked wrong to me:
> >>> 
> >>> On Wed, Feb 07 2024, Jesse wrote:
> >>>> ...
> >>>> 
> >>>>       (build-system crosstool-ng)
> >>>> 
> >>>> ...
> >>> 
> >>> This isn't a build system, right? It's just the package? I think you may
> >>> want crosstool-ng-build-system here.
> >> 
> >> However, now I get this:
> >> 
> >> guix build -v3 -L embedded-dev ct-ng-riscv64-unknown-elf
> >> guix build: warning: invalid argument list
> >> guix build: warning: source expression failed to match any pattern
> >> error: crosstool-ng-build-system: unbound variable
> >> hint: Did you forget `(use-modules (embedded-dev build-system
> >> crosstool-ng))'?
> >> 
> >> guix build: error: ct-ng-riscv64-unknown-elf: unknown package

> > I am just starting to understand how packaging works, but one thing that
> > stands out to me is the #:sample keyword in arguments of the *riscv64*
> > package definition. Where is it defined? Is the source correctly
> > imported?

> 
> > My hypothesis is that guix, upon loading the module in question:
> > 1. fails to parse the #:sample keyword (invalid argument list warning)
> > 2. fails to parse the package definition due to the above (pattern
> > failure)
> > 3. fails to find the package definition due to the above (unbound
> > variable)
> > 
> > This problem is educational to me, so give me the benefit of the doubt.
> 
> That's a sound hypothesis. It gives me a good idea of where to look, thanks!
> 
> Do you know of any way to increase the verbosity of error messages or
> logs to help debug where things are going awry?

I always use -v 4 as argument to guix. I do not remember whether 3 or 4 is the 
biggest effective value. You could try with that.

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.

Sincerely,

Marek

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

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

* Re: Help with channel build system and package
  2024-02-08 18:52         ` Marek Paśnikowski
@ 2024-02-15 13:23           ` Jesse
  0 siblings, 0 replies; 7+ messages in thread
From: Jesse @ 2024-02-15 13:23 UTC (permalink / raw)
  To: help-guix

> 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

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

end of thread, other threads:[~2024-02-15 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08  3:27 Help with channel build system and package Jesse
2024-02-08  3:37 ` Carlo Zancanaro
2024-02-08 14:32   ` Jesse
2024-02-08 17:00     ` Marek Paśnikowski
2024-02-08 18:33       ` Jesse Millwood
2024-02-08 18:52         ` Marek Paśnikowski
2024-02-15 13:23           ` Jesse

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