all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / 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; 14+ 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] 14+ messages in thread

end of thread, other threads:[~2024-03-16 22:51 UTC | newest]

Thread overview: 14+ 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
2024-03-08  2:35             ` Jesse Millwood
2024-03-08 10:43               ` Marek Paśnikowski
2024-03-09 14:44                 ` Jesse Millwood
2024-03-09  3:39               ` Richard Sent
2024-03-09 15:02                 ` Jesse Millwood
2024-03-16 21:47                   ` Jesse Millwood
2024-03-16 22:50                     ` Jesse Millwood

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.