Re: Problems running Guix System initrd on an i.MX6 ARM board

2023-02-27 Thread Maxim Cournoyer
Hello!

Efraim Flashner  writes:

> On Mon, Dec 12, 2022 at 10:40:50PM -0500, Maxim Cournoyer wrote:
>> Hi Guix!
>> 
>> I've been trying for some time to run Guix System on an ARM board (a
>> TS-7970 with an i.MX6 Cortex A9 CPU).  I wanted to cross-compile the
>> image for speed and efficiency, and stumbled upon some problems on the
>> way, such as https://issues.guix.gnu.org/44924, fixed on core-updates.

[...]

>> The initrd now runs, but it fails with the following error:
>> 
>> --8<---cut here---start->8---
>> [8.448448] ALSA device list:
>> [8.451472]   #0: On-board Codec
>> [8.454768]   #1: imx-hdmi-soc
>> [8.461095] Freeing unused kernel memory: 1024K (80e0 - 80f0)
>> GC Warning: pthread_getattr_np or pthread_attr_getstack failed for main 
>> thread
>> GC Warning: Couldn't read /proc/stat
>> [8.481168] mmc0: new SDIO card at address 0001
>> Welcome, this is GNU's early boot Guile.
>> Use 'gnu.repl' for an initrd REPL.
>> 
>> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
>> Throw to key `record-abi-mismatch-error' with args `(abi-check "~a: record 
>> ABI mismatch; recompilation needed" (#>) ())'.
>> 
>> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
>> GNU Guile 3.0.8
>> Copyright (C) 1995-2021 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@(guile-user)>
>> --8<---cut here---end--->8---
>> 
>> The .go modules appear to be correctly cross-compiled for
>> arm-linux-gnueabihf (they run fine on the same target using a different
>> OS that I can boot with).
>> 
>> Ideas?
>
> Perhaps you'll need to compile more with guile-3.0-latest. If it's not
> too much I suppose you could try moving guile-3.0-latest to guile-3.0.
> Otherwise I guess you'll need to find where  is being
> compiled and replace that guile-3.0 with guile-3.0-latest too, and then
> see where the next failure is.

I've tried that on master, with the following patch applied:

--8<---cut here---start->8---
1 file changed, 17 insertions(+), 31 deletions(-)
gnu/packages/guile.scm | 48 +---

modified   gnu/packages/guile.scm
@@ -310,15 +310,15 @@ (define-public guile-3.0
   (package
 (inherit guile-2.2)
 (name "guile")
-(version "3.0.7")
+(version "3.0.9")
 (source (origin
   (inherit (package-source guile-2.2))
-  (patches '()) ; We no longer need the patches.
+  (patches '()) ;no longer needed
   (uri (string-append "mirror://gnu/guile/guile-"
   version ".tar.xz"))
   (sha256
(base32
-"1dwiwsrpm4f96alfnz6wibq378242z4f16vsxgy1n9r00v3qczgm"))
+"03bm1mnfc9kkg2ls942a0js7bxrdzmcffgrgg6anwdmjfan2a9hs"))
   ;; Replace the snippet because the oom-test still
   ;; fails on some 32-bit architectures.
   (snippet '(begin
@@ -334,6 +334,11 @@ (define-public guile-3.0
(delete "gmp" "libltdl")))
 (arguments
  (substitute-keyword-arguments (package-arguments guile-2.0)
+   ;; Guile 3.0.9 is bit-reproducible when built in parallel, thanks to
+   ;; its multi-stage build process for cross-module inlining, except when
+   ;; cross-compiling.
+   ((#:parallel-build? _ #f)
+(not (%current-target-system)))
((#:configure-flags flags ''())
 ;; XXX: JIT-enabled Guile crashes in obscure ways on GNU/Hurd.
 `(cons* ,@(if (hurd-target?)
@@ -365,19 +370,19 @@ (define-public guile-3.0
  (lambda _
;; Upstream knows about suggested solution.
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
-   (substitute* "bootstrap/Makefile.in"
+   ;; 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977223#46
+   (substitute* "stage0/Makefile.in"
  (("^GUILE_OPTIMIZATIONS.*")
   "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives 
-Ocps\n")
  '())
,@(if (or (target-ppc32?)
  (target-riscv64?))
-   `((add-after 'unpack 'skip-failing-fdes-test
-   (lambda _
- ;; ERROR: ((system-error "seek" "~A" ("Bad file 
descriptor") (9)))
- (substitute* "test-suite/tests/ports.test"
-   (("fdes not closed\"" all) (string-append all "(exit 
77)")))
- #t)))
-   '())
+ `((add-after 'unpack 'skip-failing-fdes-test
+

Re: Minimal working examples of packages for experimentation?

2023-02-27 Thread Jelle Licht
Hello Rodrigo!

Rodrigo Morales  writes:

> [snip]

>   The following is the package that I wrote.
>
>   ,
>   | (define-module (my-simple)
>   |   #:use-module (guix licenses)
>   |   #:use-module (guix packages)
>   |   #:use-module (guix gexp)
>   |   #:use-module (guix build-system trivial)
>   |   #:use-module (guix download))
>   |
>   | (define-public my-simple-1
>   |   (package
>   |(name "my-simple-1")
>   |(version "2.10")
>   |(source (origin
>   | (method url-fetch)
>   | (uri "
> https://www.gnu.org/graphics/heckert_gnu.transp.small.png;)
>   | (sha256 (base32
> "1686w7x3qk85i5693nrj7lbdh64232fdsqd5rgxgijv1y39rldbr"
>   |(build-system trivial-build-system)
>   |(synopsis "My synopsis")
>   |(description "My description")
>   |(home-page "https://example.org/;)
>   |(license gpl3+)))
>   `

> [snip]

> 3 What I'm looking for
> ==
>
>   1. Why the package that I wrote failing? How could I fix it?

Looking at `info "(guix) Build Systems"'[0], in the blurb about the
trivial-build-system:

--8<---cut here---start->8---
 This build system requires a ‘#:builder’ argument.  This argument
 must be a Scheme expression that builds the package output(s)—as
 with ‘build-expression->derivation’ (*note
 ‘build-expression->derivation’: Derivations.).
--8<---cut here---end--->8---

The reason your package fails to build, is that it doesn't provide such
a #:builder argument. This argument is also responsible for creating the
actual output, which can be a file or directory.

The simplest snippet I can think of for making your package "work":

--8<---cut here---start->8---
(define-public my-simple-1
  (package
; .. existing stuff
(arguments (list #:builder #~(mkdir #$output)
--8<---cut here---end--->8---

Note that this simply creates the output directory, and does nothing
else.

What may seem a bit misleading here is that "build expressions" have
mostly been ported to this hip thing called G-Expressions (see `info
"(guix) G-Expressions"' [1]).

>   2. Do you know simpler package definitions (aka minimal working
>  examples) that I could use for experimenting?

Simple does not always imply easy. If we're talking about an easy to use
build system, I think the `copy-build-system' could work, as does the
gnu-build-system as it allows you to play with the moving parts without
having to supply all of these moving parts yourself :).

A package that uses the trivial-build-system that does slightly more is
`inxi-minimal', which you can find by issuing a `guix edit inxi-minimal'.

HTH!
 - Jelle

[0]: 
https://guix.gnu.org/manual/devel/en/html_node/Build-Systems.html#index-trivial_002dbuild_002dsystem
[1]: https://guix.gnu.org/manual/devel/en/html_node/G_002dExpressions.html



Minimal working examples of packages for experimentation?

2023-02-27 Thread Rodrigo Morales
Table of Contents
_

1. The context
2. What I've tried
3. What I'm looking for


1 The context
=

  I'm trying to write the simplest package definition that does nothing
  in order to be able to generate multiple generations on the fly and
  experiment with the `guix package' flags that act on generations.

  I asked the same question in  and someone
  recommended me using the `my-hello' package shown as an example in
  (guix-cookbook) GUIX_PACKAGE_PATH. I replied to him that I didn't want
  to use that definition because it downloads a file and performs some
  compilation steps and I was looking for something simpler. The same
  user replied "you could copy the sources to a local directory, and
  edit the file description so it's url-fetch method and the uri is the
  absolute path to where the pkg is.". I haven't found examples on this,
  so I thought it would be difficult to do it.

  I found several examples on using `url-fetch', so I decided to write a
  package that downloads a single small file from the Internet
  (e.g.  )
  and install it under a directory. This is what I tried to write but
  with no avail. The next section shows what I tried.


2 What I've tried
=

  The following is the package that I wrote.

  ,
  | (define-module (my-simple)
  |   #:use-module (guix licenses)
  |   #:use-module (guix packages)
  |   #:use-module (guix gexp)
  |   #:use-module (guix build-system trivial)
  |   #:use-module (guix download))
  |
  | (define-public my-simple-1
  |   (package
  |(name "my-simple-1")
  |(version "2.10")
  |(source (origin
  | (method url-fetch)
  | (uri "
https://www.gnu.org/graphics/heckert_gnu.transp.small.png;)
  | (sha256 (base32
"1686w7x3qk85i5693nrj7lbdh64232fdsqd5rgxgijv1y39rldbr"
  |(build-system trivial-build-system)
  |(synopsis "My synopsis")
  |(description "My description")
  |(home-page "https://example.org/;)
  |(license gpl3+)))
  `

  If I try to install the package I get the following
  error. Fortunately, it shows that there's a build log.

  ,
  | export GUIX_PACKAGE_PATH=~/my-packages
  | guix package -i my-simple-1
  | echo Exit code: $?
  `

  ,
  | The following package will be installed:
  |my-simple-1 2.10
  |
  | substitute:
substitute: [Kupdating substitutes from 'https://ci.guix.gnu.org'...   0.0%
substitute: [Kupdating substitutes from 'https://ci.guix.gnu.org'... 100.0%
  | substitute:
substitute: [Kupdating substitutes from 'https://bordeaux.guix.gnu.org'...
  0.0%
substitute: [Kupdating substitutes from 'https://bordeaux.guix.gnu.org'...
100.0%
  | The following derivations will be built:
  |   /gnu/store/lsqc0zjvqmnc8vbkk36g9jy5bcnmk455-profile.drv
  |   /gnu/store/a1cxm06cdacqry9x0c14pnb4s491b6z9-my-simple-1-2.10.drv
  |
  | building
/gnu/store/a1cxm06cdacqry9x0c14pnb4s491b6z9-my-simple-1-2.10.drv...
  | builder for
`/gnu/store/a1cxm06cdacqry9x0c14pnb4s491b6z9-my-simple-1-2.10.drv' failed
to produce output path
`/gnu/store/a8p80lxgcar332ln81ss6pl9xr0wajsh-my-simple-1-2.10'
  | build of
/gnu/store/a1cxm06cdacqry9x0c14pnb4s491b6z9-my-simple-1-2.10.drv failed
  | View build log at
'/var/log/guix/drvs/a1/cxm06cdacqry9x0c14pnb4s491b6z9-my-simple-1-2.10.drv.gz'.
  | cannot build derivation
`/gnu/store/lsqc0zjvqmnc8vbkk36g9jy5bcnmk455-profile.drv': 1 dependencies
couldn't be built
  | guix package: error: build of
`/gnu/store/lsqc0zjvqmnc8vbkk36g9jy5bcnmk455-profile.drv' failed
  | Exit code: 1
  `

  When I try to read the log file, it is empty.

  ,
  | echo 'foo'
  | zcat
/var/log/guix/drvs/a1/cxm06cdacqry9x0c14pnb4s491b6z9-my-simple-1-2.10.drv.gz
  | echo 'bar'
  `

  ,
  | foo
  | bar
  `


3 What I'm looking for
==

  1. Why the package that I wrote failing? How could I fix it?
  2. Do you know simpler package definitions (aka minimal working
 examples) that I could use for experimenting?

  (This is an example of [The XY problem], question 1 is X, question 2
  is Y)


[The XY problem] 


Re: delete generations

2023-02-27 Thread Andreas Enge
Hello,

Am Mon, Feb 27, 2023 at 10:58:54AM + schrieb Gottfried:
> is this command right to delete generation 109-127 ?
> guix package --delete-generations=109-127

not exactly; it is explained here:
   
https://guix.gnu.org/de/manual/devel/en/html_node/Invoking-guix-package.html#Invoking-guix-package

Look for "--list-generations", the same choices apply for deleting
generations.

Andreas




delete generations

2023-02-27 Thread Gottfried

Hi

is this command right to delete generation 109-127 ?

guix package --delete-generations=109-127


Kind regards

Gottfried



OpenPGP_0x61FAF349C9FB7F94.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Newbie user question: What do the columns shown by "guix package -I" mean?

2023-02-27 Thread Simon Tournier
Hi,

On Sun, 26 Feb 2023 at 21:31, Tobias Geerinckx-Rice  wrote:

> I, personally, would welcome breaking their scripts—in exchange 
> for adding a ‘--format=’ option like 
> we already do for ‘guix search’.  A real API that's actually 
> reliable and supportable.  I think that's fair.

Well, that’s something I would like since a very long time.  Well, I
even probably started somewhere an extension as replacement.

By , do you mean some placeholders?


> I just think I'd be outvoted and don't feel like starting a fight 
> :-)

That’s why extension. :-)  It would avoid the fight and in the same time
it would help in designing such API allowing experimental breakage.

Well, I would also welcome this --format=. :-)

Cheers,
simon




Re: Examples of local-host-entries or hosts-service-type?

2023-02-27 Thread Remco van 't Veer
Hi Bruno,

Thanks for the clarification!

2023/02/21 16:45, Bruno Victal:

> You only override the hosts-service-type value when you don't want to
> have 'localhost' as an alias of your _hostname_ or you don't want to
> set '127.0.0.1' / '::1' as IPs for localhost / _hostname_.

Or when you want to provide extra aliases for localhost?

Like this?

  (essential-services
   (modify-services
   (operating-system-default-essential-services this-operating-system)
 (hosts-service-type config =>
 (list (host "127.0.0.1" "localhost" (list host-name 
"foo" "bar"))
   (host "::1"   "localhost" (list host-name 
"foo" "bar"))

Cheers,
Remco



How to show progress for git-fetch method?

2023-02-27 Thread Rodrigo Morales
Table of Contents
_

1. The context
2. The question


1 The context
=

  Inexperienced user here. I'm currently learning how to write packages
  for Guix. I'm using the following package definition.

  ,
  | (define-module (fonts)
  |   #:use-module (guix packages)
  |   #:use-module (guix git-download)
  |   #:use-module (guix gexp)
  |   #:use-module (guix build-system trivial)
  |   #:use-module ((guix licenses) #:prefix license:))
  |
  | (define-public font-noto-color-emoji
  |   (package
  | (name "font-noto-color-emoji")
  | (version "2.034")
  | (source (origin
  |   (method git-fetch)
  |   (uri (git-reference
  | (url "https://github.com/googlefonts/noto-emoji;)
  | (commit (string-append "v" version
  |   (file-name (git-file-name name version))
  |   (sha256
  |(base32
  |
"1d6zzk0ii43iqfnjbldwp8sasyx99lbjp1nfgqjla7ixld6yp98l"
  | (build-system trivial-build-system)
  | (arguments
  |  (list
  |   #:modules `((guix build utils))
  |   #:builder
  |   #~(begin
  |   (use-modules (guix build utils))
  |   (let* ((out #$output)
  |  (font-dir (string-append out "/share/fonts"))
  |  (truetype-dir (string-append font-dir "/truetype")))
  | (chdir (assoc-ref %build-inputs "source"))
  | (install-file "fonts/NotoColorEmoji.ttf" truetype-dir)
  | (home-page "https://github.com/googlefonts/noto-emoji;)
  | (synopsis "Noto Color Emoji fonts")
  | (description "Noto Color Emoji fonts.")
  | (license license:silofl1.1)))
  `

  I can install that package without problems, see output of the
  following command below.

  ,
  | date && guix package -i font-noto-color-emoji && date && echo "Exit
code: $?"
  `

  ,
  | Mon Feb 27 02:17:43 AM -05 2023
  | The following package will be installed:
  |font-noto-color-emoji 2.034
  |
  | The following derivations will be built:
  |   /gnu/store/vlhwjn94rknrnycmawj4h7h6wg3n0gqh-profile.drv
  |
/gnu/store/xjrsfz1ca4zphxivmsmz7z7j2xswrrgs-font-noto-color-emoji-2.034.drv
  |
/gnu/store/z085zkl49g4pxmd0f7m5izlmlf7429ac-font-noto-color-emoji-2.034-checkout.drv
  |
  | building
/gnu/store/z085zkl49g4pxmd0f7m5izlmlf7429ac-font-noto-color-emoji-2.034-checkout.drv...
  | building
/gnu/store/xjrsfz1ca4zphxivmsmz7z7j2xswrrgs-font-noto-color-emoji-2.034.drv...
  | building fonts directory...
  | building profile with 22 packages...
  | Mon Feb 27 02:18:08 AM -05 2023
  | Exit code: 0
  `

  As you can see above in the output of the `date' commands, it was a
  matter of seconds before the package was installed.


2 The question
=

  Because I'm learning how to write packages for Guix, I reinstall the
  package over and over again. Sometimes, the installation takes longer
  (for various reason, e.g. internet issues). For this reason, I'd to
  know what is happening under the hood during the installation,
  especially the progress of file downloads, so is it possible to show a
  progress bar for a `git-fetch' method?

  Think of this scenario where this might be more useful: One of my
  packages download a git repository whose size is bigger than 1GB and
  my internet connection is slow, this might take over 1 hour. By seeing
  the progress of the download, I wouldn't think that the command got
  stuck. I know there are other ways to discard such hypothesis (e.g. using
  strace on the process), but I just thought  that having a progressbar
  would be convenient.