Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 4.0.0-SNAPSHOT builds not working #1765

Closed
merks opened this issue Nov 30, 2022 · 25 comments
Closed

The 4.0.0-SNAPSHOT builds not working #1765

merks opened this issue Nov 30, 2022 · 25 comments
Milestone

Comments

@merks
Copy link
Contributor

merks commented Nov 30, 2022

This build that worked the other day is no longer working:

https://ci.eclipse.org/oomph/job/jetty/job/jetty-mirror-4.0/

Fails like this:

[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:4.0.0-SNAPSHOT:mirror (default) on project org.eclipse.oomph.jetty.mirror: Execution default of goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:4.0.0-SNAPSHOT:mirror failed: Cannot invoke "org.osgi.framework.BundleContext.getServiceReference(java.lang.Class)" because the return value of "org.eclipse.equinox.p2.internal.repository.tools.Activator.getBundleContext()" is null -> [Help 1]

Also this one stopped working overnight:

https://ci.eclipse.org/simrel/job/simrel.runaggregator.pipeline/

It fails rather quietly like this:

22:33:43  [INFO] --- tycho-eclipserun-plugin:4.0.0-SNAPSHOT:eclipse-run (build-repo) @ build ---
22:34:05  [WARNING] The POM for org.eclipse.platform:org.eclipse.equinox.simpleconfigurator:jar:1.4.100-SNAPSHOT is missing, no dependency information available
22:34:15  [WARNING] The POM for org.eclipse.platform:org.eclipse.equinox.p2.garbagecollector:jar:1.2.0-SNAPSHOT is missing, no dependency information available
22:34:15  [WARNING] The POM for org.eclipse.platform:org.eclipse.equinox.simpleconfigurator.manipulator:jar:2.2.0-SNAPSHOT is missing, no dependency information available
22:34:18  [WARNING] Cannot locate service org.eclipse.equinox.p2.core.IAgentLocation because no provisioning agent was found
22:34:18  [WARNING] Cannot locate service org.eclipse.equinox.p2.core.IAgentLocation because no provisioning agent was found
22:34:20  [INFO] ------------------------------------------------------------------------
22:34:20  [INFO] BUILD FAILURE

Both appear to be some problem related to starting Equinox...

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

Can you provide an integration-test to demonstrate the issue in a smaller context?

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

It took rather long to get by environment working again this morning. It seems one now requires maven 3.8.6 but the build machine's maven latest is 3.8.5.

+ mvn -version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)

Could that cause such failures?

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

I'm doubtful this can be reproduce with an integration test given that the failures are very fundamental such that the existing tests would fail when doing the same thing:

Caused by: java.lang.NullPointerException: Cannot invoke "org.osgi.framework.BundleContext.getServiceReference(java.lang.Class)" because the return value of "org.eclipse.equinox.p2.internal.repository.tools.Activator.getBundleContext()" is null
    at org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.setupAgent (AbstractApplication.java:65)
    at org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.<init> (AbstractApplication.java:55)
    at org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication.<init> (MirrorApplication.java:41)
    at org.eclipse.tycho.p2tools.MirrorApplication.<init> (MirrorApplication.java:60)
    at org.eclipse.tycho.p2tools.MirrorApplicationServiceImpl.createMirrorApplication (MirrorApplicationServiceImpl.java:242)
    at org.eclipse.tycho.p2tools.MirrorApplicationServiceImpl.mirrorStandalone (MirrorApplicationServiceImpl.java:85)
    at org.eclipse.tycho.plugins.p2.extras.MirrorMojo.execute (MirrorMojo.java:253)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Something changed between the version that work yesterday evening about 5:30PM and about two hows later. Both org.eclipse.tycho.extras:tycho-p2-extras-plugin:4.0.0-SNAPSHOT:mirror and tycho-eclipserun-plugin:4.0.0-SNAPSHOT:eclipse-run fail and tests already cover those.

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

Maven 3.8.6 is an official requirement a long time because 3.8.5 has a bug that might cause problems.

I'm doubtful this can be reproduce with an integration test given that the failures are very fundamental such that the existing tests would fail when doing the same thing:

The most basic test is that the maven run completes without errors, so I don't see any issues here how early the build fails.

Something changed between the version that work yesterday evening about 5:30PM and about two hows later. Both org.eclipse.tycho.extras:tycho-p2-extras-plugin:4.0.0-SNAPSHOT:mirror and tycho-eclipserun-plugin:4.0.0-SNAPSHOT:eclipse-run fail and tests already cover those.

But there must be something missing then, each build is verified on three platforms + running the platform aggregator build on linux, so I think we are quite safe for catching general problems and cover a wide range of cases.

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

I can reproduce a problem locally if I use the actual 4.0.0-SNAPSHOT repository as the Tycho source rather than the locally-built-and-deployed versions:

	<pluginRepositories>
		<pluginRepository>
			<id>eclipse-maven-snapshots</id>
			<url>https://repo.eclipse.org/content/repositories/snapshots</url>
		</pluginRepository>
		<pluginRepository>
			<id>eclipse-maven-releases</id>
			<url>https://repo.eclipse.org/content/repositories/releases</url>
		</pluginRepository>

		<pluginRepository>
			<id>eclipse-cbi-releases</id>
			<url>https://repo.eclipse.org/content/repositories/cbi-releases</url>
		</pluginRepository>
	</pluginRepositories>

In this case the failure is just trying to resolve the target platform:

08:56:22 [WARNING] No explicit target runtime environment configuration. Build is platform dependent.
08:56:23 [WARNING] Cannot locate service org.eclipse.equinox.p2.core.IAgentLocation because no provisioning agent was found
08:56:24 [WARNING] Cannot locate service org.eclipse.equinox.p2.core.IAgentLocation because no provisioning agent was found
08:56:24 [INFO] Resolving target definition file:/D:/Users/merks/tycho-master/ws/gpg-test/tp/Maven.target for environments=[win32/win32/x86_64], include source mode=honor, execution environment=StandardEEResolutionHints [executionEnvironment=OSGi profile 'JavaSE-17' { source level: 17, target level: 17}], remote p2 repository options=org.eclipse.tycho.p2maven.DefaultProvisioningAgent@34a4b76d...
08:56:24 [ERROR] Internal error: java.lang.IllegalStateException: bundle org.eclipse.equinox.p2.repositoryis not started -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalStateException: bundle org.eclipse.equinox.p2.repositoryis not started
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: bundle org.eclipse.equinox.p2.repositoryis not started
    at org.eclipse.equinox.internal.p2.repository.Activator.getContext (Activator.java:65)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.restoreFromSystemProperty (AbstractRepositoryManager.java:1013)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.restoreRepositories (AbstractRepositoryManager.java:1033)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.basicGetRepository (AbstractRepositoryManager.java:182)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository (AbstractRepositoryManager.java:666)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository (MetadataRepositoryManager.java:110)
    at org.eclipse.tycho.p2maven.transport.RemoteMetadataRepositoryManager.loadRepository (RemoteMetadataRepositoryManager.java:65)
    at org.eclipse.tycho.p2maven.transport.RemoteMetadataRepositoryManager.loadRepository (RemoteMetadataRepositoryManager.java:57)
    at org.eclipse.tycho.p2.resolver.URITargetDefinitionContent.preload (URITargetDefinitionContent.java:76)
    at org.eclipse.tycho.p2.resolver.URITargetDefinitionContent.query (URITargetDefinitionContent.java:53)
    at org.eclipse.equinox.p2.query.CompoundQueryable.getIteratorFromQueryable (CompoundQueryable.java:178)
    at org.eclipse.equinox.p2.query.CompoundQueryable.everything (CompoundQueryable.java:124)
    at org.eclipse.equinox.internal.p2.metadata.expression.RepeatableIterator$IndexProviderIterator.<init> (RepeatableIterator.java:142)
    at org.eclipse.equinox.internal.p2.metadata.expression.RepeatableIterator.create (RepeatableIterator.java:60)
    at org.eclipse.equinox.internal.p2.metadata.expression.Everything.<init> (Everything.java:39)
    at org.eclipse.equinox.internal.p2.metadata.expression.ContextExpression.createContext (ContextExpression.java:48)
    at org.eclipse.equinox.p2.query.ExpressionQuery.perform (ExpressionQuery.java:51)
    at org.eclipse.equinox.internal.p2.metadata.index.IndexProvider.query (IndexProvider.java:26)
    at org.eclipse.equinox.internal.p2.metadata.index.IndexProvider.query (IndexProvider.java:36)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.findUnit (InstallableUnitResolver.java:281)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.findUnits (InstallableUnitResolver.java:261)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.getRootIUs (InstallableUnitResolver.java:254)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.addLocation (InstallableUnitResolver.java:88)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContentWithExceptions (TargetDefinitionResolver.java:152)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContent (TargetDefinitionResolver.java:110)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.resolveFromArguments (TargetDefinitionResolverService.java:90)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent (ConcurrentHashMap.java:1708)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.getTargetDefinitionContent (TargetDefinitionResolverService.java:65)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.resolveTargetDefinitions (TargetPlatformFactoryImpl.java:212)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:164)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:137)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:88)
    at org.eclipse.tycho.p2resolver.ReactorRepositoryManagerImpl.computePreliminaryTargetPlatform (ReactorRepositoryManagerImpl.java:105)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.computePreliminaryTargetPlatform (P2DependencyResolver.java:229)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:133)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.lambda$resolveProjects$2 (TychoMavenLifecycleParticipant.java:257)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.WhileOps$1$1.accept (WhileOps.java:99)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance (ArrayList.java:1602)
    at java.util.stream.ReferencePipeline.forEachWithCancel (ReferencePipeline.java:129)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (AbstractPipeline.java:527)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:513)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:499)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:596)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.resolveProjects (TychoMavenLifecycleParticipant.java:293)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:144)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:253)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

