Mailinglist Archive: opensuse-ruby (83 mails)

< Previous Next >
Re: [opensuse-ruby] non-rubyabi-specific gem version dependencies
On Wed, 21 Nov 2012 16:21:35 +0000
Adam Spiers <aspiers@xxxxxxxx> wrote:

rubygemsdeps.rb as provided by ruby-common-1.0 in d:l:r automatically
generates Provides: headers which, with one exception, contain the
rubyabi version:

# version without ruby version - asking for trouble
puts "rubygem(#{}) = #{spec.version}"
if rubyabi
puts "rubygem(#{rubyabi}:#{}) = #{spec.version}"
puts "rubygem(#{rubyabi}:#{}:#{versions[0]}) =
#{spec.version}" if versions.length > 1 puts
"rubygem(#{rubyabi}:#{}:#{versions[0]}.#{versions[1]}) =
#{spec.version}" if versions.length > 2 puts
= #{spec.version}" if versions.length > 3 end

For example:

rubygem(oa-openid) = 0.3.2
rubygem(1.9.1:oa-openid) = 0.3.2
rubygem(1.9.1:oa-openid:0) = 0.3.2
rubygem(1.9.1:oa-openid:0.3) = 0.3.2

However I have just encountered a situation where I think it would
make sense if it also Provided:

rubygem(oa-openid) = 0.3.2
rubygem(oa-openid:0) = 0.3.2
rubygem(oa-openid:0.3) = 0.3.2

The "asking for trouble" comment above cryptically suggests that this
is a bad idea, but I would like to know why.

The situation I have is as follows:

- d:l:r:e provides both rubygem-erubis-2_6 and rubygem-erubis-2_7

- systemsmanagement:chef/rubygem-chef requires erubis >= 0

- systemsmanagement:chef/rubygem-chef which requires rubygem-chef
is in 'unresolvable' state because the Build Service doesn't know
how to choose between the two erubis versions.

The clean solution would be to add a hint to rubygem-chef.spec:

Requires: rubygem(%{rb_ver}:erubis:2.7)

but 'osc build' gets confused by %{rb_ver}. I don't want to manually
specify the Ruby version in the .spec file, because there is no
specific dependency on Ruby 1.9 and I want the .spec file to build
against 1.8 too (e.g. if we linkpac to another project which builds
against Ruby 1.8 on SLES11).

Another possibility for the hint is

Requires: rubygem-erubis >= 2.7

but it would be better if it was possible to use the pessimistic ~>
version since that is less likely to break in the future:

Requires: rubygem(erubis:2.7)

So can someone please explain why having extra automatic Provides:
which omit the rubyabi would be asking for trouble?

Because you cannot mix gems from 1.8 and 1.9. So if you have one OBS
that builds againts 1.8 and another repo that builds againsts 1.9, then
there is potential problem ,that solver can choose mixture of gems,
that won't work.

BTW we are solving this issue also in OBS and we use in project config
prefer keyword -
eg we have
Prefer: rubygem-activesupport-3_2
Prefer: rubygem-activeresource-3_2
Prefer: rubygem-activerecord-3_2
Prefer: rubygem-railties-3_2

For gems that doesn't require specific version of rails or have less
strict requirement. ( I know that Rudi doesn't like it much, because it
means, all products in one project must respect it, or in whole distro,
so he prefer to solve it in package then in project config )



To unsubscribe, e-mail: opensuse-ruby+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-ruby+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups