all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jesse <dev@millwood.earth>
To: help-guix@gnu.org
Subject: Help with channel build system and package
Date: Wed, 7 Feb 2024 22:27:54 -0500	[thread overview]
Message-ID: <68237c05-3c30-4d36-b733-6251f168ad9e@millwood.earth> (raw)

[-- 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 --]

             reply	other threads:[~2024-02-08  3:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08  3:27 Jesse [this message]
2024-02-08  3:37 ` Help with channel build system and package 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68237c05-3c30-4d36-b733-6251f168ad9e@millwood.earth \
    --to=dev@millwood.earth \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.