all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: 02/02: build-system/r: Use invoke.
       [not found] ` <20180531112430.4657B20456@vcs0.savannah.gnu.org>
@ 2018-05-31 18:26   ` Mark H Weaver
  2018-06-02  0:52     ` Mark H Weaver
  2018-06-06 21:29     ` Ricardo Wurmus
  0 siblings, 2 replies; 3+ messages in thread
From: Mark H Weaver @ 2018-05-31 18:26 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hi Ricardo,

rekado@elephly.net (Ricardo Wurmus) writes:

> rekado pushed a commit to branch core-updates
> in repository guix.
>
> commit babeea3f9f46c1f1f812e590f46283e91684f327
> Author: Ricardo Wurmus <rekado@elephly.net>
> Date:   Thu May 31 09:16:01 2018 +0200
>
>     build-system/r: Use invoke.
>     
>     * guix/build/r-build-system.scm (invoke-r): Use invoke.
>     (pipe-to-r): Raise invoke-error on non-zero return value.
>     (check): Unconditionally return #t.

Thanks for this!  However:

>  (define (pipe-to-r command params)
>    (let ((port (apply open-pipe* OPEN_WRITE "R" params)))
>      (display command port)
> -    (zero? (status:exit-val (close-pipe port)))))
> +    (let ((code (status:exit-val (close-pipe port))))
> +      (unless (zero? code)
> +        (raise (condition ((@@ (guix build utils) &invoke-error)
> +                           (program "R")
> +                           (arguments (string-append params " " command))
> +                           (exit-status (status:exit-val code))
> +                           (term-signal (status:term-sig code))
> +                           (stop-signal (status:stop-sig code)))))))))

The 'arguments' field should be a list, not a string.

      Thanks!
        Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 02/02: build-system/r: Use invoke.
  2018-05-31 18:26   ` 02/02: build-system/r: Use invoke Mark H Weaver
@ 2018-06-02  0:52     ` Mark H Weaver
  2018-06-06 21:29     ` Ricardo Wurmus
  1 sibling, 0 replies; 3+ messages in thread
From: Mark H Weaver @ 2018-06-02  0:52 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> writes:

> rekado@elephly.net (Ricardo Wurmus) writes:
>
>>  (define (pipe-to-r command params)
>>    (let ((port (apply open-pipe* OPEN_WRITE "R" params)))
>>      (display command port)
>> -    (zero? (status:exit-val (close-pipe port)))))
>> +    (let ((code (status:exit-val (close-pipe port))))
>> +      (unless (zero? code)
>> +        (raise (condition ((@@ (guix build utils) &invoke-error)
>> +                           (program "R")
>> +                           (arguments (string-append params " " command))
>> +                           (exit-status (status:exit-val code))
>> +                           (term-signal (status:term-sig code))
>> +                           (stop-signal (status:stop-sig code)))))))))
>
> The 'arguments' field should be a list, not a string.

Actually, the more serious problem is that 'params' is itself a list, so
when you apply 'string-append' to it, that will raise an exception, but
not the exception that you wanted.

      Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 02/02: build-system/r: Use invoke.
  2018-05-31 18:26   ` 02/02: build-system/r: Use invoke Mark H Weaver
  2018-06-02  0:52     ` Mark H Weaver
@ 2018-06-06 21:29     ` Ricardo Wurmus
  1 sibling, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2018-06-06 21:29 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel


Hi Mark,

>> commit babeea3f9f46c1f1f812e590f46283e91684f327
>> Author: Ricardo Wurmus <rekado@elephly.net>
>> Date:   Thu May 31 09:16:01 2018 +0200
>>
>>     build-system/r: Use invoke.
>>
>>     * guix/build/r-build-system.scm (invoke-r): Use invoke.
>>     (pipe-to-r): Raise invoke-error on non-zero return value.
>>     (check): Unconditionally return #t.
>
> Thanks for this!  However: […]
> The 'arguments' field should be a list, not a string.

Thanks for pointing this out!  I’ll push a fix to the new core-updates
branch shortly.

--
Ricardo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-06 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180531112428.24457.48983@vcs0.savannah.gnu.org>
     [not found] ` <20180531112430.4657B20456@vcs0.savannah.gnu.org>
2018-05-31 18:26   ` 02/02: build-system/r: Use invoke Mark H Weaver
2018-06-02  0:52     ` Mark H Weaver
2018-06-06 21:29     ` Ricardo Wurmus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.