guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] utils: Allow wrap-program to be called multiple times.


From: Ludovic Courtès
Subject: Re: [PATCH] utils: Allow wrap-program to be called multiple times.
Date: Sat, 13 Sep 2014 14:20:44 +0200
User-agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux)

Eric Bavier <address@hidden> skribis:

> An updated patch is attached.  I changed some of the wording in the
> wrap-program docstring to bring it in a bit more in line with the new
> behavior.  Let me know if there should be any more adjustments there.  I
> also took the liberty of changing "/nix" to "/gnu".  ;)

Good.  :-)

>> It would be ideal if a test in tests/build-utils.scm made sure that
>> ‘wrap-program’ uses the right file names when called multiple times,
>> but I won’t object if the patch doesn’t have it.
>
> See the new test included in this patch.  Rather than checking for the
> file outputs of wrap-program, it checks for correct behavior of the
> wrapped program.  I believe this is more consistent with how
> wrap-program is used, and doesn't tie the test to the implementation.

Right, good idea.

> From 1b09db0a80d94d3a4c798cc6ee811891b34153e1 Mon Sep 17 00:00:00 2001
> From: Eric Bavier <address@hidden>
> Date: Sat, 13 Sep 2014 01:05:03 -0500
> Subject: [PATCH] utils: Allow wrap-program to be called multiple times.
>
> * guix/build/utils.scm (wrap-program): Multiple invocations of
>   wrap-program for the same file create successive wrappers.  Adjust
>   docstring.
> * tests/build-utils.scm: Test new wrap-program behavior.
>   (%store): New variable.

Looks good to me.  One last thing:

>  (define-module (test-build-utils)
> +  #:use-module (guix store)
> +  #:use-module (guix derivations)
>    #:use-module (guix build utils)
> -  #:use-module (srfi srfi-64))
> +  #:use-module (guix packages)
> +  #:use-module (guix build-system)
> +  #:use-module (guix build-system trivial)
> +  #:use-module (gnu packages)
> +  #:use-module (gnu packages bootstrap)
> +  #:use-module (srfi srfi-34)
> +  #:use-module (srfi srfi-64)
> +  #:use-module (rnrs io ports)
> +  #:use-module (ice-9 popen))
>  
> +(define %store
> +  (false-if-exception (open-connection)))
> +
> +(when %store
> +  ;; Make sure we build everything by ourselves.
> +  (set-build-options %store #:use-substitutes? #f))

These two forms can be replaced with:

  (define %store
    (open-connection-for-tests))

with the addition of #:use-module (guix tests).

OK to commit with this change.

Thank you!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]