So something appears broken but only in the https://repo.eclipse.org/content/repositories/snapshots version. So maybe a new Tycho build will just fix the problem. But all the line numbers appear to match what I have in the workspace and for this test I used Maven 3.8.6.

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

When it's working locally with the local Tycho version, I can see the org.eclipse.equinox.internal.p2.repository.Activator is started like this:

Activator.start(BundleContext) line: 43	
BundleContextImpl$2.run() line: 818	
BundleContextImpl$2.run() line: 1	
AccessController.executePrivileged(PrivilegedExceptionAction<T>, AccessControlContext, Class<?>) line: 807	
AccessController.doPrivileged(PrivilegedExceptionAction<T>) line: 569	
BundleContextImpl.startActivator(BundleActivator) line: 810	
BundleContextImpl.start() line: 767	
EquinoxBundle.startWorker0() line: 1032	
EquinoxBundle$EquinoxModule.startWorker() line: 371	
EquinoxBundle$EquinoxModule(Module).doStart(Module$StartOptions...) line: 605	
EquinoxBundle$EquinoxModule(Module).start(Module$StartOptions...) line: 468	
ModuleContainer$ContainerStartLevel$2.run() line: 1852	
EquinoxContainerAdaptor$1$1.execute(Runnable) line: 136	
ModuleContainer$ContainerStartLevel.incStartLevel(int, List<Module>, boolean) line: 1845	
ModuleContainer$ContainerStartLevel.incStartLevel(int, List<Module>, List<Module>, List<Module>, List<Module>) line: 1788	
ModuleContainer$ContainerStartLevel.doContainerStartLevel(Module, int, FrameworkListener...) line: 1750	
EquinoxBundle$SystemBundle$EquinoxSystemModule(SystemModule).startWorker() line: 269	
EquinoxBundle$SystemBundle$EquinoxSystemModule(Module).doStart(Module$StartOptions...) line: 605	
EquinoxBundle$SystemBundle$EquinoxSystemModule(Module).start(Module$StartOptions...) line: 468	
EquinoxBundle$SystemBundle$EquinoxSystemModule(SystemModule).start(Module$StartOptions...) line: 193	
EquinoxBundle$SystemBundle(EquinoxBundle).start(int) line: 445	
EquinoxBundle$SystemBundle(EquinoxBundle).start() line: 464	
Equinox.start() line: 139	
PlexusFrameworkConnectServiceFactory.getFramework(ClassRealm) line: 145	

