Subject: Re: bug#32966: tests/install.scm tests all fail
From: [email-masked] (Ludovic Courtès)
To: Clément Lassieur <[email-masked]>
Cc: [email-masked]
Date: Sat, 27 Oct 2018 17:18:04 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Clément,

Clément Lassieur <[email-masked]> skribis:

> This is the output of one of them when run manually:
>
> $ guix build /gnu/store/0l77fgdgp4c3yq82mwd1kq1rzckn5x9b-btrfs-root-os.drv

[...]

> Backtrace:
>            2 (primitive-load "/gnu/store/fcybzbgns1nsglrkdj833mk53si?")
> In srfi/srfi-1.scm:
>     640:9  1 (for-each #<procedure c487a0 at ice-9/eval.scm:333:13 ?> ?)
> In unknown file:
>            0 (copy-file "/gnu/store/sqacjhyfz32diqys3pp7j6x8bs2zx7p?" ?)
>
> ERROR: In procedure copy-file:
> In procedure copy-file: Permission denied
> builder for `/gnu/store/7b054w5p8870k2rdc7jfimqk2k6n163d-module-import.drv' failed with exit code 1

This is fixed by 932d1600564cbf359a6ccd1086b968a934bef8e5, which
contains an explanation.

To reproduce it from a checkout, all you had to do is:

  make
  touch guix/self.scm
  ./pre-inst-env guix system disk-image gnu/system/examples/bare-bones.tmpl

The effect of ‘touch’ is that (guix self) was being evaluated and as a
consequence, ‘make-config.scm’, which is called by ‘qemu-image’ in (gnu
system vm), would always return a fresh object.

As a result, the ‘delete-duplicates’ call in ‘gexp-attribute’ would
leave two occurrences of:

  ((guix config) => ,(scheme-file …))

Thus, the builder of module-import.drv would look like this:

--8<---------------cut here---------------start------------->8---
 (for-each (match-lambda
	    ((final-path store-path)
	     (mkdir-p (dirname final-path))
	     (copy-file store-path final-path)))
	   (quote (("guix/build/utils.scm" "/gnu/store/bp7pms1s0563kcyjyla0f7c89jimra9k-utils.scm")
		   ("gnu/build/vm.scm" "/gnu/store/jnfmvx6lay9iqz7fy25myvvf1n3imac1-vm.scm")
                   ;; …
		   ("gnu/build/install.scm" "/gnu/store/wfrh0xm36r7bbqfq07s91ymcinpc79sa-install.scm")
		   ("guix/config.scm" "/gnu/store/sqacjhyfz32diqys3pp7j6x8bs2zx7pv-config.scm")
		   ("guix/config.scm" "/gnu/store/sqacjhyfz32diqys3pp7j6x8bs2zx7pv-config.scm"))))  ;<- twice!
--8<---------------cut here---------------end--------------->8---

The module-import.drv build would then fail with “Permission denied”
while attempting to copy guix/config.scm for the second time.

As to why (guix self) is evaluated in the context of Cuirass… it’s
probably because of the ‘guix offload’ issue fixed in
e4752118691e41ae8307649d1abfd4739b3e4bfa.  Are you using offloading on
your build farm?

Thanks,
Ludo’.