Subject: [bug#76488] [PATCH 4/4] tests: Test installation on Debian.

From: Rodion Goritskov <[email-masked]>
Date: Sun, 23 Feb 2025 22:21:46 +0100

Hi,

Ludovic Courtès <[email-masked]> writes:

> * gnu/tests/foreign.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
>
> Change-Id: I1f24d83bdc298acbef15db2e19775cc1d3fbd56c
> ---
>  gnu/local.mk          |   1 +
>  gnu/tests/foreign.scm | 337 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 338 insertions(+)

I got some questions on the test itself.

> diff --git a/gnu/tests/foreign.scm b/gnu/tests/foreign.scm
> new file mode 100644
> index 00000000000..8cf580cb22d
> --- /dev/null
> +++ b/gnu/tests/foreign.scm
> +(define-module (gnu tests foreign)
> +  #:use-module (guix download)
> +  #:use-module (guix gexp)
> +  #:use-module (guix modules)
> +  #:use-module (guix monads)
> +  #:use-module (guix packages)
> +  #:use-module (guix profiles)
> +  #:autoload   (guix store) (%store-prefix %store-monad %graft?)
> +  #:use-module (gnu compression)
> +  #:use-module (gnu tests)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages bootstrap)
> +  #:use-module (gnu packages guile)
> +  #:use-module (gnu packages make-bootstrap)
> +  #:use-module (gnu packages package-management)
> +  #:use-module (gnu packages virtualization)
> +  #:use-module (gnu system vm)
> +  #:use-module ((guix scripts pack) #:prefix pack:)
> +  #:use-module (srfi srfi-9))

How could I run this test?
As I see, the #:export is missing, so I couldn't run it with the make
check-system.
Sorry, I am kind of a newcomer to the Guile world - I see the call of
the %test-foreign-install in the end of the file, but how should I run
the whole file?

> +  (define vm
> +    (virtual-machine
> +     (marionette-operating-system %simple-os)))

Somehow I got some out of memory errors a couple of times during the
qcow build with this configuration
- so I changed to the following and stopped encountering this issue (odd
that 256 MB is not enough here sometimes):
>  (define vm
>    (virtual-machine
>     (operating-system (marionette-operating-system %simple-os))
>     (memory-size 512)))

> +            (marionette-eval '(begin
> +                                (use-modules (guix build utils))
> +                                (mkdir-p "/mnt/opt/guix")
> +                                (copy-recursively #$%guile-static-initrd
> +                                                  "/mnt/opt/guix"
> +                                                  #:log (%make-void-port "w")))

On this step I see, that guile reports that source files are newer than go
files and starts recompilation.
Probably, that is because of updated timestamps when copying.
Looks like it could be fixed with the keep-mtime? set to true.
>             (marionette-eval '(begin
>                                (use-modules (guix build utils))
>                                (mkdir-p "/mnt/opt/guix")
>                                (copy-recursively #$%guile-static-initrd
>                                                  "/mnt/opt/guix"
>                                                  #:log (%make-void-port "w")
>                                                  #:keep-mtime? #t))

After that test installs guix on debian, but during the build of
hello it starts building all the dependencies, which is unexpected, I
think, and fails during the fetching of sources (which is, probably,
expected, because the network is not available).

Sorry for the inconvenience, I still figuring out how it works (or
should work).