Wrong resolution when specifying only lower version for a bundle

1 view
Skip to first unread message

Niklaus Giger

unread,
Feb 11, 2011, 4:50:33 PM2/11/11
to build...@googlegroups.com

Hi

I did run into the following problem, as there are quite a few Eclipse plugins around where only the lower version is specified. E.g. in the MANIFEST.MF I find:

org.eclipse.core.runtime;bundle-version="3.6.0"

As we moved to 3.6.1 this does not lead to a "Could not resolve" when calling osgi:resolve:dependencies

If I change it to match all version lower than 999 it works, e.g. my MANIFEST.MF contains now

org.eclipse.core.runtime;bundle-version="[3.6.0,999.0.0]"

The jira does not work at the moment. Unable to report a bug therefore.

I am unable to create a RSpec for this problem as I cannot install/run rake spec in my buildr4osgi checkout.

Best regards

--

Niklaus Giger

Wieshoschet 6

CH-8753 Mollis

+41 (0)55 612 20 54 P

+41 (0)55 618 64 68 G

+41 (0)77 473 02 59 Mobil

Antoine Toulme

unread,
Feb 13, 2011, 4:11:23 PM2/13/11
to build...@googlegroups.com
Hi Niklaus,

thanks for using buildr4osgi.

Sorry to hear you ran into trouble. If you feel able, please feel free to try to fix the problem.
As for the specs, their dependency over Buildr's broke them for now.

Antoine

Niklaus Giger

unread,
Feb 18, 2011, 2:22:12 AM2/18/11
to build...@googlegroups.com, Antoine Toulme

Hi Antoine

Thanks for helping me out. For the moment it was a lot faster to write a small script to change the versions in the MANIFEST-MF. My Jenkins for elexis begins to work (see http://ngiger.dyndns.org/jenkins/job/Elexis-Buildr/). About 80 of 105 projects are more or less okay.

I was able to figure out with a very small example (see attachment), that the resolution works okay if I

> define 'org.eclipse.jface.text', :version=>'3.6.0' do

but not if buildr4osgi reads the version from the MANIFEST when using

> define 'org.eclipse.jface.text' do

FYI: the jface version for Helios is 3.6.1

My problems resolving the bundles vanish if I apply the following patch:

> diff --git a/lib/buildr4osgi/osgi/container.rb

> b/lib/buildr4osgi/osgi/container.rb index a86c95e..26e50ad 100644

> --- a/lib/buildr4osgi/osgi/container.rb

> +++ b/lib/buildr4osgi/osgi/container.rb

>

> @@ -115,7 +115,7 @@ module OSGi #:nodoc:

> if criteria[:version].is_a?(VersionRange)

>

> selected = selected.select {|b|

> criteria[:version].in_range(b.version)}

>

> else

>

> - selected = selected.select {|b| b.version ==

> criteria[:version]} + selected = selected.select {|b| b.version

> >= criteria[:version]}

>

> end

>

> end

>

> end

I am however quite sure, that this is not the correct resolution: At the moment I am only interested in the latest resolving_strategy, where is is okay I think.

The spec for this change could probably be formulated like this:

> diff --git a/spec/osgi/container_spec.rb b/spec/osgi/container_spec.rb

> index 20d0239..5a09ab4 100644

> --- a/spec/osgi/container_spec.rb

> +++ b/spec/osgi/container_spec.rb

> @@ -86,8 +86,13 @@ MANIFEST

>

> e2.find(:name=> "org.eclipse.ui", :version =>

> "3.5.0.M_20090107").should_not be_empty

>

> end

>

> + it 'should find a specific bundle in the container with a newer version'

> do + e2 = OSGi::Container.new(@eclipse_instances.last)

> + e2.find(:name=> "org.eclipse.ui", :version => "3.4.0").should_not

> be_empty + end

> +

>

> it 'should find a specific fragment in the container' do

>

> e1 = OSGi::Container.new(@eclipse_instances.first)

> e1.find_fragments(:name=> "org.fragment").should_not be_empty

>

> end

>

> -end

> \ No newline at end of file

Best regards

Niklaus

P.S. Testrun and output was:

> time jruby -Sbuildr osgi:clean:dependencies osgi:resolve:dependencies

> (in /opt/src/buildr4osgi-bug, development)

> Clean dependencies for buildr4osgi-bug

> Resolve dependencies for buildr4osgi-bug

> ** Collecting dependencies for buildr4osgi-bug:ch.elexis

> Done parsing /opt/src/buildr4osgi-bug/dummyOSGi

> ** Done collecting dependencies for buildr4osgi-bug:ch.elexis

> ** Collecting dependencies for buildr4osgi-bug

> ** Done collecting dependencies for buildr4osgi-bug

> Completed in 0.355s

> Completed in 0.103s

buildr4osgi-bug.tar.bz2
Reply all
Reply to author
Forward
0 new messages