unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: 01/01: build-system/ruby: Use invoke.
       [not found] ` <20190328171805.4F33A20496@vcs0.savannah.gnu.org>
@ 2019-03-28 18:14   ` Christopher Baines
  2019-03-28 18:17     ` Efraim Flashner
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Baines @ 2019-03-28 18:14 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]


guix-commits@gnu.org writes:

> efraim pushed a commit to branch staging
> in repository guix.
>
> commit 0244952c11c0409597fce5c39dfbcafdfd2ea651
> Author: Efraim Flashner <efraim@flashner.co.il>
> Date:   Thu Mar 28 19:17:34 2019 +0200
>
>     build-system/ruby: Use invoke.
>
>     * guix/build/ruby-build-system.scm (install): Use invoke.
> ---
>  guix/build/ruby-build-system.scm | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
> index ba0de12..49400b2 100644
> --- a/guix/build/ruby-build-system.scm
> +++ b/guix/build/ruby-build-system.scm
> @@ -143,14 +143,13 @@ GEM-FLAGS are passed to the 'gem' invokation, if present."
>           (gem-dir (string-append vendor-dir "/gems/" gem-name)))
>      (setenv "GEM_VENDOR" vendor-dir)
>
> -    (or (zero?
> -         (apply system* "gem" "install" gem-file
> -                "--verbose"
> -                "--local" "--ignore-dependencies" "--vendor"
> -                ;; Executables should go into /bin, not
> -                ;; /lib/ruby/gems.
> -                "--bindir" (string-append out "/bin")
> -                gem-flags))
> +    (or (apply invoke "gem" "install" gem-file
> +               "--verbose"
> +               "--local" "--ignore-dependencies" "--vendor"
> +               ;; Executables should go into /bin, not
> +               ;; /lib/ruby/gems.
> +               "--bindir" (string-append out "/bin")
> +               gem-flags)
>          (begin
>            (let ((failed-output-dir (string-append (getcwd) "/out")))
>              (mkdir failed-output-dir)

Hey Efraim,

Given that invoke raises an exception, I doubt the custom error handling
code here will ever be executed.

I guess you could change it to catch the exception, but using system*
and looking at the exit code seems pretty reasonable to me. What do you
think?

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

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

* Re: 01/01: build-system/ruby: Use invoke.
  2019-03-28 18:14   ` 01/01: build-system/ruby: Use invoke Christopher Baines
@ 2019-03-28 18:17     ` Efraim Flashner
  2019-03-29  9:05       ` Christopher Baines
  0 siblings, 1 reply; 3+ messages in thread
From: Efraim Flashner @ 2019-03-28 18:17 UTC (permalink / raw)
  To: Christopher Baines; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2550 bytes --]

On Thu, Mar 28, 2019 at 06:14:48PM +0000, Christopher Baines wrote:
> 
> guix-commits@gnu.org writes:
> 
> > efraim pushed a commit to branch staging
> > in repository guix.
> >
> > commit 0244952c11c0409597fce5c39dfbcafdfd2ea651
> > Author: Efraim Flashner <efraim@flashner.co.il>
> > Date:   Thu Mar 28 19:17:34 2019 +0200
> >
> >     build-system/ruby: Use invoke.
> >
> >     * guix/build/ruby-build-system.scm (install): Use invoke.
> > ---
> >  guix/build/ruby-build-system.scm | 15 +++++++--------
> >  1 file changed, 7 insertions(+), 8 deletions(-)
> >
> > diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
> > index ba0de12..49400b2 100644
> > --- a/guix/build/ruby-build-system.scm
> > +++ b/guix/build/ruby-build-system.scm
> > @@ -143,14 +143,13 @@ GEM-FLAGS are passed to the 'gem' invokation, if present."
> >           (gem-dir (string-append vendor-dir "/gems/" gem-name)))
> >      (setenv "GEM_VENDOR" vendor-dir)
> >
> > -    (or (zero?
> > -         (apply system* "gem" "install" gem-file
> > -                "--verbose"
> > -                "--local" "--ignore-dependencies" "--vendor"
> > -                ;; Executables should go into /bin, not
> > -                ;; /lib/ruby/gems.
> > -                "--bindir" (string-append out "/bin")
> > -                gem-flags))
> > +    (or (apply invoke "gem" "install" gem-file
> > +               "--verbose"
> > +               "--local" "--ignore-dependencies" "--vendor"
> > +               ;; Executables should go into /bin, not
> > +               ;; /lib/ruby/gems.
> > +               "--bindir" (string-append out "/bin")
> > +               gem-flags)
> >          (begin
> >            (let ((failed-output-dir (string-append (getcwd) "/out")))
> >              (mkdir failed-output-dir)
> 
> Hey Efraim,
> 
> Given that invoke raises an exception, I doubt the custom error handling
> code here will ever be executed.
> 
> I guess you could change it to catch the exception, but using system*
> and looking at the exit code seems pretty reasonable to me. What do you
> think?
> 
> Chris

I was looking to get rid of some more of the 'zero? system*' code but I
think you're right. I'll go ahead and revert it and add a note about why
it should be left as-is.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: 01/01: build-system/ruby: Use invoke.
  2019-03-28 18:17     ` Efraim Flashner
@ 2019-03-29  9:05       ` Christopher Baines
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Baines @ 2019-03-29  9:05 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]


Efraim Flashner <efraim@flashner.co.il> writes:

> On Thu, Mar 28, 2019 at 06:14:48PM +0000, Christopher Baines wrote:
>>
>> guix-commits@gnu.org writes:
>>
>> > -    (or (zero?
>> > -         (apply system* "gem" "install" gem-file
>> > -                "--verbose"
>> > -                "--local" "--ignore-dependencies" "--vendor"
>> > -                ;; Executables should go into /bin, not
>> > -                ;; /lib/ruby/gems.
>> > -                "--bindir" (string-append out "/bin")
>> > -                gem-flags))
>> > +    (or (apply invoke "gem" "install" gem-file
>> > +               "--verbose"
>> > +               "--local" "--ignore-dependencies" "--vendor"
>> > +               ;; Executables should go into /bin, not
>> > +               ;; /lib/ruby/gems.
>> > +               "--bindir" (string-append out "/bin")
>> > +               gem-flags)
>> >          (begin
>> >            (let ((failed-output-dir (string-append (getcwd) "/out")))
>> >              (mkdir failed-output-dir)
>>
>> Hey Efraim,
>>
>> Given that invoke raises an exception, I doubt the custom error handling
>> code here will ever be executed.
>>
>> I guess you could change it to catch the exception, but using system*
>> and looking at the exit code seems pretty reasonable to me. What do you
>> think?
>>
>> Chris
>
> I was looking to get rid of some more of the 'zero? system*' code but I
> think you're right. I'll go ahead and revert it and add a note about why
> it should be left as-is.

Great, thanks Efraim :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

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

end of thread, other threads:[~2019-03-29  9:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20190328171804.26056.98950@vcs0.savannah.gnu.org>
     [not found] ` <20190328171805.4F33A20496@vcs0.savannah.gnu.org>
2019-03-28 18:14   ` 01/01: build-system/ruby: Use invoke Christopher Baines
2019-03-28 18:17     ` Efraim Flashner
2019-03-29  9:05       ` Christopher Baines

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).