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

Changed SAT configuration to enable parallel builds #382

Closed
wants to merge 1 commit into from

Conversation

VelinYordanov
Copy link
Contributor

See openhab/static-code-analysis#200.
In order for the parallel builds to work spotbugs should be skipped with -Dspotbugs.skip

Signed-off-by: VelinYordanov velin.iordanov@gmail.com

@maggu2810
Copy link
Contributor

@VelinYordanov Can you point me to your findings why spotbugs does not work with parallel builds enabled? Is there some upstream report?

@kaikreuzer
Copy link
Member

@wborn As you entered openhab/static-code-analysis#200, could you review/approve this?

@VelinYordanov Did you see @maggu2810's question?

@VelinYordanov
Copy link
Contributor Author

@maggu2810 I get the following error when attempting parallel build with spotbugs:

[ERROR] Failed to execute goal org.openhab.tools.sat:sat-plugin:0.6.0-SNAPSHOT:spotbugs (verify) on project org.openhab.core.compat1x: Unable to execute mojo: Execution null of goal com.github.spotbugs:spotbugs-maven-plugin:3.1.5:spotbugs failed: java.lang.AssertionError: java.lang.ClassNotFoundException: Exception while looking for class org/eclipse/smarthome/core/types/Type: Resource not found: org/eclipse/smarthome/core/types/Type.class -> [Help 1]

Signed-off-by: VelinYordanov <velin.iordanov@gmail.com>
@wborn
Copy link
Member

wborn commented Sep 10, 2018

Sorry for all the sorting and introducing a merge conflict in this PR @VelinYordanov! I've resolved it by cherry picking your commit on the latest master. Now I only have to review and test it. ;-)

@maggu2810
Copy link
Contributor

@VelinYordanov In other projects I do not use SAT, but Spotbugs and it works for parallel builds... So is it possible that there is something different involved e.g. Tycho's bundle dependency management?

@wborn
Copy link
Member

wborn commented Nov 10, 2018

Thanks for working on openhab/static-code-analysis#200 @VelinYordanov!

I also see the spotbugs error #382 (comment) when running a parallel build. Is there a way to fix it? When we would have to use -Dspotbugs.skip not all SAT checks are run so you'd end up with a partial report. So you'd still need to run a single threaded build to see a complete report.

Updating the SAT spotbugs dependencies also does not seem to solve this issue.


Furthermore because also the report plugin is run in parallel, several errors are logged because it tries to write/delete /openhab-core/target/temp_Merge.xml in parallel. This results in the following errors:

Caused by: java.io.FileNotFoundException: /home/wouter/git/openhab/openhab-core/target/temp_Merge.xml (No such file or directory)
    at java.io.FileInputStream.open0 (Native Method)
    at java.io.FileInputStream.open (FileInputStream.java:195)
    at java.io.FileInputStream.<init> (FileInputStream.java:138)
    at java.io.FileInputStream.<init> (FileInputStream.java:93)
    at sun.net.www.protocol.file.FileURLConnection.connect (FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream (FileURLConnection.java:188)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity (Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse (Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse (Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse (Unknown Source)
    at net.sf.saxon.event.Sender.sendSAXSource (Sender.java:404)
    at net.sf.saxon.event.Sender.send (Sender.java:214)
    at net.sf.saxon.event.Sender.send (Sender.java:50)
    at net.sf.saxon.Controller.transform (Controller.java:1611)
    at org.openhab.tools.analysis.report.ReportUtility.run (ReportUtility.java:261)
    at org.openhab.tools.analysis.report.ReportUtility.generateSummaryByRules (ReportUtility.java:425)
    at org.openhab.tools.analysis.report.ReportUtility.execute (ReportUtility.java:220)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:200)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)

And also

[ERROR] Unable to delete file /home/wouter/git/openhab/openhab-core/target/temp_Merge.xml

When the sat-plugin is thread safe it should also be marked as such using @threadSafe so it will no longer show up in the list of plugins that are not thread safe:

[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project      *
[WARNING] * contains the following plugin(s) that have goals not marked   *
[WARNING] * as @threadSafe to support parallel building.                  *
[WARNING] * While this /may/ work fine, please look for plugin updates    *
[WARNING] * and/or request plugins be made thread-safe.                   *
[WARNING] * If reporting an issue, report it against the plugin in        *
[WARNING] * question, not against maven-core                              *
[WARNING] *****************************************************************
...
[WARNING] org.openhab.tools.sat:sat-plugin:0.6.0-SNAPSHOT
...
[WARNING] *****************************************************************

@maggu2810
Copy link
Contributor

@VelinYordanov As we do not use Tycho anymore, has the situation changed for spotbugs?

@maggu2810
Copy link
Contributor

@VelinYordanov Friendly ping... Did you see my last message?

@cweitkamp cweitkamp added awaiting feedback stale As soon as a PR is marked stale, it can be removed 6 months later. labels Oct 2, 2019
@kaikreuzer
Copy link
Member

Let's close this due to inactivity. We'd anyhow have to find a solution for openhab/static-code-analysis#200 first...

@kaikreuzer kaikreuzer closed this Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback infrastructure stale As soon as a PR is marked stale, it can be removed 6 months later.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants