GNU bug report logs - #30147
Simplify “scripts/guix”

Previous Next

Package: guix-patches;

Reported by: Mathieu Lirzin <mthl <at> gnu.org>

Date: Wed, 17 Jan 2018 19:26:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Bavier <ericbavier <at> centurylink.net>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 30147 <at> debbugs.gnu.org
Subject: [bug#30147] Simplify “scripts/guix”
Date: Mon, 22 Jan 2018 12:19:58 -0600
[Message part 1 (text/plain, inline)]
On Wed, 17 Jan 2018 20:25:14 +0100
Mathieu Lirzin <mthl <at> gnu.org> wrote:

> This moves the complexity of Autotools variable expansion outside of the
> application code.
> 
> * scripts/guix.in (config-lookup): Delete.
> (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables
> instead of calling ‘config-lookup’.
> * configure.ac: Don't use AC_CONFIG_FILES for ‘scripts/guix’.
> * Makefile.am (scripts/guix): New rule.
> (do_subst): New variable.
> (CLEANFILES, EXTRA_DIST): Adapt.

FWIW this is what my Joy compiler does for its entry script.  It works
well.

https://notabug.org/bavier/joy-in-the-morning.git

> +scripts/guix: scripts/guix.in Makefile
> +	$(AM_V_GEN)rm -f $@ $@-t \
> +	  && $(MKDIR_P) $(@D) \
> +	  && $(do_subst) <$(srcdir)/$@.in >$@-t \
> +	  && chmod a+x,a-w $@-t && mv -f $@-t $@

I think. since there's no state variables that needs to carry accross
commands, that this would read better without the line continuations and
appropriate use of $(AM_V_at).

While we're looking at it: I'm not certain, but I think Guix currently
work if one overrides the "prefix" variable when invoking 'make
install', which is a use-case suggested by the GNU Coding Standards
(Section 7.2.5).  I bring it up because adding '$(prefix)/bin/guix' to
the above rule might be a start.

> +;; Run Guix.
> +(let ((guix-main (module-ref (resolve-interface '(guix ui)) 'guix-main)))
> +  (bindtextdomain "guix" "@localedir@")
> +  (bindtextdomain "guix-packages" "@localedir@")
>    ;; XXX: It would be more convenient to change it to:
>    ;;   (exit (run-guix-main))
>    ;; but since the 'guix' command is not updated by 'guix pull', we cannot
>    ;; really do it now.
> -  (run-guix-main))
> +  (apply guix-main (command-line)))

If we're going to be patching scripts/guix.in, would now be the time to
add the '(exit ...)'?

Otherwise LGTM!

`~Eric
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 7 years and 161 days ago.

Previous Next


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