guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Gemspecs / Add ruby-ruby-engine.


From: Ricardo Wurmus
Subject: Re: [PATCH] Gemspecs / Add ruby-ruby-engine.
Date: Tue, 5 Jan 2016 15:47:28 +0100

Ben Woodcroft <address@hidden> writes:

> On 05/01/16 21:36, Ricardo Wurmus wrote:
>> Ben Woodcroft <address@hidden> writes:
> [..]
>>> While I managed to install 1.0.1, I wasn't sure how best to remove the
>>> bundled 1.0.0 .gem file. The issue is that when the source is a .gem
>>> file (ie most of the time), the gemspec is taken from the downloaded
>>> .gem file directly, and in the same phase the .gem file is built. So as
>>> a packager there is no way to make changes to the gemspec without
>>> replacing the entire build phase. There's a number of rubygems that are
>>> contaminated with junk so it would be great for there to be a simple way
>>> to modify the gemspec before "gem build" is run.
>> The “build” phase in the “ruby-build-system” is responsible for
>> rebuilding the gem from source.  The “unpack” phase unpacks the gem
>> archive.  This should allow you to modify the gemspec in a phase
>> injected between “unpack” and “build”, no?
>
> That's not what I'm getting from reading of the code, no. The build 
> phase of the ruby build system unpacks the gemspec from the source .gem 
> file and then immediately uses it to build the gem.

Oh, you are right!  The gemspec file is deleted if it exists and then
extracted from the source gem.  Sorry, I should have looked at the code
more carefully.

I think extracting the gemspec should be done during the “unpack” phase,
or as you suggest during an additional “gemspec” phase.

But how does this relate to snippets?  In other build systems snippets
cause the source archive to be unpacked, modified, and then repacked.
If we split unpacking and gemspec extraction we’d have to make sure that
this also works when snippets are involved, i.e. snippets should see the
extracted gemspec (as the original one is discarded by the build system
anyway).

> It is fine to remove the offending files but the gemspec must be 
> modified accordingly otherwise "gem build" fails.

You are right.

>>> +    (arguments
>>> +     `(#:phases
>>> +       (modify-phases %standard-phases
>>> +         (add-before 'check 'clean-up
>> Is it possible to move this after “unpack” instead?  It’s just a
>> side-effect of the “check” phase that the gem is installed, so I think
>> it’s best to move this phase right after “unpack” (because we don’t need
>> any of this stuff for any of the phases until “check”).
>>
>> Maybe you can also add a FIXME comment (as in “ruby-pygmentize”) stating
>> that this really should be done in a snippet.
> Unfortunately we cannot move it since the build phase will then fail for 
> the above reason.

True.

>> Please keep this on one line.
>> Otherwise it’s fine.  Thank you!
> No problem. I'm happy to send a follow up patch if you like, but would 
> prefer to resolve the larger problem first.

Agreed.  I’d be happy if someone else could chime in to give an opinion
on whether to add a new phase or merge gemspec extraction with “unpack”.

~~ Ricardo



reply via email to

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