You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Rajini Sivaram <ra...@googlemail.com> on 2007/07/10 20:07:00 UTC

Package resolution doesn't seem to use version information

Hello,

I have a test which uses two versions of two bundles:

CustomerV1:
    Import-Package: org.osgi.framework, supplychain.retailer;version="[1.0.0
,2.0.0)"

CustomerV2:
    Import-Package: org.osgi.framework, supplychain.retailer;version="2.0.0"

RetailerV1:
    Export-Package: supplychain.retailer;version="1.0.0"

RetailerV2:
    Export-Package: supplychain.retailer;version="2.0.0"

I was expecting CustomerV1 to use RetailerV1 and CustomerV2 to user
RetailerV2. With Equinox and the older version of Felix (0.80), the packages
are resolved as I expected. But with the latest snapshot of Felix, both
CustomerV1 and CustomerV2 use RetailerV2. Is there anything else I should
specify to get versions resolved correctly?

Thank you...

Regards,

Rajini

Re: Package resolution doesn't seem to use version information

Posted by Rajini Sivaram <ra...@googlemail.com>.
Richard,

Thank you very much for the quick response. My tests work as expected with
the latest snapshot.


Thank you...

Regards,

Rajini


On 7/10/07, Richard S. Hall <he...@ungoverned.org> wrote:
>
> Ok, I just committed and deployed a new version of the framework that
> resolves this issue...
>
> There indeed was a bug introduced during the refactoring of the resolver
> for require-bundle...in short, attribute matching on imports/exports in
> 0.8.0 was handled version numbers as a special case, but the new code
> does not; however, there was still some old code treating version as a
> special case which was causing it to match when it should not.
>
> I eliminated this old code and it appears to be working correctly after
> running it against your example and the TCK...although the TCK didn't
> apparently help me catch this error in the first place! :-)
>
> Let me know if it is working like you expect now, thanks...and good
> catch since this will now make it into the 1.0.0 release!
>
> -> richard
>
> Rajini Sivaram wrote:
> > Hello,
> >
> > I have a test which uses two versions of two bundles:
> >
> > CustomerV1:
> >    Import-Package: org.osgi.framework,
> > supplychain.retailer;version="[1.0.0
> > ,2.0.0)"
> >
> > CustomerV2:
> >    Import-Package: org.osgi.framework,
> > supplychain.retailer;version="2.0.0"
> >
> > RetailerV1:
> >    Export-Package: supplychain.retailer;version="1.0.0"
> >
> > RetailerV2:
> >    Export-Package: supplychain.retailer;version="2.0.0"
> >
> > I was expecting CustomerV1 to use RetailerV1 and CustomerV2 to user
> > RetailerV2. With Equinox and the older version of Felix (0.80), the
> > packages
> > are resolved as I expected. But with the latest snapshot of Felix, both
> > CustomerV1 and CustomerV2 use RetailerV2. Is there anything else I
> should
> > specify to get versions resolved correctly?
> >
> > Thank you...
> >
> > Regards,
> >
> > Rajini
> >
>

Re: Package resolution doesn't seem to use version information

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Ok, I just committed and deployed a new version of the framework that 
resolves this issue...

There indeed was a bug introduced during the refactoring of the resolver 
for require-bundle...in short, attribute matching on imports/exports in 
0.8.0 was handled version numbers as a special case, but the new code 
does not; however, there was still some old code treating version as a 
special case which was causing it to match when it should not.

I eliminated this old code and it appears to be working correctly after 
running it against your example and the TCK...although the TCK didn't 
apparently help me catch this error in the first place! :-)

Let me know if it is working like you expect now, thanks...and good 
catch since this will now make it into the 1.0.0 release!

-> richard

Rajini Sivaram wrote:
> Hello,
>
> I have a test which uses two versions of two bundles:
>
> CustomerV1:
>    Import-Package: org.osgi.framework, 
> supplychain.retailer;version="[1.0.0
> ,2.0.0)"
>
> CustomerV2:
>    Import-Package: org.osgi.framework, 
> supplychain.retailer;version="2.0.0"
>
> RetailerV1:
>    Export-Package: supplychain.retailer;version="1.0.0"
>
> RetailerV2:
>    Export-Package: supplychain.retailer;version="2.0.0"
>
> I was expecting CustomerV1 to use RetailerV1 and CustomerV2 to user
> RetailerV2. With Equinox and the older version of Felix (0.80), the 
> packages
> are resolved as I expected. But with the latest snapshot of Felix, both
> CustomerV1 and CustomerV2 use RetailerV2. Is there anything else I should
> specify to get versions resolved correctly?
>
> Thank you...
>
> Regards,
>
> Rajini
>

Re: Package resolution doesn't seem to use version information

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Just wanted to let you know that I verified the behavior that you 
describe, so now I will look at why it is doing that...

-> richard

Rajini Sivaram wrote:
> Hello,
>
> I have a test which uses two versions of two bundles:
>
> CustomerV1:
>    Import-Package: org.osgi.framework, 
> supplychain.retailer;version="[1.0.0
> ,2.0.0)"
>
> CustomerV2:
>    Import-Package: org.osgi.framework, 
> supplychain.retailer;version="2.0.0"
>
> RetailerV1:
>    Export-Package: supplychain.retailer;version="1.0.0"
>
> RetailerV2:
>    Export-Package: supplychain.retailer;version="2.0.0"
>
> I was expecting CustomerV1 to use RetailerV1 and CustomerV2 to user
> RetailerV2. With Equinox and the older version of Felix (0.80), the 
> packages
> are resolved as I expected. But with the latest snapshot of Felix, both
> CustomerV1 and CustomerV2 use RetailerV2. Is there anything else I should
> specify to get versions resolved correctly?
>
> Thank you...
>
> Regards,
>
> Rajini
>

Re: Package resolution doesn't seem to use version information

Posted by "Richard S. Hall" <he...@ungoverned.org>.
That sounds like a bug, I will look into it.

-> richard

Rajini Sivaram wrote:
> Hello,
>
> I have a test which uses two versions of two bundles:
>
> CustomerV1:
>    Import-Package: org.osgi.framework, 
> supplychain.retailer;version="[1.0.0
> ,2.0.0)"
>
> CustomerV2:
>    Import-Package: org.osgi.framework, 
> supplychain.retailer;version="2.0.0"
>
> RetailerV1:
>    Export-Package: supplychain.retailer;version="1.0.0"
>
> RetailerV2:
>    Export-Package: supplychain.retailer;version="2.0.0"
>
> I was expecting CustomerV1 to use RetailerV1 and CustomerV2 to user
> RetailerV2. With Equinox and the older version of Felix (0.80), the 
> packages
> are resolved as I expected. But with the latest snapshot of Felix, both
> CustomerV1 and CustomerV2 use RetailerV2. Is there anything else I should
> specify to get versions resolved correctly?
>
> Thank you...
>
> Regards,
>
> Rajini
>