Community
Participate
Working Groups
Our build produces an API Tools verification report but it would be better to run the PDE API Tools builder during the build, so that we get errors and warnings. This would be especially helpful for Gerrit changes.
As mentioned in a status meeting, it would be best to convert the "API Tools verification" task to a maven plugin, in order to implement this. It would also likely require some "re-design" since the current way we do this is on "SDK as a whole" which does not make much sense for a "Gerrit job" that only builds one repository (or, one bundle). If nothing else, would be faster to run on a subset ... I am assuming the "whole SDK" takes a long time, but honestly have not measured it.
We could also simple add a Ant build step in our Gerrit build. Sravan, could you share the wiki / command how to run the API tools check via Ant?
(In reply to Lars Vogel from comment #2) > We could also simple add a Ant build step in our Gerrit build. > Sravan, could you share the wiki / command how to run the API tools check > via Ant? It would be the simplest approach, but API Tools currently are only able to create report, that still need human processing. In order to make things fully automated and valuable, we first need an option for the API Tools to *fail* (ie app exists with a non-0 code) in case of inconsistency. Then, adding this as a build step would fail the build.
(In reply to Mickael Istria from comment #3) > (In reply to Lars Vogel from comment #2) > > We could also simple add a Ant build step in our Gerrit build. > > Sravan, could you share the wiki / command how to run the API tools check > > via Ant? > > It would be the simplest approach If someone tells me how to add this Ant step to the Gerrit verification build, I guess return a failure if case of a negative result for Jenkins should be trivial. If the Ant things is implemented, I can have a look for failing the build, if no one else steps up.
(In reply to Lars Vogel from comment #2) > We could also simple add a Ant build step in our Gerrit build. > > Sravan, could you share the wiki / command how to run the API tools check > via Ant? We use previous successful eclipse build to run api tools Here is the script. https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/tree/cje-production/mbscripts/mb510_createApiToolsReports.sh Here the LAUNCHER_JAR points to the launcher from the eclipse installation Here is a script to create eclipse instance with all the necessary plugins https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/tree/cje-production/mbscripts/mb020_createBaseBuilder.sh Here is the documentation on apitooling's ant tasks. https://help.eclipse.org/2019-03/nav/4_3_0_0 The ant tasks talk about apitools-ant.jar. But I don't think we are building it anymore.
I think it would be a bit simpler to write some IApplication in API Tools directly rather than relying on Ant here; both in term of implementation and usage.
(In reply to Mickael Istria from comment #6) > I think it would be a bit simpler to write some IApplication in API Tools > directly rather than relying on Ant here; both in term of implementation and > usage. Can you try that?
(In reply to Lars Vogel from comment #7) > Can you try that? Not right now, but I'm discussing with Alex and it's something I may be able to try next week or the week after that.
(In reply to Mickael Istria from comment #8) > Not right now, but I'm discussing with Alex and it's something I may be able > to try next week or the week after that. Awesome Mickael, thanks.
New Gerrit change created: https://git.eclipse.org/r/142204
Gerrit change https://git.eclipse.org/r/142204 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?id=8e0776f3aed831e254057b57cfcbc747f3acf299
See how this can look like once bug 547206 is fixed: https://git.eclipse.org/r/#/c/142341/1/bundles/org.eclipse.jface.databinding/pom.xml
https://ci.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/18367/console This failed to execute ( as expected as api-analysis is still not in build). I will commit bug 547206 and re-trigger this with tomorrow's build.
New Gerrit change created: https://git.eclipse.org/r/142534
I assume this is planned for 4.13.
New Gerrit change created: https://git.eclipse.org/r/142665
Gerrit change https://git.eclipse.org/r/142534 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?id=b0b34823cbc17dd8710124c640930f094eeac8ce
The CI build triggered by shows that 1. API checks seem to run, but 2. API analyzer app is not tolerant to other errors in workspace, and some plugins do have errors in their plugin.xml so API analyzer fails the build for an unrelated reason. Should we just fix the bundle that have errors by turning those errors into warnings if they're not causing actual failures; or should we instruct the API Analyzer app to ignore some errors? The issue with the later is that we can't know which error are blockers for API Tools processing.
(In reply to Mickael Istria from comment #18) > The CI build triggered by shows that > 1. API checks seem to run, but > 2. API analyzer app is not tolerant to other errors in workspace, and some > plugins do have errors in their plugin.xml > so API analyzer fails the build for an unrelated reason. > > Should we just fix the bundle that have errors by turning those errors into > warnings if they're not causing actual failures; or should we instruct the > API Analyzer app to ignore some errors? The issue with the later is that we > can't know which error are blockers for API Tools processing. IMHO warnings should be fixed as any white/black listing should be done on per bundle basis in the bundle configs.
So the actual (first known) issue is * Marker [on: /org.eclipse.osgi/plugin.xml, id: 144, type: org.eclipse.pde.core.problem, attributes: [categoryId: , compilerKey: compilers.p.unresolved-ex-points, lineNumber: 5, message: Unknown extension point: 'org.eclipse.ui.trace.traceComponents', problemId: 4135, severity: 2], created: 5/31/19, 7:01 PM] Some blocking (most likely link/compilation) errors are present ^^^ Indeed, the org.eclipse.ui.trace bundle is not in the target-platform for org.eclipse.osgi (that's a good thing per se). However, I don't see a way to turn those errors as warnings.
(In reply to Mickael Istria from comment #20) > So the actual (first known) issue is > > * Marker [on: /org.eclipse.osgi/plugin.xml, id: 144, type: > org.eclipse.pde.core.problem, attributes: [categoryId: , compilerKey: > compilers.p.unresolved-ex-points, lineNumber: 5, message: Unknown extension > point: 'org.eclipse.ui.trace.traceComponents', problemId: 4135, severity: > 2], created: 5/31/19, 7:01 PM] > Some blocking (most likely link/compilation) errors are present ^^^ > > Indeed, the org.eclipse.ui.trace bundle is not in the target-platform for > org.eclipse.osgi (that's a good thing per se). > However, I don't see a way to turn those errors as warnings. See PDEPreferencesTestCase::testCompilerPreferences ( there are options to set preference too) (plugin : org.eclipse.pde.ui.tests) Project PDE compiler settings "compilers.p.unresolved-ex-points=0" in org.eclipse.pde.prefs in .settings folder in project sets this compiler issue to ignore. ( 1 for warning and 2 for error).
New Gerrit change created: https://git.eclipse.org/r/143216
New Gerrit change created: https://git.eclipse.org/r/143218
Gerrit change https://git.eclipse.org/r/143216 was merged to [master]. Commit: http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=e36c67ba1fa688f046a7cbeca8a0166c9602aaf3
Gerrit change https://git.eclipse.org/r/143218 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=71591515d4186127bf860433ae9b9286a4cbaaef
With https://git.eclipse.org/r/#/c/142665/ , all the configuration is contained in a profile, that's opt-in. Then, once this parent pom is available (`mvn install`ed locally or found on remote repo), once can run any Gerrit or local build with mvn clean verify -Pbuild-individual-bundles,api-check This will add a few extra build step the do report API failures. To try it, you can take a bundle like org.eclipse.compare.core, build it with command above and parent pom installed locally => Build says "0 API ERRORS 0 API warnings". Then, add a public string to an API like IHunk, do NOT change MANIFEST.MF, save, commit, build with same command => ``` 2 API ERRORS * Marker [on: /org.eclipse.compare.core/META-INF/MANIFEST.MF, id: 18, type: org.eclipse.pde.api.tools.version_numbering, attributes: [apiMarkerID: 4, charEnd: 152, charStart: 135, description: - The field org.eclipse.compare.patch.IHunk.STING has been added in an interface that is tagged with '@noimplement' , lineNumber: 5, message: The minor version should be incremented in version 3.6.500, since new APIs have been added since version 3.6.500, messagearguments: 3.6.500#3.6.500, problemid: 924844039, severity: 2, sourceId: API Tools, version: 3.7.0.qualifier], created: 6/12/19, 2:29 PM] * Marker [on: /org.eclipse.compare.core/src/org/eclipse/compare/patch/IHunk.java, id: 17, type: org.eclipse.pde.api.tools.marker.sincetags, attributes: [apiMarkerID: 5, charEnd: 1477, charStart: 1472, lineNumber: 40, message: Missing @since tag on STING, messagearguments: STING, org.eclipse.jdt.internal.core.JavaModelManager.handleId: =org.eclipse.compare.core/src<org.eclipse.compare.patch{IHunk.java[IHunk^STING, problemTypeName: org.eclipse.compare.patch.IHunk, problemid: 1211105284, severity: 2, sourceId: API Tools, version: 3.6], created: 6/12/19, 2:29 PM] 0 API warnings ``` Once https://git.eclipse.org/r/#/c/142665/ is merged, we can progressively enable the profile on the Gerrit job, and start brainstorming of a new hot topic for frequent quarrels as a replacement ;)
Gerrit change https://git.eclipse.org/r/142665 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?id=b6501bbc0d26d9a12615d068276f5f9dd3dd9066
Thanks for the merge. The `api-check` profile is now available for wider usage and can be tried locally. It still has an important flaw that prevents from enabling it on Gerrit builds though: bug 548242 .
New Gerrit change created: https://git.eclipse.org/r/144093
New Gerrit change created: https://git.eclipse.org/r/144123
New Gerrit change created: https://git.eclipse.org/r/144127
Bug 548279 isn't a blocker for this one.
Gerrit change https://git.eclipse.org/r/144093 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=ae5f55427c488585943aac0f57c2ff1d3397ab9e
Gerrit change https://git.eclipse.org/r/144127 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=e5a76f7a917e31c5ff096c8f00fa9a13a9ae69a9
The api-check profile is now enabled on Gerrit jobs eclipse.platform.team-Gerrit and eclipse.platform.resources-Gerrit and works as expected. I've submitted a patch to merge in JDT/Core before we can enable the profile on it: https://git.eclipse.org/r/144123 I'll try to process all other Equinox/Platform jobs by the end of the week. Assistance is welcome: just run `mvn clean verify -DskipTests -Papi-check,build-individual-bundles` locally, adjust some preferences if needed (usually maling «missing extension point» a warning by tweaking the org.eclipse.pde.prefs as shown in other commits), and push a patch.with the modification and/or tweak the CI job to enable the profile.
Thanks Mickael for working on this. I see in resources an error now: [ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-eclipserun-plugin:1.4.0:eclipse-run (api-analysis) on project org.eclipse.core.filesystem.linux.ppc64le: Execution api-analysis of goal org.eclipse.tycho.extras:tycho-eclipserun-plugin:1.4.0:eclipse-run failed: Cannot resolve dependencies of null: See log for details -> [Help 1] Can you please have a look?
(In reply to Lars Vogel from comment #36) > Can you please have a look? The IMO too prompt revert of some other commit is causing that. I won't work on the issue you found until we're done with bug 548242 as doing it the other way round would be a waste of time for me.
(In reply to Mickael Istria from comment #37) > (In reply to Lars Vogel from comment #36) > > Can you please have a look? > > The IMO too prompt revert of some other commit is causing that. I won't work > on the issue you found until we're done with bug 548242 as doing it the > other way round would be a waste of time for me. +1, makes sense.
New Gerrit change created: https://git.eclipse.org/r/144527
Gerrit change https://git.eclipse.org/r/144527 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=7757dfc66e70003c0d3b546af66aba962b4fa44e
New Gerrit change created: https://git.eclipse.org/r/144539
Gerrit change https://git.eclipse.org/r/144539 was merged to [master]. Commit: http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=b1ecd006bfe55fc077015cc7ddece8825e013d9f
New Gerrit change created: https://git.eclipse.org/r/144629
New Gerrit change created: https://git.eclipse.org/r/144635
Gerrit change https://git.eclipse.org/r/144629 was merged to [master]. Commit: http://git.eclipse.org/c/equinox/rt.equinox.p2.git/commit/?id=e7181f09868b38efa221772468c0be3ce12a304c
Gerrit change https://git.eclipse.org/r/144635 was merged to [master]. Commit: http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=ae4ad58306281aa53160c31ad9a073ee3880d35c
New Gerrit change created: https://git.eclipse.org/r/144657
New Gerrit change created: https://git.eclipse.org/r/144661
Gerrit change https://git.eclipse.org/r/144123 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=501cbe8e5bcbee952acadfeeef72676aa4732630
Gerrit change https://git.eclipse.org/r/144661 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ua.git/commit/?id=daa5966bc026935706ed6555fb27de8bcc046d45
New Gerrit change created: https://git.eclipse.org/r/144701
Gerrit change https://git.eclipse.org/r/144701 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.tools.git/commit/?id=e7079464f0cade1a4e8fb2b62cfd6af43d67fcd2
New Gerrit change created: https://git.eclipse.org/r/144710
New Gerrit change created: https://git.eclipse.org/r/144713
Gerrit change https://git.eclipse.org/r/144710 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=6bfbe22c12342e93ef2d0c6848686512afdfc029
New Gerrit change created: https://git.eclipse.org/r/144719
Gerrit change https://git.eclipse.org/r/144719 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=edcad2307a2bc04210522a763303aad951e7e327
New Gerrit change created: https://git.eclipse.org/r/144723
This is now enabled on most Gerrit builds Some exceptions: * eclipse.platform.runtime => Stuck by bug 547877 * eclipse.platform.ui => Stuck by bug 548249 * eclipse.jdt.core => need `api-check` profile to be added to CI Job * eclipse.jdt.ui => https://git.eclipse.org/r/144723 + need `api-check` profile to be added to CI Job * eclipse.jdt.debug => https://git.eclipse.org/r/144713 + need `api-check` profile to be added to CI Job * eclipse.pde.ui => https://git.eclipse.org/r/c/144657/ + need `api-check` profile to be added to CI Job * eclipse.pde.build -> need `api-check` profile to be added to CI Job We're also unveiling some glitches in the application itself. Not blockers and API Check still provide value and catches a wide variety of issues, but it seems to miss some bug 548574
* eclipse.jdt.core has -Papi-check enabled, and seems to be running ( https://ci.eclipse.org/jdt/job/eclipse.jdt.core-Gerrit/2061/consoleFull ) .
(In reply to Roland Grunberg from comment #60) > * eclipse.jdt.core has -Papi-check enabled, and seems to be running ( > https://ci.eclipse.org/jdt/job/eclipse.jdt.core-Gerrit/2061/consoleFull ) . Right thanks. Those lines of log confirm it's running """ 10:06:02 [INFO] --- tycho-eclipserun-plugin:1.4.0:eclipse-run (api-analysis) @ org.eclipse.jdt.core --- 10:06:02 [INFO] Toolchain in tycho-eclipserun-plugin: JDK[/opt/public/common/jdk1.8.0_x64-latest/jre] 10:06:02 [INFO] Expected eclipse log file: /jobs/genie.jdt/eclipse.jdt.core-Gerrit/workspace/org.eclipse.jdt.core/target/eclipserun-work/data/.metadata/.log 10:06:02 [INFO] Command line: 10:06:02 [/opt/public/common/jdk1.8.0_x64-latest/jre/bin/java, -Xmx2048M, -jar, /jobs/genie.jdt/eclipse.jdt.core-Gerrit/workspace/.repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.5.400.v20190515-0925/org.eclipse.equinox.launcher-1.5.400.v20190515-0925.jar, -install, /jobs/genie.jdt/eclipse.jdt.core-Gerrit/workspace/org.eclipse.jdt.core/target/eclipserun-work, -configuration, /jobs/genie.jdt/eclipse.jdt.core-Gerrit/workspace/org.eclipse.jdt.core/target/eclipserun-work/configuration, -data, /jobs/genie.jdt/eclipse.jdt.core-Gerrit/workspace/org.eclipse.jdt.core/../target/org.eclipse.jdt.core-apiAnalyzer-workspace, -application, org.eclipse.pde.api.tools.apiAnalyzer, -project, /jobs/genie.jdt/eclipse.jdt.core-Gerrit/workspace/org.eclipse.jdt.core, -baseline, default, -dependencyList, /jobs/genie.jdt/eclipse.jdt.core-Gerrit/workspace/org.eclipse.jdt.core/target/dependencies-list.txt, -failOnError] 10:06:02 Picked up JAVA_TOOL_OPTIONS: -Xmx2G -Djava.io.tmpdir=/tmp/genie.jdt 10:06:37 0 API ERRORS 10:06:37 37 API warnings """
Gerrit change https://git.eclipse.org/r/144657 was merged to [master]. Commit: http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=7bbc94fed080e75c1e9aefc75a37a70ef55701bc
Gerrit change https://git.eclipse.org/r/144713 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=ebcac95c1e8f7fdb5fa88b53f326ceabd2323399
New Gerrit change created: https://git.eclipse.org/r/144803
New Gerrit change created: https://git.eclipse.org/r/144823
New Gerrit change created: https://git.eclipse.org/r/144858
New Gerrit change created: https://git.eclipse.org/r/144865
Gerrit change https://git.eclipse.org/r/144803 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=08db2143bd1811a9fa69b1554a7ebdfa9514956a
Gerrit change https://git.eclipse.org/r/144858 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=9a5823ca83c555ece40d89b8af0f53780b79e792
New Gerrit change created: https://git.eclipse.org/r/144999
Gerrit change https://git.eclipse.org/r/144999 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=3e2c3675343c3c0e8098a85920be0473749fde60
And with this last commit, we're done. On Gerrit jobs, Jenkins will report a failure for API Tools errors. To run the checks locally, add the `-Papi-check` profile to your local build command.
(In reply to Mickael Istria from comment #72) > And with this last commit, we're done. > On Gerrit jobs, Jenkins will report a failure for API Tools errors. > To run the checks locally, add the `-Papi-check` profile to your local build > command. Currently we get the following in the console when it fails: [ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-eclipserun-plugin:1.6.0:eclipse-run (api-analysis) on project org.eclipse.jdt.ui: Error while executing platform: Error while executing platform (return code: 4) -> [Help 1] Are there (somewhere) more details why it fails?
(In reply to Dani Megert from comment #73) > Currently we get the following in the console when it fails: > > [ERROR] Failed to execute goal > org.eclipse.tycho.extras:tycho-eclipserun-plugin:1.6.0:eclipse-run > (api-analysis) on project org.eclipse.jdt.ui: Error while executing > platform: Error while executing platform (return code: 4) -> [Help 1] > > Are there (somewhere) more details why it fails? Do you know a CI build I can see with this issue? Or some steps to reproduce? I think it could be related to usage of -fae: the api comparison mojo writes issues in the log and continues the build if -fae is set, then at the end of the build, the error is shown but not the logged messages (similarly to test mojo reporting "test failures" but not giving details in the error message so you need to scroll up). Were you using -fae?
(In reply to Mickael Istria from comment #74) > (In reply to Dani Megert from comment #73) > > Currently we get the following in the console when it fails: > > > > [ERROR] Failed to execute goal > > org.eclipse.tycho.extras:tycho-eclipserun-plugin:1.6.0:eclipse-run > > (api-analysis) on project org.eclipse.jdt.ui: Error while executing > > platform: Error while executing platform (return code: 4) -> [Help 1] > > > > Are there (somewhere) more details why it fails? > > Do you know a CI build I can see with this issue? > Or some steps to reproduce? https://ci.eclipse.org/jdt/job/eclipse.jdt.ui-Gerrit/4212/ > I think it could be related to usage of -fae: the api comparison mojo writes > issues in the log and continues the build if -fae is set, then at the end of > the build, the error is shown but not the logged messages (similarly to test > mojo reporting "test failures" but not giving details in the error message > so you need to scroll up). > Were you using -fae? I don't know. I didn't configure the JDT job.
(In reply to Dani Megert from comment #75) > > Do you know a CI build I can see with this issue? > > Or some steps to reproduce? > https://ci.eclipse.org/jdt/job/eclipse.jdt.ui-Gerrit/4212/ If you scroll a few lines up, you see the details and the specific API Error, so the cause is close enough. At the moment, I don't think Tycho eclipse-run goal can allow the application to return a specific error message, nor a way to map an exit code with a specific message. Please open a ticket against Tycho for that so we can investigate possible ways to improve this message.
(In reply to Mickael Istria from comment #76) > (In reply to Dani Megert from comment #75) > > > Do you know a CI build I can see with this issue? > > > Or some steps to reproduce? > > https://ci.eclipse.org/jdt/job/eclipse.jdt.ui-Gerrit/4212/ > > If you scroll a few lines up, you see the details and the specific API > Error, so the cause is close enough. No one will find this since it is not marked as [Error]. At least the final error should tell the user to look above in the log for API Errors.