dsl changes break incremental maven build [message #1871595] |
Tue, 01 October 2024 13:47  |
Eclipse User |
|
|
|
Hello,
we have a Xtext dsl based application which is build continuously using maven. The xtext-maven-plugin is configured with <incrementalXtextBuild>true</incrementalXtextBuild> and maven runs without clean. When the dsl changes, the build is broken due to
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.emf.ecore.EClass.getFeatureCount()" because "eClassData.eClass" is null
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.initEClassData (BinaryResourceImpl.java:2122)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.readEClass (BinaryResourceImpl.java:2113)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.readEStructuralFeature (BinaryResourceImpl.java:2128)
at org.eclipse.xtext.builder.standalone.incremental.ExtendedEObjectInputStream.readReferenceDescriptions (ExtendedEObjectInputStream.java:135)
at org.eclipse.xtext.builder.standalone.incremental.ExtendedEObjectInputStream.readResourceDescription (ExtendedEObjectInputStream.java:91)
at org.eclipse.xtext.builder.standalone.StandaloneBuilderState.readResourceDescriptions (StandaloneBuilderState.java:310)
at org.eclipse.xtext.builder.standalone.StandaloneBuilderState.read (StandaloneBuilderState.java:277)
at org.eclipse.xtext.builder.standalone.StandaloneBuilderState.from (StandaloneBuilderState.java:255)
at org.eclipse.xtext.builder.standalone.StandaloneBuilder.readOrCreateBuilderState (StandaloneBuilder.java:338)
at org.eclipse.xtext.builder.standalone.StandaloneBuilder.launch (StandaloneBuilder.java:216)
at org.eclipse.xtext.maven.AbstractXtextGeneratorMojo.internalExecute (AbstractXtextGeneratorMojo.java:191)
at org.eclipse.xtext.maven.AbstractXtextGeneratorMojo.execute (AbstractXtextGeneratorMojo.java:163)
(In this case an EClass' name changed.)
Would it be possible to make org.eclipse.xtext.builder.standalone.StandaloneBuilder.readOrCreateBuilderState() more resilient by catching RuntimeException when reading old xtext.state and continue by creating a new StandaloneBuilderState ?
I have no idea, whether the output and stub directories have to be processed in this case too.
|
|
|
|
Re: dsl changes break incremental maven build [message #1871706 is a reply to message #1871598] |
Sat, 05 October 2024 05:30   |
Eclipse User |
|
|
|
I think you expect too much of Xtext. A prerequisite of modeling is stable metamodels.
In the past, any change and all bets were off. EMF has improved so that a stale Resource can be unloaded, setting proxies all round, then reloaded. However the refresh of all derived state such as caches is suspect. I doubt that every Xtext cache updates incrementally and I certainly doubt that it is a tested use case.
If you want to change metamodels, you should prefix your build with a has-metamodel-changed step to force a full build.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.58185 seconds