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

xtend compile errors during releasebuild #672

Closed
pfink opened this issue Mar 19, 2019 · 12 comments · Fixed by openhab/openhab-distro#896
Closed

xtend compile errors during releasebuild #672

pfink opened this issue Mar 19, 2019 · 12 comments · Fixed by openhab/openhab-distro#896
Labels

Comments

@pfink
Copy link
Contributor

pfink commented Mar 19, 2019

Currently, I try to get our releasebuild running again (see here) and I'm stuck at the following error:

[ERROR] Failed to execute goal org.eclipse.xtend:xtend-maven-plugin:2.14.0:compile (default) on project org.openhab.core.model.persistence: Error compiling xtend sources in '/var/jenkins_home/workspace/sandbox-openhab2-release/openhab-core/bundles/org.openhab.core.model.persistence/src'. -> [Help 1]

There are several compile errors like

[ERROR] 
ERROR: 	PersistenceValidator.xtend - /var/jenkins_home/workspace/sandbox-openhab2-release/openhab-core/bundles/org.openhab.core.model.persistence/src/org/eclipse/smarthome/model/persistence/validation/PersistenceValidator.xtend
24: AbstractPersistenceValidator cannot be resolved to a type.

Full Log: https://ci.openhab.org/view/Sandbox/job/sandbox-openhab2-release/1022/console

Does somebody has an idea how this can be fixed? @kaikreuzer mentioned that its probably caused by #467.

@maggu2810 Maybe you could take a look?

Thanks in advance!

@wborn
Copy link
Member

wborn commented Mar 19, 2019

Failed to execute goal org.eclipse.xtend:xtend-maven-plugin:2.14.0

Maybe it's solved when using version 2.17.0 instead? Xtend was upgraded with #650.

@kaikreuzer
Copy link
Member

My assumption when seeing cannot be resolved to a type was that it is probably not finding the generated classes, because the sequence of the build might not be as required. But I have no clue how the new bnd build does it all in comparison to Tycho before, so I'd hope that someone with bnd knowhow has an idea what might be missing here (knowing that @maggu2810 is on holiday...).

In any case, @pfink, if you could re-run the build on the latest master with Xtend 2.17, it probably cannot hurt to check the results of that!

@pfink
Copy link
Contributor Author

pfink commented Mar 21, 2019

#650 was already part of the build linked. Anyhow, 2.14 is still used at some places: https://github.com/openhab/openhab-core/search?q=%222.14%22&unscoped_q=%222.14%22

But this does not explain why maven still uses the 2.14 plugin (and thats probably the cause of the issue)...

@kaikreuzer
Copy link
Member

The bndrun files are not relevant for the build and I didn't see any pom file referencing 2.14...
So yes, it is weird that Maven still seems to use that old version of the plugin. Probably worth to find out why this is. Any idea, @wborn?

@pfink
Copy link
Contributor Author

pfink commented Mar 21, 2019

I executed mvn help:effective-pom and there is also no 2.14 version.

mvn-effective-pom.log

I also verified again that I merged changes before the last build started... Merging happend Sunday, 17th March around 20 CET, build executor started to run around 2 AM the next day.

Last but not least, I can't reproduce it locally anymore. Started a build again to verify it still occurs: https://ci.openhab.org/view/Sandbox/job/sandbox-openhab2-release/1027/console

@kaikreuzer
Copy link
Member

The Xtend compilation problem still exists, but at least Xtend 2.17 is used.

@kaikreuzer
Copy link
Member

FTR, the issue can now be reproduced on the official build: https://ci.openhab.org/view/Sandbox/job/sandbox-openhab2-release/1030/console.

@pfink It would be interesting to know, what are the differences between this build and https://ci.openhab.org/job/openHAB-Core/.

Should the same issue be reproducible by locally setting the project version of openhab-core to 2.5.0 and building it with an empty local Maven repo?

@wborn
Copy link
Member

wborn commented Mar 23, 2019

If I do a local build of that project it also executes some goals of the build-helper-maven-plugin which don't show up in the Jenkins build. This is what I see on a local build:

