[opensuse-packaging] Basic question on ruby packaging and build ruby-dependent packages (chef)
![](https://seccdn.libravatar.org/avatar/995333432565ad6e9ab0505464619fcb.jpg?s=120&d=mm&r=g)
Hi all, I am currently playing with chef, and I found that packages for chef 12 are only built for Tumbleweed. This seems to be due to the required ruby version being too old on Leap and SLE. So to get a newer chef I would have to get a newer ruby on these machines. d:l:r has newer ruby packages, so my question of principle is: Can one built a newer ruby version for, say, SLES11 (or simply linkpac the one in d:l:r) and use this version during building chef12 for SLES11? I guess there would be some prjconf voodoo necessary to get it building, but will these packages be working or is this a general no-go? I found a small note on "multiple ruby version" on the openSUSE ruby packaging page advising to use rvm or docker etc., thus I am asking. Thanks in advance, Johannes P.S.: As the ruby mailinglist seems to be no longer frequented, I am asking on packaging...;-)
![](https://seccdn.libravatar.org/avatar/65c6b3439f77fd121a63e42e7537a5d5.jpg?s=120&d=mm&r=g)
On 04/26/2017 12:03 PM, Johannes Kastl wrote:
Hi all,
I am currently playing with chef, and I found that packages for chef 12 are only built for Tumbleweed. This seems to be due to the required ruby version being too old on Leap and SLE.
So to get a newer chef I would have to get a newer ruby on these machines. d:l:r has newer ruby packages, so my question of principle is:
Can one built a newer ruby version for, say, SLES11 (or simply linkpac the one in d:l:r) and use this version during building chef12 for SLES11? I guess there would be some prjconf voodoo necessary to get it building, but will these packages be working or is this a general no-go?
I found a small note on "multiple ruby version" on the openSUSE ruby packaging page advising to use rvm or docker etc., thus I am asking.
I see ruby builds successfully for sle_11_sp4 on d:l:r. I would just add that path in your project meta, something like: <repository name="SLE_11_SP4"> <path project="devel:languages:ruby" repository="SLE_11_SP4"/> <arch>x86_64</arch> <arch>i586</arch> </repository> I don' t know why we don't already have it here: https://build.opensuse.org/project/meta/devel:languages:ruby:extensions I guess there must be a reason but I don't know which one it is, sorry. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/995333432565ad6e9ab0505464619fcb.jpg?s=120&d=mm&r=g)
On 26.04.17 21:04 Jordi Massaguer Pla wrote:
I see ruby builds successfully for sle_11_sp4 on d:l:r. I would just add that path in your project meta, something like:
I linkpac'd the ruby2.2 package from d:l:r into my home project, and also linkpac'd rubygem-gem2rpm. home:ojkastl_buildservice:Chef_12_SLES_11 This far I am unable to build the latter for anything else than the default ruby on the corresponding SLES release. I.e. although I have a package for ruby2.2 I only get one gem2rpm package for ruby2.1 on SLES12. This far I have not really tried to build chef, because I wanted to understand how to get gem2rpm to build. Maybe this would solve my (possible) misunderstanding on how to package ruby stuff via OBS. Is there any docu on how to bootstrap gem2rpm (I found the variable in the spec, but no experiments worked so far)? Or how to get started with ruby packaging and the whole prjconf voodoo? Thanks in advance. Kind Regards, Johannes
![](https://seccdn.libravatar.org/avatar/65c6b3439f77fd121a63e42e7537a5d5.jpg?s=120&d=mm&r=g)
On 04/27/2017 09:09 PM, Johannes Kastl wrote:
On 26.04.17 21:04 Jordi Massaguer Pla wrote:
I see ruby builds successfully for sle_11_sp4 on d:l:r. I would just add that path in your project meta, something like: I linkpac'd the ruby2.2 package from d:l:r into my home project, and also linkpac'd rubygem-gem2rpm. home:ojkastl_buildservice:Chef_12_SLES_11
This far I am unable to build the latter for anything else than the default ruby on the corresponding SLES release. I.e. although I have a package for ruby2.2 I only get one gem2rpm package for ruby2.1 on SLES12.
This far I have not really tried to build chef, because I wanted to understand how to get gem2rpm to build. Maybe this would solve my (possible) misunderstanding on how to package ruby stuff via OBS.
Is there any docu on how to bootstrap gem2rpm (I found the variable in the spec, but no experiments worked so far)? Or how to get started with ruby packaging and the whole prjconf voodoo?
You can find most of the documentation in here: https://en.opensuse.org/openSUSE:Packaging_Ruby Your question in particular, I think it can be resolved by redefining some macros in your project. See for example: https://build.opensuse.org/project/prjconf/devel:languages:ruby I don't remember building rubygems for a different ruby other than the one in the official repos, but I guess redefining some of the macros should do the trick. regards jordi -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/995333432565ad6e9ab0505464619fcb.jpg?s=120&d=mm&r=g)
Hi Jordi, On 28.04.17 15:48 Jordi Massaguer Pla wrote:
Is there any docu on how to bootstrap gem2rpm (I found the variable in the spec, but no experiments worked so far)? Or how to get started with ruby packaging and the whole prjconf voodoo?
You can find most of the documentation in here:
Jordi, no offence meant, I am grateful for your answer. But actually I was hoping for something more than the link to the number one google page when looking for "opensuse ruby packaging"...
Your question in particular, I think it can be resolved by redefining some macros in your project. See for example:
https://build.opensuse.org/project/prjconf/devel:languages:ruby
Again, no offence meant. If you would have looked into my project you would have found that I already copied over the prjconf from d:l:r and d:l:r:backports. And tried to adapt it. That was why I was talking about "prjconf voodoo"...
I don't remember building rubygems for a different ruby other than the one in the official repos, but I guess redefining some of the macros should do the trick.
Ahem. Allow me to ask my question again: Is there any documentation on how to do that? On how and why to define and use gem2rpm_bootstrap when building rubygem-gem2rpm? The Packaging_Ruby page does not even mention it... I think I understand roughly what the Macro parts (e.g. %ruby()) do. But everything I tried with gem2rpm_bootstrap did not work. Setting it in prjconf, setting it to bcond_with in the spec, ... Please don't get me wrong, I'll appreciate all hints and tipps and RTFM. But I feel kind of lost as I find no shred of information about all the variables set in prjconf and in the packages, and how they all relate to each other. Johannes
![](https://seccdn.libravatar.org/avatar/65c6b3439f77fd121a63e42e7537a5d5.jpg?s=120&d=mm&r=g)
On 04/29/2017 09:51 PM, Johannes Kastl wrote:
Hi Jordi,
On 28.04.17 15:48 Jordi Massaguer Pla wrote:
Is there any docu on how to bootstrap gem2rpm (I found the variable in the spec, but no experiments worked so far)? Or how to get started with ruby packaging and the whole prjconf voodoo? You can find most of the documentation in here:
https://en.opensuse.org/openSUSE:Packaging_Ruby Jordi, no offence meant, I am grateful for your answer. But actually I was hoping for something more than the link to the number one google page when looking for "opensuse ruby packaging"...
Your question in particular, I think it can be resolved by redefining some macros in your project. See for example:
https://build.opensuse.org/project/prjconf/devel:languages:ruby Again, no offence meant. If you would have looked into my project you would have found that I already copied over the prjconf from d:l:r and d:l:r:backports. And tried to adapt it. That was why I was talking about "prjconf voodoo"...
I don't remember building rubygems for a different ruby other than the one in the official repos, but I guess redefining some of the macros should do the trick. Ahem. Allow me to ask my question again: Is there any documentation on how to do that? On how and why to define and use gem2rpm_bootstrap when building rubygem-gem2rpm? The Packaging_Ruby page does not even mention it...
I think I understand roughly what the Macro parts (e.g. %ruby()) do. But everything I tried with gem2rpm_bootstrap did not work. Setting it in prjconf, setting it to bcond_with in the spec, ...
Please don't get me wrong, I'll appreciate all hints and tipps and RTFM. But I feel kind of lost as I find no shred of information about all the variables set in prjconf and in the packages, and how they all relate to each other.
Hi, I am not aware of any more documentation. I just took a quick look at your project configuration: First of all, ruby2.2 is not building, thus there is no ruby2.2 at all for sle11*. Second, in your project configuration you are setting the ruby version for sle11* with %if 0%{?suse_version} == 1110 That is fine with what you want to do, but do not expect that to be applied for sle12, meaning you won't be using ruby2.2 for sle12. You can find how to check for different suse versions in https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto I hope this helps jordi -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/995333432565ad6e9ab0505464619fcb.jpg?s=120&d=mm&r=g)
On 02.05.17 12:19 Jordi Massaguer Pla wrote:
Hi, I am not aware of any more documentation.
That is sad to hear.
I just took a quick look at your project configuration:
First of all, ruby2.2 is not building, thus there is no ruby2.2 at all for sle11*.
Huh? I see all builds succeeded for ruby2.2 and ruby2.4 for all of the SLE11 and SLES12 build targets. I also see rpms for ruby2.2 and ruby2.4 in the repos: http://download.opensuse.org/repositories/home:/ojkastl_buildservice:/Chef_1...
Second, in your project configuration you are setting the ruby version for sle11* with
%if 0%{?suse_version} == 1110
That is fine with what you want to do, but do not expect that to be applied for sle12, meaning you won't be using ruby2.2 for sle12.
I have a typo in the first stanza, this should read 1315 instead of 1320 to apply to SLES12. Thanks for the hint... Johannes
![](https://seccdn.libravatar.org/avatar/995333432565ad6e9ab0505464619fcb.jpg?s=120&d=mm&r=g)
On 02.05.17 21:11 Johannes Kastl wrote: [lots of stuff] I split out the SLE_12 build targets into another project: home:ojkastl_buildservice:Chef_12_SLES_12 There, ruby2.2 and ruby2.4 build alright, rubygem-gem2rpm builds fine for all three ruby version (2.1, 2.2, 2.4) and also chef is built fine for all three of them. (I'll have to figure out how to unpublish the ruby2.1-chef with publish filters, as chef needs 2.2 to work, but that is a story for another day). So I only have the four SLE_11 version left in home:ojkastl_buildservice:Chef_12_SLES_11. And there I see rubygem-gem2rpm failed builds for SP1 and SP2, while the build for SP3 and SP4 works. [ 22s] RPM build errors: [ 22s] File not found: /var/tmp/rubygem-gem2rpm-0.10.1-build/usr/share/doc/packages/ruby1.8-rubygem-gem2rpm [ 22s] File not found: /var/tmp/rubygem-gem2rpm-0.10.1-build/usr/bin/gem2rpm.ruby1.8-0.10.1 [ 22s] File not found: /var/tmp/rubygem-gem2rpm-0.10.1-build/usr/bin/gem2rpm.ruby1.8 [ 22s] File not found: /var/tmp/rubygem-gem2rpm-0.10.1-build/etc/alternatives/gem2rpm.ruby1.8 [ 22s] Installed (but unpackaged) file(s) found: [ 22s] /etc/alternatives/gem2rpm.ruby [ 22s] /usr/bin/gem2rpm.ruby [ 22s] /usr/bin/gem2rpm.ruby-0.10.1 [ 22s] /usr/share/doc/packages/ruby-rubygem-gem2rpm/AUTHORS [ 22s] /usr/share/doc/packages/ruby-rubygem-gem2rpm/LICENSE [ 22s] /usr/share/doc/packages/ruby-rubygem-gem2rpm/README [ 22s] /usr/share/doc/packages/ruby-rubygem-gem2rpm/gem2rpm.yml Can someone point me to the root cause for the differences? Why are there some files not found by rpm, as they have another name (ruby1.8 vs. ruby)? Unfortunately I get a completely different error message when building locally, I guess due to some OBS magic in the background. So I cannot fumble around locally. Clueless, Johannes
![](https://seccdn.libravatar.org/avatar/995333432565ad6e9ab0505464619fcb.jpg?s=120&d=mm&r=g)
Hi everyone, On 02.05.17 21:11 Johannes Kastl wrote: [documentation for packaging ruby and using the ruby macros] home:ojkastl_buildservice:Chef_12_SLES_11 I built ruby2.2 and ruby2.4 for SLES_11. I added rubygem-chef. I tweaked the spec file, so that the BuildRequires for ruby now reads BuildRequires: ruby2.2 >= 2.2.0 instead of BuildRequires: %{ruby >= 2.2.0} Now the build starts, but apparently the build is not aware of the multiple ruby versions that exist. It installs the gem twice, once for 1.8.7 and once for 2.2.0. But then it finds unpackaged files, namely the ones for 2.2.0. (There is a very long delay during the builds, locally as well as on OBS, where "gem install" is doing something using 100% CPU) Is ruby1.8 just to old to know how to handle this? => I doubt it, because building the rubygem-gem2rpm package works fine. Is there some difference in the spec file of rubygem-chef compared to rubygem-gem2rpm, that causes this? (Although both build fine on SLES_12 with ruby2.2. and ruby2.4). Or is this a problem with the ruby1.8 rpm macros, that set %ruby to "ruby" somehow (and thus are the cause for modifying the spec file)? Could someone shed some light on how to solve such issues? Thanks in advance. Johannes
participants (2)
-
Johannes Kastl
-
Jordi Massaguer Pla