Subject: bug#52103: guix pull: guix-manual.drv' failed with exit code 1, In procedure copy-file: Permission denied

From: Christopher Baines <[email-masked]>
Date: Sun, 12 Dec 2021 22:19:36 +0000

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

> Hi,
>
> Christopher Baines <[email-masked]> skribis:
>
>> I've had a go at debugging this further, I'm not confident I've found
>> the relevant part of the strace output, but I think it could be this bit:
>>
>> 14403 newfstatat(AT_FDCWD,
>> "/gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf8-guix-translated-texinfo/guix.de.texi",
>> {st_mode=S_IFREG|0444, st_size=925279, ...}, AT_SYMLINK_NOFOLLOW) =
>> 0
>> 14403 openat(AT_FDCWD, "/gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf8-guix-translated-texinfo/guix.de.texi", O_RDONLY) = 15
>> 14403 fstat(15, {st_mode=S_IFREG|0444, st_size=925279, ...}) = 0
>> 14403 openat(AT_FDCWD, "./guix.de.texi", O_WRONLY|O_CREAT|O_TRUNC, 0444) = -1 EACCES (Permission denied)
>
> It could be that ./guix.de.texi already exists and is read-only, or that
> “.” is read-only.
>
>> There's more information below. I wonder if this could somehow be
>> connected to guix.de.texi being both in the -doc store item, and
>> -guix-translated-texinfo. Reading the builder, it looks like it copies
>> it first from -doc, then again from -guix-translated-texinfo, and that's
>> the point at which it fails?
>
> Ah yes, that looks like a problem: “doc”, which is taken straight from
> the checkout, normally does not contain *.LANG.texi; those files are not
> checked in.
>
> Could it be that ~/.cache/guix/checkouts contains a non-pristine
> checkout of Guix with that extra file?

That looks like the issue.

cbaines@hatysa ~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq$ ls -l doc/
total 3656
-rw-r--r-- 1 cbaines users   54631 Nov 25 08:37 build.scm
-rw-r--r-- 1 cbaines users   23526 Nov  9 09:43 contributing.de.texi
-rw-r--r-- 1 cbaines users   45405 Nov  9 09:43 contributing.fr.texi
-rw-r--r-- 1 cbaines users   81777 Dec 10 14:21 contributing.texi
-rw-r--r-- 1 cbaines users     481 Jul  2 07:49 environment-gdb.scm
-rw-r--r-- 1 cbaines users   23433 Nov 21 18:43 fdl-1.3.texi
-rw-r--r-- 1 cbaines users  107412 Nov 25 08:37 guix-cookbook.texi
-rw-r--r-- 1 cbaines users  925279 Nov  9 09:43 guix.de.texi
-rw-r--r-- 1 cbaines users 1019672 Nov  9 09:43 guix.fr.texi
-rw-r--r-- 1 cbaines users 1388712 Dec 10 14:21 guix.texi
-rw-r--r-- 1 cbaines users     698 Nov 21 18:43 he-config-bare-bones.scm
-rw-r--r-- 1 cbaines users   22650 Nov 21 18:43 htmlxref.cnf
drwxr-xr-x 2 cbaines users    4096 Nov 21 18:43 images/
-rw-r--r-- 1 cbaines users    8750 Nov 21 18:43 local.mk
-rw-r--r-- 1 cbaines users     840 Nov 21 18:43 package-hello.json
-rw-r--r-- 1 cbaines users     615 Jul  2 07:49 package-hello.scm

I was a bit confused as git status didn't show it as untracked, but I
think that's just because of the .gitignore. git clean -x -n shows it:

Would remove doc/guix.de.texi

That outputs 259 other files as well. Maybe it's worth running git clean
on the cache directory, or only pulling files in from the cache
directory if they're tracked by git.