GNU bug report logs -
#78378
[PATCH 0/2] home: services: Build "files" union allowing dangling symlinks.
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 21 May 2025 08:14:25 +0900
with message-id <87sekyan8u.fsf <at> gmail.com>
and subject line Re: [bug#78378] [PATCH v1 1/3] gexp: Allow file-unions with dangling symlinks.
has caused the debbugs.gnu.org bug report #78378,
regarding [PATCH 0/2] home: services: Build "files" union allowing dangling symlinks.
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
78378: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78378
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
This patch enables guix home users to create arbitrary symlinks in their home
environment. I.e. a user having "/storage" directory (probably residing on
another disk partition) could symlink e.g. "~/.mail" from
"/storage/data/mail".
Sergey Trofimov (2):
gexp: Add symlink-to procedure.
home: services: Build "files" union allowing dangling symlinks.
doc/guix.texi | 11 +++++++++++
gnu/home/services.scm | 16 +++++++++++++++-
guix/gexp.scm | 5 +++++
tests/guix-home.sh | 8 +++++++-
4 files changed, 38 insertions(+), 2 deletions(-)
base-commit: f6363db18636172f959e2709982bbe09b411c3d8
--
2.49.0
[Message part 3 (message/rfc822, inline)]
Hi Sergey,
I've merged this series with the following small adjustments for 1/3:
--8<---------------cut here---------------start------------->8---
modified guix/gexp.scm
@@ -2145,7 +2145,7 @@ (define* (mixed-text-file name #:key guile #:rest text)
(computed-file name build #:guile guile))
-(define* (file-union name files #:key guile (dangling-symlinks? #f))
+(define* (file-union name files #:key guile dangling-symlinks?)
"Return a <computed-file> that builds a directory containing all of FILES.
Each item in FILES must be a two-element list where the first element is the
file name to use in the new directory, and the second element is a gexp
@@ -2159,29 +2159,29 @@ (define* (file-union name files #:key guile (dangling-symlinks? #f))
(\"libvirt/qemu.conf\" ,(plain-file \"qemu.conf\" \"\"))))
This yields an 'etc' directory containing these two files."
- (computed-file name
- (with-imported-modules '((guix build utils))
- (gexp
- (begin
- (use-modules (guix build utils))
-
- (mkdir (ungexp output))
- (chdir (ungexp output))
- (ungexp-splicing
- (map (match-lambda
- ((target source)
- (gexp
- (let ((source (ungexp source))
- (target (ungexp target)))
- (unless (or (ungexp dangling-symlinks?)
- (stat source #f))
- (error (format #f "~a points to inexistent file or dangling symlink ~a"
- target source)))
-
- (mkdir-p (dirname target))
- (symlink source target)))))
- files)))))
- #:guile guile))
+ (computed-file
+ name
+ (with-imported-modules '((guix build utils))
+ (gexp
+ (begin
+ (use-modules (guix build utils))
+
+ (mkdir (ungexp output))
+ (chdir (ungexp output))
+ (ungexp-splicing
+ (map (match-lambda
+ ((target source)
+ (gexp
+ (let ((source (ungexp source))
+ (target (ungexp target)))
+ (unless (or (ungexp dangling-symlinks?)
+ (stat source #f))
+ (error (format #f "~a points to inexistent file \
+or dangling symlink ~a" target source)))
+ (mkdir-p (dirname target))
+ (symlink source target)))))
+ files)))))
+ #:guile guile))
(define (symlink-to target)
"Return an object that is a symlink to TARGET."
--8<---------------cut here---------------end--------------->8---
Mostly to meet the max line width of 80 columns.
And for 3/3:
--8<---------------cut here---------------start------------->8---
modified gnu/home/services.scm
@@ -343,7 +343,7 @@ (define (files->files-directory files)
;; leading to a build failure of "files.drv".
(assert-no-duplicates files)
- ;; Allow symlinks to locations out of store
+ ;; Allow symlinks to locations outside the store.
(file-union "files" files #:dangling-symlinks? #t))
;; Used by symlink-manager
--8<---------------cut here---------------end--------------->8---
e.g. adding missing punctuation for a standalone comment.
Pushed with commit 11bc17c409.
--
Thanks,
Maxim
This bug report was last modified 28 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.