[INFO] ----< org.openhab.core.bundles:org.openhab.core.model.persistence >-----
[INFO] Building openHAB Core :: Bundles :: Model Persistence 2.5.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ org.openhab.core.model.persistence ---
[INFO] Deleting /home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence/target
[INFO] Deleting /home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence/xtend-gen (includes = [**], excludes = [.gitignore])
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-java) @ org.openhab.core.model.persistence ---
[INFO] 
[INFO] --- directory-maven-plugin:0.3.1:highest-basedir (directories) @ org.openhab.core.model.persistence ---
[INFO] Highest basedir set to: /home/wouter/git/openhab/openhab-core
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (default) @ org.openhab.core.model.persistence ---
[INFO] Source directory: /home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence/src-gen added.
[INFO] Source directory: /home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence/xtend-gen added.
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:add-resource (default) @ org.openhab.core.model.persistence ---
[INFO] 
[INFO] --- exec-maven-plugin:1.4.0:java (default) @ org.openhab.core.model.persistence ---
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/wouter/.m2/repository/org/slf4j/slf4j-simple/1.6.4/slf4j-simple-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/wouter/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
0    [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO  text.xtext.generator.XtextGenerator  - Initializing Xtext generator
274 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
367 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] WARN org.eclipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project slf4j.api at 'archive:file:/home/wouter/.m2/repository/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.jar!/' and using 'archive:file:/home/wouter/.m2/repository/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar!/' instead.
368 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] WARN org.eclipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.apache.commons.exec at 'archive:file:/home/wouter/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar!/' and using 'archive:file:/home/wouter/.m2/repository/org/apache/commons/commons-exec/1.1/commons-exec-1.1.jar!/' instead.
383 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] WARN org.eclipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project com.google.gson at 'archive:file:/home/wouter/.m2/repository/org/eclipse/orbit/bundles/com.google.gson/2.8.2.v20180104-1110/com.google.gson-2.8.2.v20180104-1110.jar!/' and using 'archive:file:/home/wouter/.m2/repository/com/google/code/gson/gson/2.7/gson-2.7.jar!/' instead.
389 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.StandaloneSetup - Registering project org.openhab.core.model.persistence at 'file:/home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence/'
390 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.StandaloneSetup - Registering project org.openhab.core.model.persistence.ide at 'file:/home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence.ide/'
394 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.StandaloneSetup - Using resourceSet registry. The registered Packages will not be registered in the global EPackage.Registry.INSTANCE!
510 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
512 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
520 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
520 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
494  [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO  text.xtext.generator.XtextGenerator  - Generating org.eclipse.smarthome.model.persistence.Persistence
1282 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO  nerator.ecore.EMFGeneratorFragment2  - Generating EMF model code
1569 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO org.eclipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/smarthome/model/Persistence' from 'platform:/resource/org.openhab.core.model.persistence/model/generated/Persistence.genmodel'
2438 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO  text.xtext.generator.XtextGenerator  - Generating common infrastructure
2446 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO  .emf.mwe2.runtime.workflow.Workflow  - Done.
[INFO] 
[INFO] --- xtend-maven-plugin:2.17.0:compile (default) @ org.openhab.core.model.persistence ---
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ org.openhab.core.model.persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence/src/main/resources
[INFO] Copying 1 resource
[INFO] Copying 2 resources
[INFO] Copying 1 resource
[INFO] Copying 2 resources to model
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ org.openhab.core.model.persistence ---
[INFO] Changes detected - recompiling the module!
[WARNING] /home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence/src/org/eclipse/smarthome/model/persistence/extensions/PersistenceExtensions.java:[217,9090] Redundant null check: The variable state cannot be null at this location
[WARNING] /home/wouter/git/openhab/openhab-core/bundles/org.openhab.core.model.persistence/src/org/eclipse/smarthome/model/persistence/extensions/PersistenceExtensions.java:[442,20142] Potential null pointer access: The variable lastState may be null at this location

@wborn
Copy link
Member

wborn commented Mar 23, 2019

Apparently it should run as part of the model-specific-profile which is activated based on the presence of model.profile-marker files.

@pfink
Copy link
Contributor Author

pfink commented Mar 24, 2019

Sorry, it seems like I made a mistake at my last attempt to reproduce it locally. Now I could reproduce it when executing the exact same steps as Jenkins. I tested against all differences now and finally found the cause: The unleash plugin injects the artifact-spy-plugin during the release process. When I skip this plugins injection, the build runs fine again.

Fortunately, I guess that we don't need this plugin as we currently don't use the full unleash release cycle. The spy plugin is meant to capture all released artifacts to be able to upload the artifacts at the very end of the process (after bump to the next development version, tagging, ..). The unleash does this to be able to fully rollback the release process in case something goes wrong e.g. with dev version bump or tagging. But currently, we cannot use this feature anyway as I have to interrupt the unleash release cycle to do some extra steps in between like updating properties.

I started a fresh build now which skips the spy plugin injection and hope that the whole process will completely work also without the spy plugin: https://ci.openhab.org/view/Sandbox/job/sandbox-openhab2-release/1032/

@kaikreuzer
Copy link
Member

Great, could you create a PR to remove the usage of this plugin then?

The build looks much better now, it is currently failing due to another problem, see https://github.com/openhab/openhab2-addons/pull/5194#issuecomment-476111204.

@pfink
Copy link
Contributor Author

pfink commented Mar 25, 2019

Fix: openhab/openhab-distro#896

kaikreuzer pushed a commit to openhab/openhab-distro that referenced this issue Mar 25, 2019
fixes openhab/openhab-core#672

Signed-off-by: Patrick Fink <mail@pfink.de>
Rosi2143 pushed a commit to Rosi2143/openhab-core that referenced this issue Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants