From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 05:25:18 2019 Received: (at 37478) by debbugs.gnu.org; 5 Oct 2019 09:25:18 +0000 Received: from localhost ([127.0.0.1]:43757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGgJR-000796-NW for submit@debbugs.gnu.org; Sat, 05 Oct 2019 05:25:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGgJP-00078l-VM for 37478@debbugs.gnu.org; Sat, 05 Oct 2019 05:25:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iGgJJ-0005uC-Oi; Sat, 05 Oct 2019 05:25:10 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=53240 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iGgJI-0004j1-JX; Sat, 05 Oct 2019 05:25:09 -0400 From: Jan Nieuwenhuizen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#37478] [PATCH] Support canonical guix environment -l guix.scm. References: <871rw88u5s.fsf@gnu.org> <871rw4mro9.fsf@gnu.org> Date: Sat, 05 Oct 2019 11:25:06 +0200 In-Reply-To: <871rw4mro9.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 25 Sep 2019 15:28:06 +0200") Message-ID: <87k19jy26l.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 37478 Cc: 37478@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s writes: >> I often find myself typing `guix environment -l guix.scm' in the Guix >> source root and thought IWBN no make that "just work". WYDT? > > IWBN, but=E2=80=A6 > >> -(define-module (guix)) >> +(define-module (guix) >> + #:use-module (guix git-download) >> + #:use-module (guix gexp) >> + #:use-module (guix packages) >> + #:use-module (gnu packages package-management)) > > =E2=80=A6 the (guix) module is a public module, and it must not depend on > anything but the (guix =E2=80=A6) modules it imports. > > So unfortunately we can=E2=80=99t just do that. Hmm, and is there a difference between compile-time and run-time? I do not understand the rules well enough here... So I guess that something vaguely this (I really don't like the command-line "parsing" bit, just a thought experiment) --8<---------------cut here---------------start------------->8--- ;; Naive command-line parser: are we running from Guix source tree ;; guix build -f guix.scm ;; guix environment -l guix.scm ;; then return guix@git package (when (and (file-exists? "guix/gexp.scm") (let ((len (length (command-line)))) (and (> len 3) (let ((tail (list-tail (command-line) (- len 3)))) (or (equal? tail '("build" "-f" "guix.scm")) (equal? tail '("environment" "-l" "guix.scm"))))))) (let ((source-dir (dirname (current-filename)))) ((@ (guix packages) package) (inherit (@ (gnu packages package-management) guix)) (version "git") (source ((@ (guix gexp) local-file) source-dir #:recursive? #t #:select? ((@ (guix git-download) git-predicate) source-dir))= )))) --8<---------------cut here---------------end--------------->8--- is also not possible? It is also starts to look like a kludge and hard to get right...bah :) > Perhaps we could have a =E2=80=98.guix.scm=E2=80=99 file though, or > =E2=80=98build-aux/guix.scm=E2=80=99, something like that? Yes...I was hoping that we could offer/advise something standardized that all guix'ified upstreams could/would use. I think that I've seen `.guix.scm', but also a `guix.scm' that returns a manifest, so usage would be `guix environment -m guix.scm', and no way to build the package itself from git. Once Guix is blessed `the GNU System' (any day now ;-) we need to have a a thought-through proposal to amend standards.texi anyway. Greetings, janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com