Subject: bug#33285: Installing, then removing, a package yields a different profile

From: Ricardo Wurmus <[email-masked]>
Date: Mon, 04 Feb 2019 00:14:04 +0100

Hi,

Chris Marusich <[email-masked]> writes:

> The only differing paths look like they were produced by profile
> hooks.  Perhaps this issue has something to do with profile hooks?

This seems to be the case.  Here are the derivations for the info-dir
hook for the first and then the third profile:

--8<---------------cut here---------------start------------->8---
Derive
([("out","/gnu/store/vq1frsx6jkvk957mi2sx0rl629r31vi0-info-dir","","")]
 ,[("/gnu/store/32dcpfx9chyf1z3jhv41r7hx2a6vklw2-glibc-utf8-locales-2.28.drv",["out"])
   ,("/gnu/store/h0905d946s3xarcfakan8jnblcdqxs3a-hello-2.10.drv",["out"])
   ,("/gnu/store/jbnidakwvhr84rp8p8icdg1lnczjvi6w-gzip-1.9.drv",["out"])
   ,("/gnu/store/n9zlvq692s12aarbrfppz7ayzggxfkqx-guile-2.2.4.drv",["out"])
   ,("/gnu/store/p6ml6z1d3y387y06mbcvpnf19ik2qywh-module-import-compiled.drv",["out"])
   ,("/gnu/store/x62102cgam20b3g8vfdvw06snvznx12k-texinfo-6.5.drv",["out"])]
 ,["/gnu/store/n6gp00cayxm4lc5c17lrwhwx93fzg8hr-info-dir-builder","/gnu/store/p5q59xqmhwg60y2437fnny76nw7l6gbz-module-import"]
 ,"x86_64-linux","/gnu/store/r658y3cgpnf99nxjxqgjiaizx20ac4k0-guile-2.2.4/bin/guile",["--no-auto-compile","-L","/gnu/store/p5q59xqmhwg60y2437fnny76nw7l6gbz-module-import","-C","/gnu/store/qkqypgkam1fncl32l5qklplqh3a6k3fz-module-import-compiled","/gnu/store/n6gp00cayxm4lc5c17lrwhwx93fzg8hr-info-dir-builder"]
 ,[("allowSubstitutes","0")
   ,("guix properties","((type . profile-hook) (hook . info-dir))")
   ,("out","/gnu/store/vq1frsx6jkvk957mi2sx0rl629r31vi0-info-dir")
   ,("preferLocalBuild","1")])
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
Derive
([("out","/gnu/store/2ivmnbir288p7w7xyj1bb338h30q00ma-info-dir","","")]
 ,[("/gnu/store/32dcpfx9chyf1z3jhv41r7hx2a6vklw2-glibc-utf8-locales-2.28.drv",["out"])
   ,("/gnu/store/jbnidakwvhr84rp8p8icdg1lnczjvi6w-gzip-1.9.drv",["out"])
   ,("/gnu/store/n9zlvq692s12aarbrfppz7ayzggxfkqx-guile-2.2.4.drv",["out"])
   ,("/gnu/store/p6ml6z1d3y387y06mbcvpnf19ik2qywh-module-import-compiled.drv",["out"])
   ,("/gnu/store/x62102cgam20b3g8vfdvw06snvznx12k-texinfo-6.5.drv",["out"])]
 ,["/gnu/store/md2plii4g5sk66wg9cgwc964l3xwhrm9-hello-2.10","/gnu/store/n6gp00cayxm4lc5c17lrwhwx93fzg8hr-info-dir-builder","/gnu/store/p5q59xqmhwg60y2437fnny76nw7l6gbz-module-import"]
 ,"x86_64-linux","/gnu/store/r658y3cgpnf99nxjxqgjiaizx20ac4k0-guile-2.2.4/bin/guile",["--no-auto-compile","-L","/gnu/store/p5q59xqmhwg60y2437fnny76nw7l6gbz-module-import","-C","/gnu/store/qkqypgkam1fncl32l5qklplqh3a6k3fz-module-import-compiled","/gnu/store/n6gp00cayxm4lc5c17lrwhwx93fzg8hr-info-dir-builder"]
 ,[("allowSubstitutes","0")
   ,("guix properties","((type . profile-hook) (hook . info-dir))")
   ,("out","/gnu/store/2ivmnbir288p7w7xyj1bb338h30q00ma-info-dir")
   ,("preferLocalBuild","1")])
--8<---------------cut here---------------end--------------->8---

Note that they differ in the inclusion of /gnu/store/h0905d946s3xarcfakan8jnblcdqxs3a-hello-2.10.drv as
a derivation input.

I guess that the problem might be in “profile-derivation”, which defines
“inputs” like this:

    (define inputs
      (append (filter-map (lambda (drv)
                            (and (derivation? drv)
                                 (gexp-input drv)))
                          extras)
              (manifest-inputs manifest)))

I pk’d at the value returned by manifest-inputs and found this:

--8<---------------cut here---------------start------------->8---
$ guix package -p .guix-profile -i hello
The following package will be installed:
   hello	2.10	/gnu/store/md2plii4g5sk66wg9cgwc964l3xwhrm9-hello-2.10

;;; ((#<gexp-input #<package [email-masked] gnu/packages/base.scm:68 31e4d80>:out>))
1 package in profile
The following environment variable definitions may be needed:
   export PATH=".guix-profile/bin${PATH:+:}$PATH"

$ guix package -p .guix-profile -i coreutils
The following package will be installed:
   coreutils	8.30	/gnu/store/xzgfh8kdxilyymi1a8i97b1nci1iybhi-coreutils-8.30

;;; ((#<gexp-input #<package [email-masked] gnu/packages/base.scm:338 39a7000>:out> #<gexp-input "/gnu/store/md2plii4g5sk66wg9cgwc964l3xwhrm9-hello-2.10":out>))
2 packages in profile
The following environment variable definitions may be needed:
   export PATH=".guix-profile/bin${PATH:+:}$PATH"

$ guix package -p .guix-profile -r coreutils
The following package will be removed:
   coreutils	8.30	/gnu/store/xzgfh8kdxilyymi1a8i97b1nci1iybhi-coreutils-8.30

;;; ((#<gexp-input "/gnu/store/md2plii4g5sk66wg9cgwc964l3xwhrm9-hello-2.10":out>))
1 package in profile
The following environment variable definitions may be needed:
   export PATH=".guix-profile/bin${PATH:+:}$PATH"
--8<---------------cut here---------------end--------------->8---

Should manifest-inputs distinguish between a package entry and a file
entry and paper over the differences?

--
Ricardo