Tomas Volf wrote 1 weeks ago
(address . bug-guix@gnu.org)
Hello,
when using `activation-service-type' combined with `with-extension', the
various modules seem to interfere with each other.
In my case the samba-service-type interferes with my custom service:
Toggle snippet (16 lines)
(define (watcher-activation* config)
(match-record config <watcher-configuration>
(user group cache-dir state-dir)
(with-extension/guile-wolfsden
#~(begin
(use-modules (wolfsden fs)
(wolfsden sh))
(for-each (lambda (dir)
(mkdir-p dir)
(invoke* #$(file-append coreutils "/bin/chown")
"-Rv" (string-append #$user ":" #$group) dir)
(chmod dir #o700))
'(#$cache-dir
#$state-dir))))))
samba-service-type's activation starts with:
Toggle snippet (6 lines)
(define (samba-activation config)
(let ((package (samba-configuration-package config))
(config-file (samba-configuration-config-file config)))
(with-imported-modules '((guix build utils))
Both (guix build utils) and (wolfsden sh) provide (invoke) procedure,
however with incompatible parameters, leading to somewhat annoying to
debug issues. In my case the error was:
Toggle snippet (4 lines)
guix deploy: error: failed to deploy x: failed to switch systems while deploying '127.0.0.1':
keyword-argument-error #f "Invalid keyword" () ("/etc/samba/smb.conf")
Which makes sense now when I understand what the problem is, but it took
while to get to it.
I do not think this should be the case. Either each activation service
should be isolated into a fresh user module, or the services provided by
Guix should not introduce any additional modules into the scope.
Alternatively, each activation service could be wrapped into
program-file, that would ensure isolation as well.
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.