You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Thomas Diesler (Created) (JIRA)" <ji...@apache.org> on 2012/03/02 13:42:56 UTC

[jira] [Created] (FELIX-3370) Complex Require-Bundle resolver failure

Complex Require-Bundle resolver failure
---------------------------------------

                 Key: FELIX-3370
                 URL: https://issues.apache.org/jira/browse/FELIX-3370
             Project: Felix
          Issue Type: Bug
            Reporter: Thomas Diesler


Consider this

{code}
        // Bundle-SymbolicName: requirebundleB
        // Export-Package: resources
        
        // Bundle-SymbolicName: requirebundleC
        // Export-Package: resources
        
        // Bundle-SymbolicName: requirebundleD
        // Import-Package: resources;bundle-symbolic-name=requirebundleC

        // Bundle-SymbolicName: requirebundleE
        // Require-Bundle: requirebundleD
        // Import-Package: resources

        Wiring wiringE = getWiring(env, resourceE);
        assertEquals(0, wiringE.getProvidedResourceWires(null).size());
        assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
        wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
        assertEquals(resourceC, wire.getProvider());
{code}

The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Richard S. Hall (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221088#comment-13221088 ] 

Richard S. Hall commented on FELIX-3370:
----------------------------------------

Yes, in this case, I'd expect to see what you are expecting too. I'll look into it.
                
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>            Reporter: Thomas Diesler
>             Fix For: framework-4.2.0
>
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Export-Package: org.jboss.osgi.test.classloading.export;uses:=resources
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Richard S. Hall (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall updated FELIX-3370:
-----------------------------------

          Component/s: Framework
             Priority: Minor  (was: Major)
    Affects Version/s: framework-4.0.2
        Fix Version/s: framework-4.2.0
    
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>            Reporter: Thomas Diesler
>            Priority: Minor
>             Fix For: framework-4.2.0
>
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Export-Package: org.jboss.osgi.test.classloading.export;uses:=resources
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Richard S. Hall (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220971#comment-13220971 ] 

Richard S. Hall edited comment on FELIX-3370 at 3/2/12 2:54 PM:
----------------------------------------------------------------

I see nothing in your description that indicates this is a bug. It is completely valid to wire E to B.

The priority decisions for candidates are made on a per bundle basis, not on a global basis. In other words, the best candidate for "resources" for E is B, assuming it was installed first, since there is no other version information.

Perhaps you really meant to file an RFE that indicates you wish that candidates for all requirements were somehow globally optimized in general. Currently, only "uses" constraints impact multiple-bundle candidate choices. However, I doubt that implementing some form of further global optimization would not be a good idea since "uses" constraints already make the algorithm slow and complicated enough. What you are unknowingly proposing is adding some form of implicit "uses" constraint where you try to pick the same candidate for everyone if you can, even though you are not really constrained to do so.

So, unless I'm missing something, this should be closed as "NOT A PROBLEM" or "WON'T FIX".
                
      was (Author: rickhall):
    I see nothing in your description that indicates this is a bug. It is completely valid to wire E to B.

The priority decisions for candidates are made on a per bundle basis, not on a global basis. In other words, the best candidate for resource for E is B, assuming it was installed first, since there is no other version information.

Perhaps you really meant to file an RFE that indicates you wish that candidates for all requirements were somehow globally optimized in general. Currently, only "uses" constraints impact multiple-bundle candidate choices. However, I doubt that implementing some form of further global optimization would not be a good idea since "uses" constraints already make the algorithm slow and complicated enough. What you are unknowingly proposing is adding some form of implicit "uses" constraint where you try to pick the same candidate for everyone if you can, even though you are not really constrained to do so.

So, unless I'm missing something, this should be closed as "NOT A PROBLEM" or "WON'T FIX".
                  
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>            Reporter: Thomas Diesler
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Thomas Diesler (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Diesler updated FELIX-3370:
----------------------------------

    Description: 
Consider this

{code}
        // Bundle-SymbolicName: requirebundleB
        // Export-Package: resources
        
        // Bundle-SymbolicName: requirebundleC
        // Export-Package: resources
        
        // Bundle-SymbolicName: requirebundleD
        // Export-Package: org.jboss.osgi.test.classloading.export;uses:=resources
        // Import-Package: resources;bundle-symbolic-name=requirebundleC

        // Bundle-SymbolicName: requirebundleE
        // Require-Bundle: requirebundleD
        // Import-Package: resources

        Wiring wiringE = getWiring(env, resourceE);
        assertEquals(0, wiringE.getProvidedResourceWires(null).size());
        assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
        wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
        assertEquals(resourceC, wire.getProvider());
{code}

The current implementation of the standalone resolver wires E to B

  was:
Consider this

{code}
        // Bundle-SymbolicName: requirebundleB
        // Export-Package: resources
        
        // Bundle-SymbolicName: requirebundleC
        // Export-Package: resources
        
        // Bundle-SymbolicName: requirebundleD
        // Import-Package: resources;bundle-symbolic-name=requirebundleC

        // Bundle-SymbolicName: requirebundleE
        // Require-Bundle: requirebundleD
        // Import-Package: resources

        Wiring wiringE = getWiring(env, resourceE);
        assertEquals(0, wiringE.getProvidedResourceWires(null).size());
        assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
        wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
        assertEquals(resourceC, wire.getProvider());
{code}

The current implementation of the standalone resolver wires E to B


I added the missing uses directive in D

        // Bundle-SymbolicName: requirebundleD
        // Export-Package: org.jboss.osgi.test.classloading.export;uses:=resources
        // Import-Package: resources;bundle-symbolic-name=requirebundleC


                
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>            Reporter: Thomas Diesler
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Export-Package: org.jboss.osgi.test.classloading.export;uses:=resources
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Richard S. Hall (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221116#comment-13221116 ] 

Richard S. Hall commented on FELIX-3370:
----------------------------------------

I don't think you were reporting this against framework, but I tried it on framework and came up with the correct result:

g! lb
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.1.0.SNAPSHOT)
    1|Active     |    1|Apache Felix Bundle Repository (1.6.6)
    2|Active     |    1|Apache Felix Gogo Command (0.12.0)
    3|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
    4|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    5|Installed  |    1|B (0.0.0)
    6|Installed  |    1|C (0.0.0)
    7|Installed  |    1|D (0.0.0)
    8|Installed  |    1|E (0.0.0)
g! resolve 8
DEBUG: Candidate permutation failed due to a conflict between imports; will try another if possible. (org.apache.felix.framework.resolver.ResolveException: Uses constraint violation. Unable to resolve bundle revision E [8.0] because it is exposed to package 'resources' from bundle revisions B [5.0] and C [6.0] via two dependency chains.

Chain 1:
  E [8.0]
    import: (osgi.wiring.package=resources)
     |
    export: osgi.wiring.package=resources
  B [5.0]

Chain 2:
  E [8.0]
    require: (osgi.wiring.bundle=D)
     |
    provide: [7.0] osgi.wiring.bundle; {osgi.wiring.bundle=D, bundle-version=0.0.0}
  D [7.0]
    import: (&(osgi.wiring.package=resources)(bundle-symbolic-name=C))
     |
    export: osgi.wiring.package=resources
  C [6.0])
DEBUG: WIRE: [8.0] osgi.wiring.package; (osgi.wiring.package=resources) -> [6.0]
DEBUG: WIRE: [8.0] osgi.wiring.bundle; (osgi.wiring.bundle=D) -> [7.0]
DEBUG: WIRE: [7.0] osgi.wiring.package; (&(osgi.wiring.package=resources)(bundle-symbolic-name=C)) -> [6.0]
g! 

This shows it saw the conflict and then find the correct solution in the final wires.
                
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>            Reporter: Thomas Diesler
>            Priority: Minor
>             Fix For: framework-4.2.0
>
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Export-Package: org.jboss.osgi.test.classloading.export;uses:=resources
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Richard S. Hall (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220971#comment-13220971 ] 

Richard S. Hall edited comment on FELIX-3370 at 3/2/12 2:54 PM:
----------------------------------------------------------------

I see nothing in your description that indicates this is a bug. It is completely valid to wire E to B.

The priority decisions for candidates are made on a per bundle basis, not on a global basis. In other words, the best candidate for resource for E is B, assuming it was installed first, since there is no other version information.

Perhaps you really meant to file an RFE that indicates you wish that candidates for all requirements were somehow globally optimized in general. Currently, only "uses" constraints impact multiple-bundle candidate choices. However, I doubt that implementing some form of further global optimization would not be a good idea since "uses" constraints already make the algorithm slow and complicated enough. What you are unknowingly proposing is adding some form of implicit "uses" constraint where you try to pick the same candidate for everyone if you can, even though you are not really constrained to do so.

So, unless I'm missing something, this should be closed as "NOT A PROBLEM" or "WON'T FIX".
                
      was (Author: rickhall):
    I see nothing in your description that indicates this is a bug. It is completely valid to wire E to be.

The priority decisions for candidates are made on a per bundle basis, not on a global basis. In other words, the best candidate for resource for E is B, assuming it was installed first, since there is no other version information.

Perhaps you really meant to file an RFE that indicates you wish that candidates for all requirements were somehow globally optimized in general. Currently, only "uses" constraints impact multiple-bundle candidate choices. However, I doubt that implementing some form of further global optimization would not be a good idea since "uses" constraints already make the algorithm slow and complicated enough. What you are unknowingly proposing is adding some form of implicit "uses" constraint where you try to pick the same candidate for everyone if you can, even though you are not really constrained to do so.

So, unless I'm missing something, this should be closed as "NOT A PROBLEM" or "WON'T FIX".
                  
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>            Reporter: Thomas Diesler
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Thomas Diesler (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Diesler closed FELIX-3370.
---------------------------------

       Resolution: Not A Problem
    Fix Version/s:     (was: framework-4.2.0)

Found it - Thanks
                
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>            Reporter: Thomas Diesler
>            Priority: Minor
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Export-Package: org.jboss.osgi.test.classloading.export;uses:=resources
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Richard S. Hall (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220971#comment-13220971 ] 

Richard S. Hall edited comment on FELIX-3370 at 3/2/12 2:55 PM:
----------------------------------------------------------------

I see nothing in your description that indicates this is a bug. It is completely valid to wire E to B.

The priority decisions for candidates are made on a per bundle basis, not on a global basis. In other words, the best candidate for "resources" for E is B, assuming it was installed first, since there is no other version information.

Perhaps you really meant to file an RFE that indicates you wish that candidates for all requirements were somehow globally optimized in general. Currently, only "uses" constraints impact multiple-bundle candidate choices. However, I doubt that implementing some form of further global optimization would be a good idea since "uses" constraints already make the algorithm slow and complicated enough. What you are unknowingly proposing is adding some form of implicit "uses" constraint where you try to pick the same candidate for everyone if you can, even though you are not really constrained to do so.

So, unless I'm missing something, this should be closed as "NOT A PROBLEM" or "WON'T FIX".
                
      was (Author: rickhall):
    I see nothing in your description that indicates this is a bug. It is completely valid to wire E to B.

The priority decisions for candidates are made on a per bundle basis, not on a global basis. In other words, the best candidate for "resources" for E is B, assuming it was installed first, since there is no other version information.

Perhaps you really meant to file an RFE that indicates you wish that candidates for all requirements were somehow globally optimized in general. Currently, only "uses" constraints impact multiple-bundle candidate choices. However, I doubt that implementing some form of further global optimization would not be a good idea since "uses" constraints already make the algorithm slow and complicated enough. What you are unknowingly proposing is adding some form of implicit "uses" constraint where you try to pick the same candidate for everyone if you can, even though you are not really constrained to do so.

So, unless I'm missing something, this should be closed as "NOT A PROBLEM" or "WON'T FIX".
                  
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>            Reporter: Thomas Diesler
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3370) Complex Require-Bundle resolver failure

Posted by "Richard S. Hall (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220971#comment-13220971 ] 

Richard S. Hall commented on FELIX-3370:
----------------------------------------

I see nothing in your description that indicates this is a bug. It is completely valid to wire E to be.

The priority decisions for candidates are made on a per bundle basis, not on a global basis. In other words, the best candidate for resource for E is B, assuming it was installed first, since there is no other version information.

Perhaps you really meant to file an RFE that indicates you wish that candidates for all requirements were somehow globally optimized in general. Currently, only "uses" constraints impact multiple-bundle candidate choices. However, I doubt that implementing some form of further global optimization would not be a good idea since "uses" constraints already make the algorithm slow and complicated enough. What you are unknowingly proposing is adding some form of implicit "uses" constraint where you try to pick the same candidate for everyone if you can, even though you are not really constrained to do so.

So, unless I'm missing something, this should be closed as "NOT A PROBLEM" or "WON'T FIX".
                
> Complex Require-Bundle resolver failure
> ---------------------------------------
>
>                 Key: FELIX-3370
>                 URL: https://issues.apache.org/jira/browse/FELIX-3370
>             Project: Felix
>          Issue Type: Bug
>            Reporter: Thomas Diesler
>
> Consider this
> {code}
>         // Bundle-SymbolicName: requirebundleB
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleC
>         // Export-Package: resources
>         
>         // Bundle-SymbolicName: requirebundleD
>         // Import-Package: resources;bundle-symbolic-name=requirebundleC
>         // Bundle-SymbolicName: requirebundleE
>         // Require-Bundle: requirebundleD
>         // Import-Package: resources
>         Wiring wiringE = getWiring(env, resourceE);
>         assertEquals(0, wiringE.getProvidedResourceWires(null).size());
>         assertEquals(1, wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).size());
>         wire = wiringE.getRequiredResourceWires(WIRING_PACKAGE_NAMESPACE).get(0);
>         assertEquals(resourceC, wire.getProvider());
> {code}
> The current implementation of the standalone resolver wires E to B

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira