[opensuse-ruby] how to make gem package depend on specific Ruby version?
Vagrant 1.5.4 depends on Ruby >= 2.0.0: https://github.com/mitchellh/vagrant/pull/3581 What's the correct way to ensure that rubygem-vagrant builds against ruby20 on openSUSE 12.3 and 13.1? On 12.3, by default (i.e. without any explicit dependencies on a Ruby version) it builds against 1.9 and then fails as soon as it encounters use of ** keyword parameters. If I use the dependencies suggested by gem2rpm via the .spec template: BuildRequires: ruby-macros >= 3 Requires: ruby >= 2.0.0 BuildRequires: ruby >= 2.0.0 (I guess the >= 2.0.0 might have come from my patch in the above pull request) then I get: $ osc build openSUSE_13.1 Building rubygem-vagrant.spec for openSUSE_13.1/x86_64 Getting buildinfo from server and store to /home/adam/SUSE/OBS/home/aspiers/branches/devel/languages/ruby/extensions/rubygem-vagrant/.osc/_buildinfo-openSUSE_13.1-x86_64.xml Getting buildconfig from server and store to /home/adam/SUSE/OBS/home/aspiers/branches/devel/languages/ruby/extensions/rubygem-vagrant/.osc/_buildconfig-openSUSE_13.1-x86_64 buildinfo is broken... it says: unresolvable: nothing provides ruby >= 2.0.0 and the same for 12.3. Weirdly, if I drop the patch-level from the dependencies, i.e. Requires: ruby >= 2.0 BuildRequires: ruby >= 2.0 then it builds fine. I'm guessing that this is because Ruby on vanilla 13.1 was packaged with version 2.0 rather than version 2.0.0. What was the reason for that decision? If instead I try building against d:l:r ... $ osc build devel_languages_ruby_openSUSE_12.3 or $ osc build devel_languages_ruby_openSUSE_13.1 then it builds against 2.1.0 and fails to install: $ sudo rpm -ihv /var/tmp/build-root/devel_languages_ruby_openSUSE_13.1/x86_64/home/abuild/rpmbuild/RPMS/x86_64/rubygem-vagrant-1.5.4-0.x86_64.rpm error: Failed dependencies: ruby >= 2.0.0 is needed by rubygem-vagrant-1.5.4-0.x86_64 ruby(abi) = 2.1.0 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:bundler) >= 1.5.2 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:childprocess:0.5) >= 0.5 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:erubis:2.7) >= 2.7 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:i18n:0.6) >= 0.6 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:listen:2.7) >= 2.7.1 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:log4r) < 1.1.11 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:log4r:1.1) >= 1.1.9 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:net-scp:1.1) >= 1.1 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:net-ssh) >= 2.6.6 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:net-ssh) < 2.8.0 is needed by rubygem-vagrant-1.5.4-0.x86_64 rubygem(2.1.0:rb-kqueue:0.2) >= 0.2 is needed by rubygem-vagrant-1.5.4-0.x86_64 $ sudo zypper in /var/tmp/build-root/devel_languages_ruby_openSUSE_13.1/x86_64/home/abuild/rpmbuild/RPMS/x86_64/rubygem-vagrant-1.5.4-0.x86_64.rpm Loading repository data... Reading installed packages... Resolving package dependencies... Problem: nothing provides rubygem(2.1.0:bundler) >= 1.5.2 needed by rubygem-vagrant-1.5.4-0.x86_64 Solution 1: do not install rubygem-vagrant-1.5.4-0.x86_64 Solution 2: break rubygem-vagrant-1.5.4-0.x86_64 by ignoring some of its dependencies Choose from above solutions by number or cancel [1/2/c] (c): Thanks! -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
* Adam Spiers <aspiers@suse.com> [Apr 30. 2014 18:18]:
Vagrant 1.5.4 depends on Ruby >= 2.0.0:
https://github.com/mitchellh/vagrant/pull/3581
What's the correct way to ensure that rubygem-vagrant builds against ruby20 on openSUSE 12.3 and 13.1?
Why would you want it to build against ruby == 2.0 if the requirement is for >= 2.0.0 ?
On 12.3, by default (i.e. without any explicit dependencies on a Ruby version) it builds against 1.9 and then fails as soon as it encounters use of ** keyword parameters.
If I use the dependencies suggested by gem2rpm via the .spec template:
BuildRequires: ruby-macros >= 3 Requires: ruby >= 2.0.0 BuildRequires: ruby >= 2.0.0
(I guess the >= 2.0.0 might have come from my patch in the above pull request)
then I get:
$ osc build openSUSE_13.1 Building rubygem-vagrant.spec for openSUSE_13.1/x86_64 Getting buildinfo from server and store to /home/adam/SUSE/OBS/home/aspiers/branches/devel/languages/ruby/extensions/rubygem-vagrant/.osc/_buildinfo-openSUSE_13.1-x86_64.xml Getting buildconfig from server and store to /home/adam/SUSE/OBS/home/aspiers/branches/devel/languages/ruby/extensions/rubygem-vagrant/.osc/_buildconfig-openSUSE_13.1-x86_64 buildinfo is broken... it says: unresolvable: nothing provides ruby >= 2.0.0
That's how RPM version comparison works. 2.0.0 is greater than 2.0 iirc. Looking at openSUSE:13.1, I see ruby (providing ruby = 2.0-5.1.2, requiring ruby20 >= 2.0.0.p247) ruby19 (not providing ruby, but ruby(abi) = 1.9.1) ruby20 (not providing ruby, but ruby(abi) = 2.0.0) Try to change your package's requirements to Requires: ruby(abi) >= 2.0.0 BuildRequires: ruby(abi) >= 2.0.0
and the same for 12.3.
Weirdly, if I drop the patch-level from the dependencies, i.e.
Requires: ruby >= 2.0 BuildRequires: ruby >= 2.0
then it builds fine. I'm guessing that this is because Ruby on vanilla 13.1 was packaged with version 2.0 rather than version 2.0.0. What was the reason for that decision?
If instead I try building against d:l:r ...
$ osc build devel_languages_ruby_openSUSE_12.3
or
$ osc build devel_languages_ruby_openSUSE_13.1
then it builds against 2.1.0 and fails to install:
To be expected if you don't add devel_languages_ruby_openSUSE_13.1 _and_ http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions... to zypper. But doing so will install ruby 2.1 on your openSUSE 13.1 system. Klaus -- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Klaus Kaempf (kkaempf@suse.de) wrote:
* Adam Spiers <aspiers@suse.com> [Apr 30. 2014 18:18]:
Vagrant 1.5.4 depends on Ruby >= 2.0.0:
https://github.com/mitchellh/vagrant/pull/3581
What's the correct way to ensure that rubygem-vagrant builds against ruby20 on openSUSE 12.3 and 13.1?
Why would you want it to build against ruby == 2.0 if the requirement is for >= 2.0.0 ?
Because ruby20 is the only way to get 2.0.0 on 12.3. OK, on 13.1 I'd prefer it to work with the default Ruby, but if it works with ruby20 also or instead then that's fine too. To put it simply, I want one rubygem-vagrant which works on both 12.3 and 13.1. But I think, with your hint below, I now have this working: https://build.opensuse.org/package/show/home:aspiers:branches:devel:language... So as long as I have the devel_languages_ruby_openSUSE_x.y repo added via zypper, it should install correctly for x.y.
On 12.3, by default (i.e. without any explicit dependencies on a Ruby version) it builds against 1.9 and then fails as soon as it encounters use of ** keyword parameters.
If I use the dependencies suggested by gem2rpm via the .spec template:
BuildRequires: ruby-macros >= 3 Requires: ruby >= 2.0.0 BuildRequires: ruby >= 2.0.0
(I guess the >= 2.0.0 might have come from my patch in the above pull request)
then I get:
$ osc build openSUSE_13.1 Building rubygem-vagrant.spec for openSUSE_13.1/x86_64 Getting buildinfo from server and store to /home/adam/SUSE/OBS/home/aspiers/branches/devel/languages/ruby/extensions/rubygem-vagrant/.osc/_buildinfo-openSUSE_13.1-x86_64.xml Getting buildconfig from server and store to /home/adam/SUSE/OBS/home/aspiers/branches/devel/languages/ruby/extensions/rubygem-vagrant/.osc/_buildconfig-openSUSE_13.1-x86_64 buildinfo is broken... it says: unresolvable: nothing provides ruby >= 2.0.0
That's how RPM version comparison works. 2.0.0 is greater than 2.0 iirc.
Yeah :-/
Looking at openSUSE:13.1, I see
ruby (providing ruby = 2.0-5.1.2, requiring ruby20 >= 2.0.0.p247) ruby19 (not providing ruby, but ruby(abi) = 1.9.1) ruby20 (not providing ruby, but ruby(abi) = 2.0.0)
Try to change your package's requirements to
Requires: ruby(abi) >= 2.0.0 BuildRequires: ruby(abi) >= 2.0.0
I already tried that. IIRC it created other problems, but I can't remember what :-/
and the same for 12.3.
Weirdly, if I drop the patch-level from the dependencies, i.e.
Requires: ruby >= 2.0 BuildRequires: ruby >= 2.0
then it builds fine. I'm guessing that this is because Ruby on vanilla 13.1 was packaged with version 2.0 rather than version 2.0.0. What was the reason for that decision?
Anyone want to comment on this?
If instead I try building against d:l:r ...
$ osc build devel_languages_ruby_openSUSE_12.3
or
$ osc build devel_languages_ruby_openSUSE_13.1
then it builds against 2.1.0 and fails to install:
To be expected if you don't add devel_languages_ruby_openSUSE_13.1 _and_ http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions... to zypper.
Thanks - I think that last repo was indeed the missing piece.
But doing so will install ruby 2.1 on your openSUSE 13.1 system.
Right :) Thanks for the reply! -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
participants (2)
-
Adam Spiers
-
Klaus Kaempf