Hello,

I am trying to use an inferior as a package input and expecting to see
it when I use `guix build -D` or `guix shell -D`. When I use a regular
package it is included in the profile; when I use an inferior it is
silently excluded from the profile (no errors). Why isn't this working?

The currently active channel is very recent (`guix describe` is below),
and for this example I am attempting to use the immediate parent commit
for the inferior (to help eliminate other possible causes for the problem).

Testing with `guix build` (there is no output when using the inferior):

```console
$ guix build -D -f package.scm | grep hello
/gnu/store/ab584kfyc7pymc1cmdrkwzz3lwv86yf6-hello-2.12.3
```

Testing with `guix shell` (there is no output when using the inferior):

```console
$ guix shell -D -f package.scm -- \
      sh -c 'find -L $GUIX_ENVIRONMENT -name hello'
/gnu/store/5d24k2zfvcrdslpnfwywrw5kfw81vk7n-profile/bin/hello
```

Here is the `package.scm`:

```scm
(define-module (test-package)
  #:use-module (gnu packages base)
  #:use-module (guix build-system copy)
  #:use-module (guix channels)
  #:use-module (guix gexp)
  #:use-module (guix inferior)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (srfi srfi-1))

;; The next three defines are almost identical to the example at
;; <https://guix.gnu.org/manual/devel/en/html_node/Inferiors.html>.

(define channels
  (list (channel
         (name 'guix)
         (url "https://git.guix.gnu.org/guix.git";)
         (commit "129cf96915591b381ccd0a4c9b8813da2491eced")
         (introduction
          (make-channel-introduction
           "c91e27c60864faa229198f6f0caf620275c429a2"
           (openpgp-fingerprint
            "3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5"))))))

(define inferior
  (inferior-for-channels channels))

(define inferior-hello
  (first (lookup-inferior-packages inferior "hello")))

(define-public test
  (package
   (name "test")
   (version "")
   (source (plain-file "test" "test"))
   (build-system copy-build-system)
   (inputs
    (list
     ;; With this regular package, hello is included.
     ;;hello
     ;; With this inferior, hello is not included.
     inferior-hello))
   (synopsis "Test synopsis")
   (description "Test description.")
   (home-page "https://test.example.com";)
   (license license:gpl3)))

test
```

```console
$ guix describe --format=channels-sans-intro
(list (channel
       (name 'guix)
       (url "https://git.guix.gnu.org/guix.git";)
       (branch "master")
       (commit "c63b598686296493dbe6979727d51aabc5f85bf8")))
```

Thanks,
Owen

Reply via email to