Skip to content

ASM does not specify upper bounds on import ranges #58

@jonahgraham

Description

@jonahgraham

😢 We have a uses constraint violation in our eco-system.

I think it will be fixed by Dec 10th when we release the new Eclipse IDE 2025-12, but until then anyone (since yesterday?) checking for updates may end up with a uses violation like this preventing using code coverage:

Details of uses violation

ENTRY org.eclipse.eclemma.core 4 0 2025-12-04 12:18:06.024
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.eclemma.core [167]
  Unresolved requirement: Require-Bundle: org.jacoco.core; bundle-version="[0.8.13,0.8.14)"
    -> Bundle-SymbolicName: org.jacoco.core; bundle-version="0.8.13.202504020838"
       org.jacoco.core [540]
  Unresolved requirement: Require-Bundle: org.jacoco.report; bundle-version="[0.8.13,0.8.14)"
    -> Bundle-SymbolicName: org.jacoco.report; bundle-version="0.8.13.202504020838"
       org.jacoco.report [541]
         Unresolved requirement: Import-Package: org.jacoco.core.data; version="[0.8.13,0.8.14)"
           -> Export-Package: org.jacoco.core.data; bundle-symbolic-name="org.jacoco.core"; bundle-version="0.8.13.202504020838"; version="0.8.13"; uses:="org.jacoco.core.internal.data"
         Unresolved requirement: Import-Package: org.jacoco.core.analysis; version="[0.8.13,0.8.14)"
           -> Export-Package: org.jacoco.core.analysis; bundle-symbolic-name="org.jacoco.core"; bundle-version="0.8.13.202504020838"; version="0.8.13"; uses:="org.jacoco.core.data,org.jacoco.core.internal.analysis"
         Unresolved requirement: Import-Package: org.jacoco.core.runtime; version="[0.8.13,0.8.14)"
           -> Export-Package: org.jacoco.core.runtime; bundle-symbolic-name="org.jacoco.core"; bundle-version="0.8.13.202504020838"; version="0.8.13"; uses:="org.jacoco.core.data,org.objectweb.asm"
         Unresolved requirement: Import-Package: org.jacoco.core; version="[0.8.13,0.8.14)"
           -> Export-Package: org.jacoco.core; bundle-symbolic-name="org.jacoco.core"; bundle-version="0.8.13.202504020838"; version="0.8.13"
  Bundle was not resolved because of a uses constraint violation.
  org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.jacoco.core [osgi.identity; type="osgi.bundle"; version:Version="0.8.13.202504020838"; osgi.identity="org.jacoco.core"] because it is exposed to package 'org.objectweb.asm' from resources org.objectweb.asm [osgi.identity; type="osgi.bundle"; version:Version="9.8.0"; osgi.identity="org.objectweb.asm"] and org.objectweb.asm [osgi.identity; type="osgi.bundle"; version:Version="9.9.0"; osgi.identity="org.objectweb.asm"] via two dependency chains.

Chain 1:
  org.jacoco.core [osgi.identity; type="osgi.bundle"; version:Version="0.8.13.202504020838"; osgi.identity="org.jacoco.core"]
    import: (&(osgi.wiring.package=org.objectweb.asm)(&(version>=9.8.0)(!(version>=9.9.0))))
     |
    export: osgi.wiring.package: org.objectweb.asm
  org.objectweb.asm [osgi.identity; type="osgi.bundle"; version:Version="9.8.0"; osgi.identity="org.objectweb.asm"]

Chain 2:
  org.jacoco.core [osgi.identity; type="osgi.bundle"; version:Version="0.8.13.202504020838"; osgi.identity="org.jacoco.core"]
    import: (&(osgi.wiring.package=org.objectweb.asm.commons)(&(version>=9.8.0)(!(version>=9.9.0))))
     |
    export: osgi.wiring.package=org.objectweb.asm.commons; uses:=org.objectweb.asm
  org.objectweb.asm.commons [osgi.identity; type="osgi.bundle"; version:Version="9.8.0"; osgi.identity="org.objectweb.asm.commons"]
    import: (&(osgi.wiring.package=org.objectweb.asm)(version>=9.8.0))
     |
    export: osgi.wiring.package: org.objectweb.asm
  org.objectweb.asm [osgi.identity; type="osgi.bundle"; version:Version="9.9.0"; osgi.identity="org.objectweb.asm"]
	at org.eclipse.osgi.container.Module.start(Module.java:495)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:2110)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:146)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2101)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2041)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:2003)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1915)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:341)

The underlying issue is in objectweb here - the Import Package has no upper bounds, meaning (e.g.) org.objectweb.asm.commons and org.objectweb.asm can be different versions in the same resolver. You can see that happen in the above uses violation.

The build.gradle linked produces a manifest that looks like this (showing only key parts for clarity):

Bundle-SymbolicName: org.objectweb.asm.commons
Bundle-Version: 9.8
Import-Package: org.objectweb.asm;version="9.8",org.objectweb.asm.signature;version="9.8",org.objectweb.asm.tree;version="9.8"

Note that the build.gradle was changed a few years ago, the older ones had the same problem as the upper bound is too wide:

Bundle-SymbolicName: org.objectweb.asm.commons
Bundle-Version: 9.0.0
Import-Package: org.objectweb.asm;version="[9.0,10)",org.objectweb.asm.signature;version="[9.0,10)",org.objectweb.asm.tree;version="[9.0,10)"

I am going to file the above to https://gitlab.ow2.org/asm/asm/-/issues also, but I am in the moderation queue for a new account.

Why is this a problem now?

Normally this mismatch isn't a problem because jacoco imports the most recent version of objectweb, and objectweb's "self" imports without a version range gets resolved to the latest version anyway.

However, if you have m2e installed at the moment, you also have https://download.eclipse.org/technology/m2e/releases/latest/ in available p2 sites, and yesterday m2e published a new release that contains a newer version of objectweb than jacoco imports.

This is why this problem probably resolves itself on 2025-12 release date because then the updated jacoco will be released that uses the objectweb.

Why wasn't this a problem in the past?

This also didn't used to be a problem in the past, because in the "old" orbit we re-bundled objectweb and had correct version constraints:

Bundle-SymbolicName: org.objectweb.asm.commons
Bundle-Version: 9.4.0.v20221107-1714
Import-Package: org.objectweb.asm;version="[9.4.0,9.5)",org.objectweb.asm.signature;version="[9.4.0,9.5)",org.objectweb.asm.tree;version="[9.4.0,9.5)"

There is the possibility that at other points in time between the 9.4 and current version that this problem may have happened because m2e release a few days before SimRel and that window could have been open in the past to cause this problem. It is mostly happenstance that I happened to run into this problem today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions