GNU bug report logs - #70553
Packages built via gexp but not "installed" are not visible in containerized environments

Previous Next

Package: guix;

Reported by: Richard Sent <richard <at> freakingpenguin.com>

Date: Wed, 24 Apr 2024 17:41:06 UTC

Severity: normal

To reply to this bug, email your comments to 70553 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#70553; Package guix. (Wed, 24 Apr 2024 17:41:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Richard Sent <richard <at> freakingpenguin.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 24 Apr 2024 17:41:08 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Richard Sent <richard <at> freakingpenguin.com>
To: bug-guix <at> gnu.org
Subject: Packages built via gexp but not "installed" are not visible in
 containerized environments
Date: Wed, 24 Apr 2024 13:39:16 -0400
Hi Guix!

Consider a home environment with the following configuration:

--8<---------------cut here---------------start------------->8---
(use-modules (guix gexp)
             (gnu home)
             (gnu home services shells)
             (gnu services)
             (gnu packages dns))

(home-environment
 ;; (packages `((,isc-bind "utils")))
 (services
  (list   
   (service home-bash-service-type
            (home-bash-configuration
             (aliases
              `(;; Add other aliases here
                ,@(let ((dig (file-append (gexp-input isc-bind "utils") "/bin/dig")))
                    `(("wanip"  . ,#~(string-append #$dig " @resolver4.opendns.com myip.opendns.com +short"))
                      ("wanip4" . ,#~(string-append #$dig " @resolver4.opendns.com myip.opendns.com +short -4"))
                      ("wanip6" . ,#~(string-append #$dig " @resolver1.ipv6-sandbox.opendns.com AAAA myip.opendns.com +short -6")))))))))))
--8<---------------cut here---------------end--------------->8---

When starting a container with this home environment via `$ guix home
container home.scm`, `wanip` will be successfully aliased to
`/gnu/store/...-bind-<version>-utils/bin/dig` and that package will be
built by the daemon.

However, because the container only sees a subset of /gnu/store that
contains packages registered in the profile, that path will not be
present in the container. This can be confirmed by uncommenting the
(packages) field.

I don't know the best way to resolve this, but in my opinion the fact
that Guix lets you combine package "installation" and usage in a gexp is
a great feature. This is definitely cleaner than needing to create an
entire custom service that extends both the home profile service and
home bash service. Especially if this is done multiple times. I also
think this is better than adding isc-bind to the profile and hardcoding
"dig" in .bashrc.

It would be nice if Guix was smart enough to register that store path as
belonging to the home environment and keep it visible to the container
so the behavior could be consistent between `$ guix home reconfigure`
and `$ guix home container`.

Perhaps there's a better way to determine the /gnu/store subset that
should be visible to containers besides just reading the environmnet's
profile.

I expect this crops up in a lot more places than just home environments
and home bash service. I'd hope for a more generalized solution
that solves this problem across multiple services, not specifically
home-bash-service.

-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.




This bug report was last modified 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.