diffplug / goomph

IDE as build artifact
Apache License 2.0
130 stars 30 forks source link

P2AntRunner.runUsingPDE doesn't work for modern versions of eclipse #127

Closed andilem closed 3 years ago

andilem commented 4 years ago

P2AntRunner.runUsingPDE uses P2 bootstrap to install PDE. This doesn't work, because the P2 bootstrap is 4.7.2 and cannot install a recent (4.16.0) Eclipse. I manually created a new P2 bootstrap based on 4.16.0 (with the help of P2BootstrapInstallationCreate), but EquinoxLauncher doesn't work with this bootstrap because it requires (hard-coded) org.eclipse.equinox.ds, which doesn't exist anymore (already for a long time replaced by org.apache.felix.ds).

Please provide a way to run Eclipse Ant tasks with a recent bootstrap and/or a recent PDE.

nedtwigg commented 4 years ago

I think this is related to #69, which details similar (the same?) problems with org.eclipse.equinox.ds.

However:

I don't doubt the error in #69, nor the error you are reporting here. But we don't experience this error at DiffPlug, and finding a way to reproduce and then fix it is not a priority for us. Happy to merge a PR to fix it.

If the PR drops support for older versions of eclipse, that would be okay with me. Goomph 3.x could work for Eclipse before hard-coded equinox.ds, and Goomph 4.x could work for Eclipse after hard-coded equinox.ds. Even better would be if it worked for both.

andilem commented 4 years ago

Thank you for the fast response. To be more precise and to reproduce the error: Given the following build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies { classpath 'com.diffplug.gradle:goomph:3.24.0' }
}

task resolveTarget {
    def runner = com.diffplug.gradle.p2.P2AntRunner.create('pde.provisionTargetDefinition', {
        it.attributes().targetFile = "my.target"
        it.attributes().destinationDirectory = "$buildDir/base"
        it.attributes().clearDestination = false
    })
    doLast {
        runner.runUsingPDE(com.diffplug.gradle.pde.EclipseRelease.latestOfficial())
    }
}

and running the task gradlew resolveTarget fails trying to install PDE with the following log:

!SESSION 2020-08-10 20:49:48.346 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.6
java.vendor=Amazon.com Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -application org.eclipse.equinox.p2.director -repository https://download.eclipse.org/eclipse/updates/4.16/R-4.16-202006040540/ -installIU org.eclipse.platform.ide,org.eclipse.jdt.feature.group,org.eclipse.pde.feature.group -profile goomph-pde-bootstrap-4.16.0 -destination file:///C:\Users\alr\.goomph\pde-bootstrap\4.16.0 -bundlepool C:\Users\alr\.goomph\shared-bundles -p2.os win32 -p2.ws win32 -p2.arch x86_64
Command-line arguments:  -application org.eclipse.equinox.p2.director -clean -consolelog -repository https://download.eclipse.org/eclipse/updates/4.16/R-4.16-202006040540/ -installIU org.eclipse.platform.ide,org.eclipse.jdt.feature.group,org.eclipse.pde.feature.group -profile goomph-pde-bootstrap-4.16.0 -destination file:///C:\Users\alr\.goomph\pde-bootstrap\4.16.0 -bundlepool C:\Users\alr\.goomph\shared-bundles -p2.os win32 -p2.ws win32 -p2.arch x86_64

!ENTRY org.eclipse.osgi 4 0 2020-08-10 20:49:48.369
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Cannot support framework extension bundles without a public addURL(URL) method on the framework class loader: org.eclipse.osgi.compatibility.state_1.1.0.v20170516-1513 [55]
        at org.eclipse.osgi.storage.FrameworkExtensionInstaller.addExtensionContent0(FrameworkExtensionInstaller.java:104)
        at org.eclipse.osgi.storage.FrameworkExtensionInstaller.addExtensionContent(FrameworkExtensionInstaller.java:79)
        at org.eclipse.osgi.internal.loader.SystemBundleLoader$SystemModuleClassLoader.loadFragments(SystemBundleLoader.java:129)
        at org.eclipse.osgi.internal.loader.SystemBundleLoader.loadClassLoaderFragments(SystemBundleLoader.java:111)
        at org.eclipse.osgi.internal.loader.BundleLoader.loadFragments(BundleLoader.java:282)
        at org.eclipse.osgi.container.ModuleWiring.loadFragments(ModuleWiring.java:273)
        at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:710)
        at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:511)
        at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:457)
        at org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:1001)
        at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1382)
        at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.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:340)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.ecf.provider.filetransfer.httpclient4.SNIAwareHttpClient$1 (file:/C:/Users/alr/.goomph/p2-bootstrap/4.7.2/plugins/org.eclipse.ecf.provider.filetransfer.httpclient4_1.1.200.v20170314-0133.jar) to method sun.security.ssl.SSLSocketImpl.setHost(java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.eclipse.ecf.provider.filetransfer.httpclient4.SNIAwareHttpClient$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Installing org.eclipse.platform.ide 4.16.0.I20200604-0540.
Installing org.eclipse.jdt.feature.group 3.18.400.v20200604-0540.
Installing org.eclipse.pde.feature.group 3.14.400.v20200604-0540.
Installation failed.
An error occurred while installing the items
 session context was:(profile=goomph-pde-bootstrap-4.16.0, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]com.ibm.icu 64.2.0.v20190507-1337, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).
 Could not acquire the framework manipulator service.
Caused by: Application failed, log file location: C:\Users\alr\.goomph\p2-bootstrap\4.7.2\configuration\1597085387845.log

!ENTRY org.eclipse.equinox.p2.engine 4 4 2020-08-10 20:49:53.715
!MESSAGE An error occurred while installing the items
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2020-08-10 20:49:53.715
!MESSAGE session context was:(profile=goomph-pde-bootstrap-4.16.0, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]com.ibm.icu 64.2.0.v20190507-1337, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2020-08-10 20:49:53.715
!MESSAGE Could not acquire the framework manipulator service.
!STACK 0
java.lang.IllegalStateException: Could not acquire the framework manipulator service.
        at org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.loadDelegate(LazyManipulator.java:45)
        at org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.getConfigData(LazyManipulator.java:108)
        at org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.installBundle(InstallBundleAction.java:75)
        at org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.execute(InstallBundleAction.java:32)
        at org.eclipse.equinox.internal.p2.engine.ParameterizedProvisioningAction.execute(ParameterizedProvisioningAction.java:39)
        at org.eclipse.equinox.internal.p2.engine.Phase.mainPerform(Phase.java:184)
        at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:96)
        at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:47)
        at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:77)
        at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:45)
        at org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper.executePlan(PlanExecutionHelper.java:42)
        at org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper.executePlan(PlanExecutionHelper.java:24)
        at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.executePlan(DirectorApplication.java:813)
        at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.planAndExecute(DirectorApplication.java:806)
        at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.performProvisioningActions(DirectorApplication.java:793)
        at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.run(DirectorApplication.java:1111)
        at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.start(DirectorApplication.java:1293)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
        at com.diffplug.gradle.eclipserunner.EquinoxLauncher$Running.run(EquinoxLauncher.java:190)
        at com.diffplug.gradle.eclipserunner.EquinoxLauncher$Running.access$100(EquinoxLauncher.java:172)
        at com.diffplug.gradle.eclipserunner.EquinoxLauncher.run(EquinoxLauncher.java:163)
        at com.diffplug.gradle.eclipserunner.JarFolderRunner.run(JarFolderRunner.java:37)
        at com.diffplug.gradle.eclipserunner.JarFolderRunnerExternalJvm$RunOutside.run(JarFolderRunnerExternalJvm.java:126)
        at com.diffplug.gradle.JavaExecable.main(JavaExecable.java:134)
nedtwigg commented 4 years ago

Looks like you're on Java 11, also related to #99.

nedtwigg commented 3 years ago

3.28.0 fixes some Java 11 issues. I'm closing this issue for now, but if it's still broken post info here and I'll reopen.