Community
Participate
Working Groups
Created attachment 235425 [details] example workspace with two projects This happens in a list of entries that allow options, such as bundle-version="xxx" resolution:=optional etc. When I miss a comma after a list entry with more than two such options, I don't even get a warning. Instead, the entire plug-in silently doesn't compile anymore and leads to compile errors in all dependent plug-ins. This is pretty hard to track down in a complex workspace. The attached workspace contains two projects: - 'bar' depends on 'foo'. - 'foo' is missing a comma in foo/META-INF/MANIFEST.MF. - Nevertheless, 'foo' appears to be completely intact. - OTOH, 'bar' has plenty of compile errors due to the error in the other plug-in. In my case, the missing comma resulted from a git merge conflict. So this is not a very pathological example. A missing comma is detected only if there are zero or one options on a list entry.
When we ask OSGi to create a bundle description for the project, it throws a BundleException because of the bad header (duplicate attributes). PDE hides this error and still creates a model without a bundle description (probably to support pre-OSGi plug-ins). The BundleErrorReporter only does limited checking if no bundle description is available. I will look at throwing the exception so it would be logged. If possible the BundleErrorReporter should report any broken headers.
Fixed in master http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=b2962fcdb28f4ab8efccf2d588cf099d4a2a37de We now log the BundleException (just the message, not a full stack trace). This can pollute the log a bit if you have a broken manifest and keep restarting or modifying the plug-in. I think this is acceptable over silently failing. If no bundle description was created, the error reporter attempts to create one again to replicate the BundleException. While it would be smarter to save some sort of error state on the model, there isn't time to make such a major change. If there is some other way to validate the manifest headers we could do that instead, but as far as I know the only other validation is jar manifest syntax which we already check.
Just for clarification: Will that also cause an error marker on the MANIFEST.MF or just a log message?
(In reply to Jan Koehnlein from comment #3) > Just for clarification: Will that also cause an error marker on the > MANIFEST.MF or just a log message? Both. When the model state fails to create a bundle description, the error is logged. When the PDE Builder (Bundle error reporter) runs and sees that no bundle description exists, it tries to create a bundle description and creates an error marker from the message.
Great. Thanks a lot!