Community
Participate
Working Groups
My reference case is in Eclipse Platform (https://ci-staging.eclipse.org/platform/job/eclipse.platform.text-Gerrit/2470/console). Expected behavior: No validation error found. Actual behavior: 12:48:22 * Marker [on: /org.eclipse.ui.workbench.texteditor/plugin.xml, id: 295, type: org.eclipse.pde.core.problem, attributes: [categoryId: fatal, compilerKey: compilers.p.unknown-element, lineNumber: 1384, message: Element 'with' is not legal as a child of element 'enabledWhen'., problemId: 12289, severity: 2, xmlTree.locationPath: (0)plugin>(16)extension>(0)codeMiningProvider>(0)enabledWhen>(0)with], created: 8/17/19 10:48 AM] It complains about the <with> in the following part of plugin.xml <extension point="org.eclipse.ui.workbench.texteditor.codeMiningProviders"> <codeMiningProvider class="org.eclipse.ui.internal.texteditor.codemining.annotation.AnnotationCodeMiningProvider" id="org.eclipse.ui.workbench.texteditor.annotationCodeMiningProvider"> <enabledWhen> <with variable="editorInput"> <adapt type="org.eclipse.core.resources.IFile"> <test property="org.eclipse.core.resources.contentTypeId" value="org.eclipse.core.runtime.text" args="kindOf"> </test> </adapt> </with> </enabledWhen> </codeMiningProvider> </extension> * The exact same snippet worked when I had it in org.eclipse.ui.genericeditor. * The content is also picked up at runtime (i.e. it works). * The issue is not present in the IDE. The snipped adheres to the schema in the same plugin (schema/codeMiningProviders.exsd). This schema defines the structure up to <enabledWhen> and refers the remaining part to an included schema: <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/> Our plug-in has a dependency on org.eclipse.core.expressions.
Here is the relevant stack Thread [app thread - org.eclipse.pde.api.tools.apiAnalyzer.0] (Suspended (entry into method addMarkerAttribute in ManifestErrorReporter)) ExtensionsErrorReporter(ManifestErrorReporter).addMarkerAttribute(IncrementalErrorReporter$VirtualMarker, String, String) line: 196 ExtensionsErrorReporter(ManifestErrorReporter).reportIllegalElement(Element, int) line: 48 ExtensionsErrorReporter.validateElement(Element, ISchema, boolean) line: 229 ExtensionsErrorReporter.validateElement(Element, ISchema, boolean) line: 263 ExtensionsErrorReporter.validateElement(Element, ISchema, boolean) line: 263 ExtensionsErrorReporter.validateElement(Element, ISchema, boolean) line: 263 ExtensionsErrorReporter.validateExtension(Element) line: 167 ExtensionsErrorReporter.validate(IProgressMonitor) line: 125 ExtensionsErrorReporter(XMLErrorReporter).validateContent(IProgressMonitor) line: 400 ManifestConsistencyChecker.validateFiles(IFile, int, IProgressMonitor) line: 326 ManifestConsistencyChecker.validateProject(int, IProgressMonitor) line: 245 ManifestConsistencyChecker.build(int, Map<String,String>, IProgressMonitor) line: 177 BuildManager$2.run() line: 833 SafeRunner.run(ISafeRunnable) line: 45 BuildManager.basicBuild(int, IncrementalProjectBuilder, Map<String,String>, MultiStatus, IProgressMonitor) line: 220 BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext, ICommand[], MultiStatus, IProgressMonitor) line: 263 BuildManager$1.run() line: 316 SafeRunner.run(ISafeRunnable) line: 45 BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext, MultiStatus, IProgressMonitor) line: 319 BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext, IProgressMonitor) line: 278 BuildManager.build(IBuildConfiguration, int, String, Map<String,String>, IProgressMonitor) line: 468 Project$1.run(IProgressMonitor) line: 566 Workspace.run(ICoreRunnable, ISchedulingRule, int, IProgressMonitor) line: 2295 Project.internalBuild(IBuildConfiguration, int, String, Map<String,String>, IProgressMonitor) line: 540 Project.build(int, IProgressMonitor) line: 116 ApiAnalysisApplication.start(IApplicationContext) line: 125 EclipseAppHandle.run(Object) line: 203 AnyThreadAppLauncher.run() line: 30 Thread.run() line: 834 You can get it easily by 1. running a local build from org.eclipse.ui.workbench.texteditor (patched) `mvn clean verify -Pbuild-individual-bundles,api-check` 2. Copy the Java command of the API Analysis, and add the debug flags `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=1044` just after java 3. Debug as remote Java app in the IDE.
New Gerrit change created: https://git.eclipse.org/r/147904
(In reply to Eclipse Genie from comment #2) > New Gerrit change created: https://git.eclipse.org/r/147904 With this change, API analysis (as the name suggests) would not call any other builders except API Analysis. Michael, do you think this would still catch all the API analysis issues?
>>IIRC, it's necessary to have the compilation running and some form of >>validation before invoking the API Builder. I think API builder would run on by itself and other compilation issues would be caught elsewhere. However, if java builder is required for class file , I could add java builder + api analysis build. That should definitely work. ( in my opinion)
If you think your proposal should work, I trust you. I don't have as deep knowledge of the API Tools as you do (my work was only about ochestrating it for build purpose) I'm fine if you want to try it. In the meantime, I found the cause of this specific message in Niko's patch. The reason is that the target platform doesn't include org.eclipse.core.expressions schemas; they're in the source bundle which is not included by default. As a result, the plugin validation fails. I think this could be reproduced in a plain IDE which doesn't have the org.eclipse.core.expressions.source in its target platform.
>>If you think your proposal Does the api.analysis task in gerrit build use the current eclipse's api.analysis task or previous I build's api analysis task. If it uses the current build's api task then I could combine my change with a https://git.eclipse.org/r/#/c/147726/ to check if api analysis is NOT broken with this change. If it uses previous I build's api analysis, then we have to wait for next I build to check if it works indeed.
>> they're in the source bundle which is not included by default More such inconsistencies will come in. I will recommend 1) Log this into another bug 2) Remove manifest builder and schema builder in api.analysis ( if possible)
(In reply to Vikas Chandra from comment #6) > Does the api.analysis task in gerrit build use the current eclipse's > api.analysis task or previous I build's api analysis task. At the moment, it uses the baseline (last release) itself as both the runner and baseline: https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/tree/eclipse-platform-parent/pom.xml#n1013 This could be changed to decorrelate runner (use latest I-Build) and baseline (use last release), but we'd need the build to generate a .target file describing the baseline, which isn't trivial (but still achievable).
(In reply to Mickael Istria from comment #8) > (In reply to Vikas Chandra from comment #6) > > Does the api.analysis task in gerrit build use the current eclipse's > > api.analysis task or previous I build's api analysis task. > > At the moment, it uses the baseline (last release) itself as both the runner > and baseline: > https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/ > tree/eclipse-platform-parent/pom.xml#n1013 > This could be changed to decorrelate runner (use latest I-Build) and > baseline (use last release), but we'd need the build to generate a .target > file describing the baseline, which isn't trivial (but still achievable). Is there an easy way to check if https://git.eclipse.org/r/147904 would still ensure that api.analysis would report api analysis problems. Can you try out a test case locally to see if api analysis works with this change?
Created attachment 279620 [details] Example launch file to start API Analysis from IDE > Is there an easy way to check if https://git.eclipse.org/r/147904 would still ensure that api.analysis would report api analysis problems. The attached launch file starts the API analysis from the IDE. You may be able to tweak it and see the change in action. I'll also attach a .target file that can be used as a baseline instead of the default one.
Created attachment 279623 [details] Example launch config to reproduce the issue in the IDE
Created attachment 279624 [details] Target Platform to use with Launch Config to reproduce issue in IDE
I got a hint that Jenkins jobs are thrown away pretty quickly, thus the link from the initial issue doesn't work any more. It was a build of this gerrit: https://git.eclipse.org/r/#/c/142835/
New Gerrit change created: https://git.eclipse.org/r/147936
opened Bug 550250 for removing ManifestBuilder and Schemabuilder. >In the meantime, I found the cause of this specific message in Niko's patch. >The reason is that the target platform doesn't include >org.eclipse.core.expressions schemas; they're in the source bundle which is not >included by default. As a result, the plugin validation fails. >I think this could be reproduced in a plain IDE which doesn't have the >org.eclipse.core.expressions.source in its target platform. I will investigate this via this bug
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.