guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add rubygems updater.


From: Ludovic Courtès
Subject: Re: [PATCH] Add rubygems updater.
Date: Fri, 08 Jan 2016 19:18:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Ben Woodcroft <address@hidden> skribis:

> On 04/01/16 00:06, Ludovic Courtès wrote:
>> Ben Woodcroft <address@hidden> skribis:
>>
>>> On 03/01/16 06:54, Ludovic Courtès wrote:
>>>> Ben Woodcroft <address@hidden> skribis:
>>>>
>>>>> On 02/01/16 04:17, Ludovic Courtès wrote:
>>>>>> Ben Woodcroft <address@hidden> skribis:
>> [...]
>>
>>>>>>> +     `(#:phases
>>>>>>> +       (modify-phases %standard-phases
>>>>>>> +         (replace 'check
>>>>>>> +           (lambda _
>>>>>>> +             (zero? (system* "ruby" "-Ilib" "-r" "ansi")))))))

[...]

>>>      (build-system ruby-build-system)
>>>      (arguments
>>>       `(#:import "ansi"
>>>         #:tests? #f)) ; tests require circular dependencies
>> The problem is that the “-Ilib” in the command above cannot be guessed,
>> can it?
> My understanding is that the the "-Ilib" is almost invariant because
> putting imported code in the lib subdirectory is a convention that
> most gems adhere to. In those cases where it fails, the 'check-import
> phase can be replaced or removed.

OK.  My point is that, since we’re talking about saving 4 lines of code,
we have to make sure that the default thing works for the vast majority
of Ruby packages.

> [..]
>>> We could even default this to the expected name of the library guessed
>>> from the name of the package when #:import is not given. However, this
>>> would unfortunately break packages that have been written outside of
>>> Guix, so I imagine you don't feel this is a good idea.
>> We could choose the package name as a default value, but often that’s
>> not going to work, notably because of the “ruby-” prefix.
>>
>> WDYT?
> Removing the "ruby-" from the package name sounds like a reasonable
> default, but won't work every time because some imports use
> underscores where some use dashes e.g. "minitest-pretty_diff".
>
> I'm keen to make sure you understand what I'm attempting to say
> though. By "default" I mean when the #:import flag is missing from
> arguments, "ruby -Ilib -r <guessed_package_name>" will be run. So if I
> have previously packaged a rubygem outside Guix and it is working
> fine, implementing the default might break my package making me
> unhappy. If you instead interpreted "default" as the guessed value
> that "guix import" generates, then that is less likely to end in
> unhappiness.

I was thinking of the #:import default value in ‘ruby-build-system’.

Using properties as Ricardo suggests woudln’t be any more concise than
using #:import "the-right-name".

Thanks,
Ludo’.



reply via email to

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