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

From: Ludovic Courtès <[email-masked]>
Date: Sun, 23 Feb 2025 23:00:40 +0100

Hi Rodion,

Rodion Goritskov <[email-masked]> skribis:

> 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?

Oops, I ran it with:

  ./pre-inst-env guix build -f gnu/tests/foreign.scm

but really, it should have exported the test so one can run:

  make check-system TESTS=debian-install

I’ll fix that in a second version.

>> +  (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):

Interesting; it worked for me.  But perhaps that has to do with the
timestamp issue: if .scm files were being recompiled due to timestamps,
then the process ended up consuming more memory.

>> +            (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.

Yes, that’s a good idea.  I guess I was just lucky the .scm timestamps
looked older than .go timestamps.

> 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).

‘%installation-tarball-manifest’ is so that only ‘hello’ itself is
missing from the store.  If you observe that it tries to build more,
then something is wrong; looking at the “The following derivations will
be built” message can (maybe) give a hint, by looking at the bottom of
that long derivation list.

Thanks for taking a look, I’ll send a new version fixing these issues!

Ludo’.