But that start doesn't happen remote debugging the non-working version.

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

I can reproduce a problem locally if I use the actual 4.0.0-SNAPSHOT repository as the Tycho source rather than the locally-built-and-deployed versions

If you have a small test-project can you upload it here (or any other place)?

So something appears broken but only in the https://repo.eclipse.org/content/repositories/snapshots version.

Keep in mind that Tycho might be affected by other snapshot dependencies as well! And because of the open version ranges in platform up to the last release it might pull in unwanted stuff here.

But that start doesn't happen remote debugging the non-working version.

If you pass -X you should see the full state of the embedded OSGi framework and some error conditions as well.

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

I think it will happen with any project that does anything with p2. Remote debugging the failure, here's what I see as the reason for the org.eclipse.equinox.p2.repository "module" not starting:

osgi.identity; osgi.identity="org.eclipse.equinox.p2.repository"; type="osgi.bundle"; version:Version="2.6.200.v20220819-1949"; tags:List<String>="osgi.connect"; singleton:="true"
[org.eclipse.osgi.container.ModuleResolutionReport$EntryImpl@6bca1456]
osgi.wiring.package; filter:="(osgi.wiring.package=org.eclipse.core.runtime.jobs)"
MISSING_CAPABILITY
org.apache.felix.resolver.reason.ReasonException: Unable to resolve osgi.identity; osgi.identity="org.eclipse.equinox.p2.repository"; type="osgi.bundle"; version:Version="2.6.200.v20220819-1949"; tags:List<String>="osgi.connect"; singleton:="true": missing requirement osgi.wiring.package; filter:="(osgi.wiring.package=org.eclipse.core.runtime.jobs)"

It seems these failures are not surfaced anywhere visible....

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

By the way, it might be that this is causing this:

because here we try to filter out unrelated stuff, but if maven pulls in newer ones they might be tagged as "please ignore that"...

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

Here is a more detailed error report on the resolution failure:

org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tycho.embedder-api [4]
  Unresolved requirement: Import-Package: org.eclipse.tycho; version="[4.0.0,5.0.0)"
    -> Export-Package: org.eclipse.tycho; bundle-symbolic-name="org.eclipse.tycho.embedder.shared"; bundle-version="4.0.0"; version="4.0.0"
       org.eclipse.tycho.embedder.shared [3]
         Unresolved requirement: Import-Package: org.eclipse.equinox.p2.metadata; version="2.4.0"
           -> Export-Package: org.eclipse.equinox.p2.metadata; bundle-symbolic-name="org.eclipse.equinox.p2.metadata"; bundle-version="2.6.300.v20220817-1208"; version="2.4.0"
              org.eclipse.equinox.p2.metadata [6]
                Unresolved requirement: Require-Bundle: org.eclipse.equinox.common

    at org.eclipse.osgi.container.Module.start (Module.java:463)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run (ModuleContainer.java:1852)
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute (EquinoxContainerAdaptor.java:136)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel (ModuleContainer.java:1845)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel (ModuleContainer.java:1788)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel (ModuleContainer.java:1750)
    at org.eclipse.osgi.container.SystemModule.startWorker (SystemModule.java:269)
    at org.eclipse.osgi.container.Module.doStart (Module.java:605)
    at org.eclipse.osgi.container.Module.start (Module.java:468)
    at org.eclipse.osgi.container.SystemModule.start (SystemModule.java:193)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start (EquinoxBundle.java:445)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start (EquinoxBundle.java:464)
    at org.eclipse.osgi.launch.Equinox.start (Equinox.java:139)
    at org.eclipse.sisu.osgi.connect.PlexusFrameworkConnectServiceFactory.getFramework (PlexusFrameworkConnectServiceFactory.java:145)
    at org.eclipse.sisu.osgi.connect.PlexusFrameworkConnectServiceFactory.locateClass (PlexusFrameworkConnectServiceFactory.java:359)
    at org.eclipse.sisu.osgi.connect.PlexusFrameworkConnectServiceFactory.getService (PlexusFrameworkConnectServiceFactory.java:343)
    at org.eclipse.tycho.osgi.TychoServiceFactory.getService (TychoServiceFactory.java:32)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.addEntireP2RepositoryToTargetPlatform (P2DependencyResolver.java:294)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.computePreliminaryTargetPlatform (P2DependencyResolver.java:218)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:133)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.lambda$resolveProjects$2 (TychoMavenLifecycleParticipant.java:257)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.WhileOps$1$1.accept (WhileOps.java:99)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance (ArrayList.java:1602)
    at java.util.stream.ReferencePipeline.forEachWithCancel (ReferencePipeline.java:129)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (AbstractPipeline.java:527)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:513)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:499)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:596)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.resolveProjects (TychoMavenLifecycleParticipant.java:293)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:144)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:253)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
