GNU bug report logs -
#78378
[PATCH 0/2] home: services: Build "files" union allowing dangling symlinks.
Previous Next
Reported by: Sergey Trofimov <sarg <at> sarg.org.ru>
Date: Sun, 11 May 2025 16:02:02 UTC
Severity: normal
Tags: patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Sergey,
Sergey Trofimov <sarg <at> sarg.org.ru> writes:
> * gnu/home/services.scm (files->files-directory): Build file union
> without checking for existence of included items.
>
> * tests/guix-home.sh: Verify symlinking files out of store works.
>
> Change-Id: I94054003f4a6be944252ce7a397cf56f0b979554
[...]
> @@ -343,7 +343,21 @@ (define (files->files-directory files)
> ;; leading to a build failure of "files.drv".
> (assert-no-duplicates files)
>
> - (file-union "files" files))
> + ;; Compute the file-union allowing dangling symlinks
> + ;; This enables creating symlinks to locations out of store
> + (computed-file
> + "files"
> + (with-imported-modules '((guix build utils))
> + #~(begin
> + (use-modules (guix build utils)
> + (ice-9 match))
> + (mkdir #$output)
> + (chdir #$output)
> + (for-each (match-lambda
> + ((target source)
> + (mkdir-p (dirname target))
> + (symlink source target)))
> + '#$files)))))
Instead of more or less duplicating ‘file-union’, how about adding a
#:dangling-symlinks? argument to ‘file-union’ that would default to #f?
When set to #t, the ‘stat’ call would not be emitted.
That would reduce code duplication and make the intent clearer IMO.
Ludo’.
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.