Hello, all:
During reviews (and also on my package) I met with some troubles when packaging Ruby Gems containing extension libraries written in C.
Would you look at my proposition written in the following URL? https://fedoraproject.org/wiki/User:Mtasaka/PackagingDrafts/RubyGem_with_C_c...
Any comments will be appreciated. Thank you in advance.
Note: I will leave from my computer soon and I will read and reply to comments once I get back from a rest.
Regards, Mamoru
On Sat, 2008-11-01 at 02:57 +0900, Mamoru Tasaka wrote:
Hello, all:
During reviews (and also on my package) I met with some troubles when packaging Ruby Gems containing extension libraries written in C.
Would you look at my proposition written in the following URL? https://fedoraproject.org/wiki/User:Mtasaka/PackagingDrafts/RubyGem_with_C_c...
Any comments will be appreciated. Thank you in advance.
First off, I think this is a very good step in the right direction. A couple of questions:
* Is the example snippet from a spec file meant only for gems with extension libraries or for all gems ? * Do you have a full example somewhere that follows your recommendations ? * As for missing files in ext/, I would be happy either way; since the C sources for extensions are usually very small, it would be ok to install them as part of the rubygem- package. OTOH, I don't see much danger in leaving them out from the rubygem. The main point of building a rubygem- RPM is so that users can satisfy rubygem-level dependencies for other rubygems with the RPM-installed rubygem, i.e. if gem A is packaged as an rpm, and a user wants to 'gem install B' where B has a gem-level dep on A, that should still work. Users shouldn't expect that a 'gem uninstall A' would work - it would confuse RPM, anyway.
David
Thank you for reply.
David Lutterkort wrote, at 11/04/2008 04:04 AM +9:00:
First off, I think this is a very good step in the right direction. A couple of questions:
* Is the example snippet from a spec file meant only for gems with extension libraries or for all gems ?
- Currently only with extention libraries. If rpm created from gem file is completely noarch, gem file can be installed under %{buildroot}%{gemdir} directly. (However, of course, there is no problem if we first install gem files under %{_builddir} first even if it is noarch)
* Do you have a full example somewhere that follows your recommendations ?
- I tried to rewrite spec files in Fedora related to rubygem, which I put under http://mtasaka.fedorapeople.org/rubygem_specs/ The easiest example is http://mtasaka.fedorapeople.org/rubygem_specs/rubygem-fastthread.spec
* As for missing files in ext/, I would be happy either way; since the C sources for extensions are usually very small, it would be ok to install them as part of the rubygem- package. OTOH, I don't see much danger in leaving them out from the rubygem. The main point of building a rubygem- RPM is so that users can satisfy rubygem-level dependencies for other rubygems with the RPM-installed rubygem, i.e. if gem A is packaged as an rpm, and a user wants to 'gem install B' where B has a gem-level dep on A, that should still work. Users shouldn't expect that a 'gem uninstall A' would work - it would confuse RPM, anyway.
- Thanks. I added some guideline proposal about files under ext/ C codes with reflecting your commends.
David
Regards, Mamoru
On Tue, 2008-11-04 at 19:46 +0900, Mamoru Tasaka wrote:
Thank you for reply.
David Lutterkort wrote, at 11/04/2008 04:04 AM +9:00:
First off, I think this is a very good step in the right direction. A couple of questions:
* Is the example snippet from a spec file meant only for gems with extension libraries or for all gems ?
- Currently only with extention libraries. If rpm created from gem file is completely noarch, gem file can be installed under %{buildroot}%{gemdir} directly. (However, of course, there is no problem if we first install gem files under %{_builddir} first even if it is noarch)
Agreed. Ultimately, it would be nice to support more of this with some stock macros; but that has nothing to do with your proposal.
* Do you have a full example somewhere that follows your recommendations ?
- I tried to rewrite spec files in Fedora related to rubygem, which I put under http://mtasaka.fedorapeople.org/rubygem_specs/ The easiest example is http://mtasaka.fedorapeople.org/rubygem_specs/rubygem-fastthread.spec
Nice, just tried it and it does produce a -debuginfo, complete with sources :)
* As for missing files in ext/, I would be happy either way; since the C sources for extensions are usually very small, it would be ok to install them as part of the rubygem- package. OTOH, I don't see much danger in leaving them out from the rubygem. The main point of building a rubygem- RPM is so that users can satisfy rubygem-level dependencies for other rubygems with the RPM-installed rubygem, i.e. if gem A is packaged as an rpm, and a user wants to 'gem install B' where B has a gem-level dep on A, that should still work. Users shouldn't expect that a 'gem uninstall A' would work - it would confuse RPM, anyway.
- Thanks. I added some guideline proposal about files under ext/ C codes with reflecting your commends.
The proposal looks really good - +1 from me.
David
Thank you again.
David Lutterkort wrote, at 11/06/2008 12:09 PM +9:00:
On Tue, 2008-11-04 at 19:46 +0900, Mamoru Tasaka wrote:
David Lutterkort wrote, at 11/04/2008 04:04 AM +9:00:
* Is the example snippet from a spec file meant only for gems with extension libraries or for all gems ?
- Currently only with extention libraries. If rpm created from gem file is completely noarch, gem file can be installed under %{buildroot}%{gemdir} directly. (However, of course, there is no problem if we first install gem files under %{_builddir} first even if it is noarch)
Agreed. Ultimately, it would be nice to support more of this with some stock macros; but that has nothing to do with your proposal.
Currently I have no idea about what macros can be defined here, however for now I think we can think of this later.
The proposal looks really good - +1 from me.
Thank you!
One more issue: I found that even for non-Gem packages many packages use "extconf.rb" to create C library, and in such case "export CONFIGURE_ARGS=..." method can also be applied.
So I wrote another proposal to use this method even for non-Gem ruby packages (on the last of : https://fedoraproject.org/wiki/User:Mtasaka/PackagingDrafts/RubyGem_with_C_c... ) I would want to know how you would think about this.
Regards, Mamoru
On Thu, 2008-11-06 at 17:30 +0900, Mamoru Tasaka wrote:
One more issue: I found that even for non-Gem packages many packages use "extconf.rb" to create C library, and in such case "export CONFIGURE_ARGS=..." method can also be applied.
So I wrote another proposal to use this method even for non-Gem ruby packages (on the last of : https://fedoraproject.org/wiki/User:Mtasaka/PackagingDrafts/RubyGem_with_C_c... ) I would want to know how you would think about this.
Yes, that makes perfect sense, and should be required for gem and non-gem packages in the same way.
David
David Lutterkort wrote, at 11/07/2008 01:27 AM +9:00:
On Thu, 2008-11-06 at 17:30 +0900, Mamoru Tasaka wrote:
One more issue: I found that even for non-Gem packages many packages use "extconf.rb" to create C library, and in such case "export CONFIGURE_ARGS=..." method can also be applied.
So I wrote another proposal to use this method even for non-Gem ruby packages (on the last of : https://fedoraproject.org/wiki/User:Mtasaka/PackagingDrafts/RubyGem_with_C_c... ) I would want to know how you would think about this.
Yes, that makes perfect sense, and should be required for gem and non-gem packages in the same way.
David
Thank you. Again I updated my proposition wiki with reflecting your comment. I think the current contents can be included in the formal packaging guidelines. (The URL is still: https://fedoraproject.org/wiki/User:Mtasaka/PackagingDrafts/RubyGem_with_C_c... )
Regards, Mamoru
Mamoru Tasaka wrote, at 11/07/2008 02:26 AM +9:00:
David Lutterkort wrote, at 11/07/2008 01:27 AM +9:00:
Yes, that makes perfect sense, and should be required for gem and non-gem packages in the same way.
David
Thank you. Again I updated my proposition wiki with reflecting your comment. I think the current contents can be included in the formal packaging guidelines. (The URL is still: https://fedoraproject.org/wiki/User:Mtasaka/PackagingDrafts/RubyGem_with_C_c... )
I moved the wiki to https://fedoraproject.org/wiki/PackagingDrafts/RubyGem_with_C_code (old URL will be redirected) and added this to https://fedoraproject.org/wiki/PackagingDrafts/DraftsTodo
Regards, Mamoru
On Tue, 2008-11-11 at 02:08 +0900, Mamoru Tasaka wrote:
Mamoru Tasaka wrote, at 11/07/2008 02:26 AM +9:00:
David Lutterkort wrote, at 11/07/2008 01:27 AM +9:00:
Yes, that makes perfect sense, and should be required for gem and non-gem packages in the same way.
David
Thank you. Again I updated my proposition wiki with reflecting your comment. I think the current contents can be included in the formal packaging guidelines. (The URL is still: https://fedoraproject.org/wiki/User:Mtasaka/PackagingDrafts/RubyGem_with_C_c... )
I moved the wiki to https://fedoraproject.org/wiki/PackagingDrafts/RubyGem_with_C_code (old URL will be redirected) and added this to https://fedoraproject.org/wiki/PackagingDrafts/DraftsTodo
Mamoru,
The example in your draft does not seem to match your proposal. Can you provide an example to illustrate the new case for "Ruby Gem with extension libraries written in C"?
Thanks,
~spot
Hello.
First of all, thank you for discussing my propositon and giving me feedback.
Then;
Tom "spot" Callaway wrote, at 11/19/2008 02:23 AM +9:00:
On Tue, 2008-11-11 at 02:08 +0900, Mamoru Tasaka wrote:
I moved the wiki to https://fedoraproject.org/wiki/PackagingDrafts/RubyGem_with_C_code (old URL will be redirected) and added this to https://fedoraproject.org/wiki/PackagingDrafts/DraftsTodo
Mamoru,
The example in your draft does not seem to match your proposal. Can you provide an example to illustrate the new case for "Ruby Gem with extension libraries written in C"?
Thanks,
~spot
It seems that the macro %{_builddir}/%{buildsubdir} seems confusing because this macros is not used in the examples. Actually what I meant here is - At prep stage the proper directory must be created under %_builddir to get C code compiled under the directory, not under %buildroot
When %setup -q -c -T is used %_builddir/%name-%version is created (on my usual usage %_builddir is ~/rpmbuild/BUILD) and %buildsubdir is then defined as %name-%version. - Then Gem file must be installed there at %build stage, not under %buildroot.
So as it seems that writing "%setup -q -c -T must be called" is more easy to grasp, I wrote a revised proposition (with the original one undeleted) [1]
And I wrote one easiest example [2] I appreciate any feedback for this one.
[1] https://fedoraproject.org/wiki/PackagingDrafts/RubyGem_with_C_code [2] http://mtasaka.fedorapeople.org/rubygem_specs/rubygem-fastthread.spec
Thanks, Mamoru
packaging@lists.fedoraproject.org