Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364446

Summary: [xtext][builder] link errors with projects containing multiple grammars
Product: [Modeling] TMF Reporter: Knut Wannheden <knut.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 2.1.1Flags: sebastian.zarnekow: juno+
Target Milestone: M4   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Knut Wannheden CLA 2011-11-22 04:05:20 EST
If an Xtext project contains multiple interdependent Xtext grammars a build is likely to result in linking error markers. The reason is that the Xtext language implementation doesn't use the lazy linker and all linking is already done as part of the first build phase. At this point any referenced EPackages may not yet be present in the index (e.g. when doing a clean build).

The builder is likely to keep the Xtext grammar resource in its resource set for the second build phase. Again as the lazy linker isn't used the linking errors remain.

Either the Xtext implementation should start using the lazy linker or the builder must be able to detect such situations and reload the resources in the second build phase. Or maybe both.
Comment 1 Knut Wannheden CLA 2011-11-22 04:07:09 EST
A workaround is to use platform:/resource URIs instead of the EPackage nsURIs when importing EPackages. This works because these are not resolved against the index.
Comment 2 Sebastian Zarnekow CLA 2011-11-22 05:51:18 EST
We'll use the DerivedStateAwareResource for the Xtext language and do the complete linking as part of the derived state computation.
Comment 3 Sebastian Zarnekow CLA 2011-11-22 10:44:39 EST
Pushed to master.
Comment 4 Karsten Thoms CLA 2017-09-19 17:04:47 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:16:45 EDT
Closing all bugs that were set to RESOLVED before Neon.0