GNU bug report logs -
#37478
[PATCH] Support canonical guix environment -l guix.scm.
Previous Next
Full log
Message #11 received at 37478 <at> debbugs.gnu.org (full text, mbox):
Ludovic Courtès 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…
>
>> -(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))
>
> … the (guix) module is a public module, and it must not depend on
> anything but the (guix …) modules it imports.
>
> So unfortunately we can’t 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 <at> 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 ‘.guix.scm’ file though, or
> ‘build-aux/guix.scm’, 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
--
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
This bug report was last modified 5 years and 186 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.