all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jesse Millwood <jesse_m@fastmail.com>
To: help-guix@gnu.org
Subject: Re: Help with channel build system and package
Date: Sat, 16 Mar 2024 17:47:07 -0400	[thread overview]
Message-ID: <618d1615-1328-4027-9b29-843bde81f05b@fastmail.com> (raw)
In-Reply-To: <a37c98fe-13de-4f32-8ae8-078815b802e0@fastmail.com>

Richard and Marek,

The input from both of you helped me get a little farther. I've pushed 
my changes to https://codeberg.org/moonling/guix-embedded-dev.

I feel like I'm really close now. I seem to be able to get into the 
phases of my build system. I can not invoke the crosstool-ng tool. My 
issue is that it seems to not be able to see the defconfig that I define 
in the package declaration as a "plain-file".

I've determined this through the repl. In my repo there is a scheme file 
called "build-repl.scm" and I invoke it like this:

➜ guix repl -L guix-embedded-dev
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> ,l 
/home/jesse/Code/guix-repos/guix-embedded-dev/build-repl.scm
WARNING: (embedded-dev packages crosstool-ng): `which' imported from 
both (guix build utils) and (gnu packages base)
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 
100.0%
building path(s) 
`/gnu/store/nc892p9kgx0my3gg9glyszg848hpf166-ct-ng-riscv64-unknown-elf-1.26.0'
starting phase `set-SOURCE-DATE-EPOCH'
phase `set-SOURCE-DATE-EPOCH' succeeded after 0.0 seconds
starting phase `set-paths'
environment variable `PATH' set to 
`/gnu/store/dv009i1wj865n34dyln2fmxryxqg3z7c-crosstool-ng-1.26.0/bin:/gnu/store/sxx22f98vfbavcqmdksm6as8fvskpxiw-tar-1.34/bin:/gnu/store/x24bm49ag5dvki72mjdz195bfb89nrnb-gzip-1.12/bin:/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/bin:/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/bin:/gnu/store/zmcf5kpqiighkbh7wslf91qdjwj06yr1-diffutils-3.8/bin:/gnu/store/210yfax18r2g2inxrml9435ikhfcca6m-patch-2.7.6/bin:/gnu/store/c8jyph2lxw0m9na34fg8h70n4nnnz7is-findutils-4.9.0/bin:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/bin:/gnu/store/xxcfsimvxz7z4dj593gnqbkzc6picwzq-sed-4.8/bin:/gnu/store/yrv5f70mn83a876b78i5s79dd2hsh0zf-grep-3.8/bin:/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/bin:/gnu/store/a5i8avx826brw5grn3n4qv40g514505c-coreutils-9.1/bin:/gnu/store/wj7casda7rb55rvqjnpm0bm7a2zm6618-make-4.3/bin:/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin:/gnu/store/na1dpbbcxjaa3n8wkwrfpch476f90hlf-ld-wrapper-0/bin:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/bin:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/bin:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/bin:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/sbin'
environment variable `BASH_LOADABLES_PATH' unset
environment variable `C_INCLUDE_PATH' set to 
`/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/include:/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/include:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/include:/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/include:/gnu/store/wj7casda7rb55rvqjnpm0bm7a2zm6618-make-4.3/include:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/include:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/include:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/include:/gnu/store/5iklcps70c0sfkxvlrhg8jhf3q4h18bj-linux-libre-headers-5.15.49/include'
environment variable `CPLUS_INCLUDE_PATH' set to 
`/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/include:/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/include:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/include:/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/include:/gnu/store/wj7casda7rb55rvqjnpm0bm7a2zm6618-make-4.3/include:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/include:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/include/c++:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/include:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/include:/gnu/store/5iklcps70c0sfkxvlrhg8jhf3q4h18bj-linux-libre-headers-5.15.49/include'
environment variable `LIBRARY_PATH' set to 
`/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/lib:/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/lib:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/lib:/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/lib:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/lib:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib:/gnu/store/l0yryi5jsa1grnvw01c9nkz9c81cv224-glibc-2.35-static/lib:/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales-2.35/lib'
environment variable `GUIX_LOCPATH' set to 
`/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales-2.35/lib/locale'
phase `set-paths' succeeded after 0.0 seconds
starting phase `install-locale'
using 'en_US.utf8' locale for category "LC_ALL"
phase `install-locale' succeeded after 0.0 seconds
starting phase `patch-usr-bin-file'
phase `patch-usr-bin-file' succeeded after 0.0 seconds
starting phase `patch-source-shebangs'
phase `patch-source-shebangs' succeeded after 0.0 seconds
starting phase `patch-generated-file-shebangs'
phase `patch-generated-file-shebangs' succeeded after 0.0 seconds
starting phase `defconfig'
   CONF  defconfig
***
*** Can't find default configuration "defconfig"!
***
make: *** 
[/gnu/store/dv009i1wj865n34dyln2fmxryxqg3z7c-crosstool-ng-1.26.0/bin/ct-ng:145: 
defconfig] Error 1
error: in phase 'defconfig': uncaught exception:
%exception #<&invoke-error program: "ct-ng" arguments: ("defconfig") 
exit-status: 2 term-signal: #f stop-signal: #f>
phase `defconfig' failed after 0.1 seconds
command "ct-ng" "defconfig" failed with status 2
builder for 
`/gnu/store/f454kx4v789af03s2rz6nzlznhla9i6x-ct-ng-riscv64-unknown-elf-1.26.0.drv' 
failed with exit code 1
While executing meta-command:
ERROR:
   1. &store-protocol-error:
       message: "build of 
`/gnu/store/f454kx4v789af03s2rz6nzlznhla9i6x-ct-ng-riscv64-unknown-elf-1.26.0.drv' 
failed"
       status: 100


The ct-ng tool that is invoked from the build-system is saying that it 
can't find the defconfig file.

Richard,
 From your debugging tips you mentioned looking at the mentioned ".drv" 
file and the associated "-builder" file. In the builder file I can see:

   (crosstool-ng-build #:name "ct-ng-riscv64-unknown-elf-1.26.0" 
#:source "/gnu/store/651xmndi8wshqc7lrgiw9b59mh0nygxj-defconfig"

Which is interesting, I guess I assumed that the plainfile that I 
specified in the package declaration would be put in a build directory 
or something. I see that it is in the store, which makes sense.

I think my main question here then is how can I get the defconfig file 
from the store into the build directory so that I can invoke commands in 
the build system like other build systems do? The difference between 
other packages is that it seems that other packages have a git repo or 
something for package sources and the associated build system can invoke 
commands on the files there. I want to be able to just provide a partial 
defconfig file and operate on that.

Thanks for any pointers,
Jesse


On 3/9/24 10:02, Jesse Millwood wrote:
> Thanks for your response Richard!
>
> On 3/8/24 22:39, Richard Sent wrote:
>> Jesse,
>>
>> I expect your issue is you have an extra gexp in
>> build-system/crosstool-ng.scm, line 71. I determined this by:
>>
>> 1. Examining the derivation Guix is trying to build
> I'm still trying to learn about the internals of Guix and writing 
> packages. How did you examine the derivation Guix is trying to build?
>> 2. Examining the -builder file mentioned in the derivation
> Ah! I did not notice that file in the output nor open it! I see now 
> that the Derivations section of the manual mentions these drv files. 
> Is this where you are examining the derivation that Guix is trying to 
> build?
>> 3. Observe that ct-ng-riscv64-unknown-elf-1.26.0-builder wraps
>> (crosstool-ng-build ...) in (gexp).
>
> Where is this? Are you talking of this in build-system/crosstool-ng:
>
>   (define build
>     (with-imported-modules
>      imported-modules
>      #~(begin
>          (use-modules #$@(sexp->gexp modules))
>          #~(crosstool-ng-build #:name #$name
>
> Where "#~", I have learned from Marek (earlier in this thread), is an 
> alias for "gexp".
>
> Ah, I see the ct-ng-riscv64-unknown-elf-1.26.0-builder in the drv file 
> and wow, I didn't know this existed! I see the gexp wrapping that you 
> mention.
>
> Is there a way to use the guix command to tell me where the drv file 
> for other packages exist? It is apparent that I need to perform a more 
> in depth review of the manual. This really helps contextualize things 
> for me.
>
>> The package still did not build locally on my machine after removing it,
>> but it seems to have progressed to a further stage.
>>
> Thanks, I may investigate how other derivations look now that I know 
> where to look. I appreciate the detailed input!

  reply	other threads:[~2024-03-16 21:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=618d1615-1328-4027-9b29-843bde81f05b@fastmail.com \
    --to=jesse_m@fastmail.com \
    --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.