09:45:07 [DEBUG] [0b7b815e-9366-4b56-a988-6b6ddb519739][extension>org.eclipse.tycho:tycho-maven-plugin:4.0.0-SNAPSHOT] Searching bundle for class interface org.osgi.service.condition.Condition and location file:/D:/Users/test19/.m2/repository/org/eclipse/platform/org.eclipse.osgi/3.18.100/org.eclipse.osgi-3.18.100.jar
09:45:23 [ERROR] [0b7b815e-9366-4b56-a988-6b6ddb519739][extension>org.eclipse.tycho:tycho-maven-plugin:4.0.0-SNAPSHOT] org.eclipse.tycho.embedder-api
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.tycho.embedder-api [4]
  Unresolved requirement: Import-Package: org.eclipse.tycho; version="[4.0.0,5.0.0)"
    -> Export-Package: org.eclipse.tycho; bundle-symbolic-name="org.eclipse.tycho.embedder.shared"; bundle-version="4.0.0"; version="4.0.0"
       org.eclipse.tycho.embedder.shared [3]
         Unresolved requirement: Import-Package: org.eclipse.equinox.p2.metadata; version="2.4.0"
           -> Export-Package: org.eclipse.equinox.p2.metadata; bundle-symbolic-name="org.eclipse.equinox.p2.metadata"; bundle-version="2.6.300.v20220817-1208"; version="2.4.0"
              org.eclipse.equinox.p2.metadata [6]
                Unresolved requirement: Require-Bundle: org.eclipse.equinox.common

    at org.eclipse.osgi.container.Module.start (Module.java:463)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run (ModuleContainer.java:1852)
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute (EquinoxContainerAdaptor.java:136)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel (ModuleContainer.java:1845)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel (ModuleContainer.java:1788)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel (ModuleContainer.java:1750)
    at org.eclipse.osgi.container.SystemModule.startWorker (SystemModule.java:269)
    at org.eclipse.osgi.container.Module.doStart (Module.java:605)
    at org.eclipse.osgi.container.Module.start (Module.java:468)
    at org.eclipse.osgi.container.SystemModule.start (SystemModule.java:193)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start (EquinoxBundle.java:445)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start (EquinoxBundle.java:464)
    at org.eclipse.osgi.launch.Equinox.start (Equinox.java:139)
    at org.eclipse.sisu.osgi.connect.PlexusFrameworkConnectServiceFactory.getFramework (PlexusFrameworkConnectServiceFactory.java:145)
    at org.eclipse.sisu.osgi.connect.PlexusFrameworkConnectServiceFactory.locateClass (PlexusFrameworkConnectServiceFactory.java:359)
    at org.eclipse.sisu.osgi.connect.PlexusFrameworkConnectServiceFactory.getService (PlexusFrameworkConnectServiceFactory.java:343)
    at org.eclipse.tycho.osgi.TychoServiceFactory.getService (TychoServiceFactory.java:32)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.addEntireP2RepositoryToTargetPlatform (P2DependencyResolver.java:294)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.computePreliminaryTargetPlatform (P2DependencyResolver.java:218)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:133)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.lambda$resolveProjects$2 (TychoMavenLifecycleParticipant.java:257)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.WhileOps$1$1.accept (WhileOps.java:99)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance (ArrayList.java:1602)
    at java.util.stream.ReferencePipeline.forEachWithCancel (ReferencePipeline.java:129)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (AbstractPipeline.java:527)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:513)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:499)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:596)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.resolveProjects (TychoMavenLifecycleParticipant.java:293)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:144)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:253)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

