From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:34619) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ieXWB-000732-G2 for guix-patches@gnu.org; Mon, 09 Dec 2019 23:53:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ieXWA-00010K-9P for guix-patches@gnu.org; Mon, 09 Dec 2019 23:53:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48741) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ieXWA-00010B-5t for guix-patches@gnu.org; Mon, 09 Dec 2019 23:53:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ieXWA-0006wP-5O for guix-patches@gnu.org; Mon, 09 Dec 2019 23:53:02 -0500 Subject: [bug#37478] [PATCH] Support canonical guix environment -l guix.scm. Resent-Message-ID: From: Brett Gilio References: <871rw88u5s.fsf@gnu.org> <871rw4mro9.fsf@gnu.org> <87k19jy26l.fsf@gnu.org> Date: Mon, 09 Dec 2019 22:52:35 -0600 In-Reply-To: <87k19jy26l.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Sat, 05 Oct 2019 11:25:06 +0200") Message-ID: <874ky8n5nw.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Jan Nieuwenhuizen Cc: 37478@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Jan Nieuwenhuizen writes: > 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) > > ;; 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= )))))) > > 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 Hey all, where are we standing with this currently? I think there has been some recent revisions with how we are using the `-l` flag, and want to see if this still needs to some work. I am happy to offer my help. --=20 Brett M. Gilio Homepage -- https://scm.pw/ GNU Guix -- https://guix.gnu.org/