GNU bug report logs - #48082
“guix environment -l” does not work with inferior packages

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Severity: important; Reported by: Ricardo Wurmus <rekado@HIDDEN>; dated Wed, 28 Apr 2021 16:20:02 UTC; Maintainer for guix is bug-guix@HIDDEN.
Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> Full text available.

Message received at submit <at>

Received: (at submit) by; 28 Apr 2021 16:19:49 +0000
From debbugs-submit-bounces <at> Wed Apr 28 12:19:49 2021
Received: from localhost ([]:53893
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1lbmuj-0001wx-Gr
	for submit <at>; Wed, 28 Apr 2021 12:19:49 -0400
Received: from ([]:33384)
 by with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1lbmuh-0001wp-D8
 for submit <at>; Wed, 28 Apr 2021 12:19:47 -0400
Received: from ([2001:470:142:3::10]:48954)
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rekado@HIDDEN>)
 id 1lbmuh-0002KE-0H
 for bug-guix@HIDDEN; Wed, 28 Apr 2021 12:19:47 -0400
Received: from ([]:21196)
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rekado@HIDDEN>)
 id 1lbmue-0000Aw-RQ
 for bug-guix@HIDDEN; Wed, 28 Apr 2021 12:19:46 -0400
ARC-Seal: i=1; a=rsa-sha256; t=1619626777; cv=none;; s=zohoarc; 
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;;
 s=zohoarc; t=1619626777;
ARC-Authentication-Results: i=1;;
 spf=pass  smtp.mailfrom=rekado@HIDDEN;
 dmarc=pass header.from=<rekado@HIDDEN> header.from=<rekado@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1619626777; 
 s=zoho;; i=rekado@HIDDEN;
Received: from localhost ( []) by with SMTPS id 1619626774569708.136225474451;
 Wed, 28 Apr 2021 09:19:34 -0700 (PDT)
User-agent: mu4e 1.4.15; emacs 27.2
From: Ricardo Wurmus <rekado@HIDDEN>
To: bug-guix@HIDDEN
Subject: =?utf-8?Q?=E2=80=9Cguix?= environment =?utf-8?Q?-l=E2=80=9D?= does
 not work with inferior packages
X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
Date: Wed, 28 Apr 2021 18:19:31 +0200
Message-ID: <878s52nzzg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-ZohoMailClient: External
Received-SPF: pass client-ip=; envelope-from=rekado@HIDDEN;
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -2.3 (--)

I wanted to use an environment file that contains a package=20
definition, and use it with inferiors.  Here is the full guix.scm:

--8<---------------cut here---------------start------------->8---
 (guix channels)
 (guix inferior)
 (guix build-system gnu)
 (guix packages)
 (guix licenses)
 (gnu packages)
 (ice-9 match))

(define channels
  (list (channel
         (name 'guix-bimsb)
         (url "")
         (name 'guix)
         (url "")
            "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A=20

(define (lookup name)
  (specification->package name))

(define (lookup-inferior name)
  (define inferior
    (inferior-for-channels channels))
  (match (lookup-inferior-packages inferior name)
    ((first . rest) first)
    (_ (error
        (format #false "Could not find package `~a'.~%" name)))))

(define (p name)
  (let* ((how (if (getenv "USE_GUIX_INFERIOR")
                  lookup-inferior lookup))
         (pkg (how name)))
    `(,name ,pkg)))

(define %version
  (symbol->string (with-input-from-file "VERSION" read)))

(define-public my-package
    (name "my-package")
    (version %version)
     (string-append (getcwd) "/my-package-" version ".tar.gz"))
    (build-system gnu-build-system)
     (map p (list "bwa"
     (map p (list "autoconf"
    (home-page "TODO")
    (synopsis "TODO")
    (description "TODO")
    (license gpl3+)))

--8<---------------cut here---------------end--------------->8---

The idea was that you would use the provided channels with

    USE_GUIX_INFERIOR=3Dt guix environment -l guix.scm

Unfortunately, this does not work, but there also is no error.  I=20
end up in an environment where none of the declared inputs are=20
available.  That=E2=80=99s because (guix scripts environments) has no=20
facilities to deal with packages that are of type=20


Acknowledgement sent to Ricardo Wurmus <rekado@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#48082; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 28 Apr 2021 21:00:01 UTC

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