|Xtext builder stops eclipse build [message #1848001]
||Wed, 17 November 2021 08:05
| Stanislav Tartakowski
Registered: October 2015
i have a strange behaviour of the xtext builder (Eclipse 2021-09) which i fixed but i actually dont really understand what i did. I need clarification.
When importing maven projects into workspace (xtext and not xtext natures), Xtext builder calls needRebuild() in the method pollQueuedBuildData() because JdtQueuedBuildData returns true for needsRebuild(IProject, Deltas).
JdtQueuedBuildData has a list of unconfirmedDeltas. What are these objects? What is unconfirmed about these delta objects?
the needRebuild() call sets a flag in Eclipse's BuildManager and that leads to a loop break. So following build configs are discarded. (BuildManager.basicBuild() around line 260). But because they are discarded, the list in JdtQueueBuildData had no chance to be cleared because it contains deltas of Java Files of following build configs. So, Eclipse retries the build 10 times, Xtext Builder always sets the rebuild flag and eclipse finishes building without ever building the discarded build configs. The imported projects are all broken (not built) after import.
I fixed it by overriding XtextBuilder and overrding the method pollQueuedBuildData(IProject) with empty implementation. Now Eclipse builds all projects as expected. I am totaly confused about that Xtext Builder behaviour of requesting rebuilds. Can someone explain to me what is the Issue here?
The projects have all either only maven nature or they have java+xtext+maven natures and build commands in that order.
Some projects have java build path errors because of missing source folders.
Also this happens only in eclipse 2021-09 because before there was that other flag in the BuildManager EARLY_EXIT_FROM_INNER_BUILD_LOOP_ALLOWED which was false by default so the build loop was not exited by break no matter if xtext builder requested rebuild or not. Now this field defaults to true. So maybe only with eclipse 2021-09 this behaviour becomes actually relevent.
[Updated on: Wed, 17 November 2021 08:36]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02381 seconds