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 Millwood
Subject: Re: Help with channel build system and package
Date: Sat, 16 Mar 2024 18:50:53 -0400
User-agent: Mozilla Thunderbird

I actually think I figured it out!

I ended up adding a build phase that copies the plain-file defined as the source in the package object to the build directory. I'm finally at a point where I'm just having build failures of the package itself, which I'm a little more familiar debugging.

Thanks for all the help!

On 3/16/24 17:47, Jesse Millwood wrote:
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 via email to

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