Community
Participate
Working Groups
Build Identifier: I20100608-0911 When running the .mwe2 workflow for an Xtext grammar, it tries to write to the UI project's manifest although nothing has to be changed (the merged manifest is the same as the one on disk). As our SCM (Perforce) makes files read-only by default, we run into an exception in this case (see below). Change detection seems to work fine if I change e.g. Bundle-Vendor or if I add more required bundles. But if I add an imported package, the merge algorithm seems to detect changes although it should not. Reproducible: Always Steps to Reproduce: 1. Create a new Xtext project, using default values in the wizard, no generator project 2. In the UI project's MANIFEST.MF, add an additional imported package (e.g. antlr) 3. Make /org.xtext.example.mydsl.ui/META-INF/MANIFEST.MF read-only 4. run /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 ==> org.eclipse.emf.common.util.WrappedException: java.io.FileNotFoundException: ..\org.xtext.example.mydsl.ui\META-INF\MANIFEST.MF (Zugriff verweigert) at org.eclipse.xtext.generator.Generator.mergeManifest(Generator.java:353) at org.eclipse.xtext.generator.Generator.generateManifestUi(Generator.java:390) at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:118) at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126) at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34) at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201) at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:31) at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:80) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35) Caused by: java.io.FileNotFoundException: ..\org.xtext.example.mydsl.ui\META-INF\MANIFEST.MF (Zugriff verweigert) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.eclipse.xtext.generator.Generator.mergeManifest(Generator.java:348)
P.S.: As a workaround, I disabled manifest merging for the time being.
What a coincidence :-) Although we use SVN here a new project policy enforces that no source file must be touched during a build. The sources are write protected, and we stumbled yesterday over the same issue. Setting the mergeManifest property to false is no option, since we also don't want to have the generated manifest. So +1 for this bug from my side.
Created attachment 176978 [details] Hack (as stated in the comment) was there for other sections, added the same for import-package According to the sources, there is a "hack" in org.eclipse.xtext.generator/src/org/eclipse/xtext/generator/MergeableManifest.java // hack: reconstruct linebreaks addRequiredBundles(Collections.<String>emptySet()); addExportedPackages(Collections.<String>emptySet()); The patch I just attached adds another line calling addImportedPackages. This seems to fix the problem I encountered, but I did not dig any deeper to check how a clean solution could replace the hack ;)
MergeableManifest has been moved in the meantime. Applied the patch to org.eclipse.xtext.util.MergeableManifest. Works fine. Pushed to MASTER.
Requested via bug 522520. -M.