And when I compare the two lists these are diffference:

$diff toStartBad.txt toStartGood.txt
1c1
< osgi.identity; osgi.identity="sisu.connect.realm.extension.org.eclipse.tycho.tycho-maven-plugin.4.0.0-SNAPSHOT"; type="osgi.bundle"; version:Version="1.0.0.1896062177"; tags:List<String>="osgi.connect"
---
> osgi.identity; osgi.identity="sisu.connect.realm.extension.org.eclipse.tycho.tycho-maven-plugin.4.0.0-SNAPSHOT"; type="osgi.bundle"; version:Version="1.0.0.290991542"; tags:List<String>="osgi.connect"
38a39,40
> osgi.identity; osgi.identity="org.eclipse.equinox.common"; type="osgi.bundle"; version:Version="3.16.200.v20220817-1601"; tags:List<String>="osgi.connect"; singleton:="true"
> osgi.identity; osgi.identity="org.eclipse.core.jobs"; type="osgi.bundle"; version:Version="3.13.100.v20220817-1539"; tags:List<String>="osgi.connect"; singleton:="true"
47d48
< osgi.identity; osgi.identity="bcpg"; type="osgi.bundle"; version:Version="1.72.2"; tags:List<String>="osgi.connect"
51,52c52,53
< osgi.identity; osgi.identity="sisu.connect.realm.maven.api"; type="osgi.bundle"; version:Version="1.0.0.2122357625"; tags:List<String>="osgi.connect"
< osgi.identity; osgi.identity="sisu.connect.realm.plexus.core"; type="osgi.bundle"; version:Version="1.0.0.2001049719"; tags:List<String>="osgi.connect"
---
> osgi.identity; osgi.identity="sisu.connect.realm.maven.api"; type="osgi.bundle"; version:Version="1.0.0.1745512157"; tags:List<String>="osgi.connect"
> osgi.identity; osgi.identity="sisu.connect.realm.plexus.core"; type="osgi.bundle"; version:Version="1.0.0.1356732524"; tags:List<String>="osgi.connect"

Note the missing org.eclipse.equinox.common and org.eclipse.core.jobs bundles.

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

Note that the guard on org.eclipse.sisu.osgi.connect.PlexusConnectFramework.frameworkEvent(FrameworkEvent) prevents seeing what are the in the end catastrophic failures from being more visible:

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

@merks the resolution error does not really matter as it is just a consequence of messed up dependencies. So the question is why are wrong items pulled in, so

if (!realmExports.jars.isEmpty() && !realmExports.jars.contains(file.getName())) {
logger.debug("Skip " + file + " as it is not part of the dependency jars...");
continue;

would be more interesting place to look at.

@akurtakov
Copy link
Member

One thing I notice is bcpg 1.72.2 while platform is at 1.72 , it might be red herring but still worth checking out.

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

@akurtakov I think in the one case it's including two versions, but I doubt this causes failures.

@laeubi Indeed they are being filtered out:

10:13:42 [DEBUG] [4c439da1-5624-4f5f-9827-fe1950e4d06e][extension>org.eclipse.tycho:tycho-maven-plugin:4.0.0-SNAPSHOT] Skip D:\Users\test19.m2\repository\org\eclipse\tycho\tycho-maven-plugin\4.0.0-SNAPSHOT\tycho-maven-plugin-4.0.0-SNAPSHOT.jar as it is not part of the dependency jars...

10:14:30 [DEBUG] [4c439da1-5624-4f5f-9827-fe1950e4d06e][extension>org.eclipse.tycho:tycho-maven-plugin:4.0.0-SNAPSHOT] Skip D:\Users\test19.m2\repository\org\eclipse\platform\org.eclipse.equinox.common\3.17.0-SNAPSHOT\org.eclipse.equinox.common-3.17.0-SNAPSHOT.jar as it is not part of the dependency jars...

10:14:30 [DEBUG] [4c439da1-5624-4f5f-9827-fe1950e4d06e][extension>org.eclipse.tycho:tycho-maven-plugin:4.0.0-SNAPSHOT] Skip D:\Users\test19.m2\repository\org\eclipse\platform\org.eclipse.core.jobs\3.13.200-SNAPSHOT\org.eclipse.core.jobs-3.13.200-SNAPSHOT.jar as it is not part of the dependency jars..

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

I think because of the "open ranges" maven pulls in here the snapshots and as these are potentially incompatible Tycho (now) filter them out :-\

I see two options:

  1. Pin the versions (most likely required in tycho-core and p2-maven-plugin)
  2. disable the code path for now, hope everything works and the next release with tighter version ranges works better in this regard ... then enable it again if we upgraded.

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

Are you saying this is happening because these two versions are wrong?

org.eclipse.platform/org.eclipse.equinox.common/version = 3.16.200
org.eclipse.platform/org.eclipse.equinox.common/type = jar
org.eclipse.platform/org.eclipse.equinox.common/scope = compile

org.eclipse.platform/org.eclipse.core.jobs/version = 3.13.100
org.eclipse.platform/org.eclipse.core.jobs/type = jar
org.eclipse.platform/org.eclipse.core.jobs/scope = compile

In these two places:

image

So we could fix these versions... But then the problem will recur in the future as versions change? And we won't notice that in the build itself but only when we actually use the results of the build elsewhere?

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

No the versions are correct, but currently the build gets 3.17.0-SNAPSHOT version I assume because of the open ranges of some of the dependencies.

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

I really need something to do PGP signing for the SimRel build so we should at least for now something that will not filter out jars. It seems dangerously error prone to filter a jar just because its version isn't exactly as expected, and even more so because mistakes cause problem not revealed by the build. It would seem better, if we're to do filtering, to consider the specified version a lower bound...

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

. It seems dangerously error prone to filter a jar just because its version isn't exactly as expected,

Why? It is the other way round, Tycho is build and tested with this versions and should use exactly those. Anything else is an error.

because mistakes cause problem not revealed by the build

The problem is caused by the faulty version ranges of platform artifacts and now you see why I always said it is a bad idea to have those ;-)
A build can never capture those as you can add arbitrary items to your build as happening here. I'll see if I can enforce some of the dependencies here.

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

If Tycho expects exactly a certain version of something, then it is indeed responsible to ensure exactly and only that version is resolved.

As for faulty version ranges, it's not clear exactly which artifact's version range is faulty nor what exactly that fault is. Something somewhere should have excluded org.eclipse.equinox.common version 3.17.0 from its range?

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

If Tycho expects exactly a certain version of something, then it is indeed responsible to ensure exactly and only that version is resolved.

Tycho does, but transitive dependencies of platform artifacts just absorb "anything equal or higher", that's why the snapshots are pulled in here, where you most probably not want them to be used as part of the maven build...

As for faulty version ranges, it's not clear exactly which artifact's version range is faulty nor what exactly that fault is.

See

@merks
Copy link
Contributor Author

merks commented Nov 30, 2022

It's never quite clear to me whether specifying just a version number is a range or not. It seems the semantics is context dependent:

https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402
https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html

Everything seems to suggest its really only a lower bound (mostly)...

@laeubi
Copy link
Member

laeubi commented Nov 30, 2022

If you specify a version you say:

I want this version if not someone else request a higher version.

If you specify a range you say

I want the highest version that satisfies this range

So lets say you have a range of [3,4) and version 3.5 is deployed you will get this, now you add a repository that has version 3.8 you will get this one... or even 2.9-SNAPSHOT ... so using such a wide range, you should be quite sure that this will work with any other combination now and in the future.

@laeubi
Copy link
Member

laeubi commented Dec 1, 2022

@merks I disabled the check for now, this should now be fixed.

@laeubi laeubi closed this as completed Dec 1, 2022
@merks
Copy link
Contributor Author

merks commented Dec 1, 2022

Yes, it works now. Thanks.

@laeubi laeubi added this to the 4.0 milestone Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants