Community
Participate
Working Groups
Build Identifier: Indigo - 201106220900 When building manifest-first Eclipse plug-ins, Tycho considers MANIFEST.MF provided, and produces slightly modified MANIFEST.MF in a target. When 'Export-Package: ' header is placed after 'Import-Package: ', Tycho ignores it, and doesn't include in target. This structure seems to be valid, as we used this structure of MANIFEST.MF along with working plugins. Example of MANIFEST.MF (Export-Package at the end, and will be ignored by Tycho): Manifest-Version: 1.0 Bundle-Version: 1.0.0.qualifier Tool: Bnd-0.0.357 Bundle-Name: first-bundle Bnd-LastModified: 1334819004300 Created-By: 1.6.0_25 (Sun Microsystems Inc.) Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.mydemo.first-bundle Import-Package: org.codehaus.plexus.util Bundle-Localization: plugin Export-Package: org.mydemo Reproducible: Always Steps to Reproduce: 1. Create very simple project to be built with Tycho; packagin = 'eclipse-plugin'. Example of such POM file is: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.mydemo</groupId> <artifactId>org.mydemo.first-bundle</artifactId> <packaging>eclipse-plugin</packaging> <version>1.0.0-SNAPSHOT</version> <properties> <tycho.ver>0.14.1</tycho.ver> </properties> <repositories> <repository> <id>helios</id> <layout>p2</layout> <url>http://download.eclipse.org/releases/indigo</url> </repository> </repositories> <build> <plugins> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-maven-plugin</artifactId> <version>${tycho.ver}</version> <extensions>true</extensions> </plugin> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>target-platform-configuration</artifactId> <version>${tycho.ver}</version> <configuration> <pomDependencies>consider</pomDependencies> </configuration> </plugin> </plugins> </build> </project> 2. Provide the following MANIFEST.MF in META-INF: Manifest-Version: 1.0 Bundle-Version: 1.0.0.qualifier Tool: Bnd-0.0.357 Bundle-Name: first-bundle Bnd-LastModified: 1334819004300 Created-By: 1.6.0_25 (Sun Microsystems Inc.) Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.mydemo.first-bundle Import-Package: org.codehaus.plexus.util Bundle-Localization: plugin Export-Package: org.mydemo 3. create some very simple package in src/main/java -- in this case org/mydemo 4. Try building, and the target MANIFEST.MF looks as following (notice there's no Export-Package): Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: 1.6.0_25 (Sun Microsystems Inc.) Built-By: arturs.licis Build-Jdk: 1.6.0_25 Bundle-Version: 1.0.0.201204200712 Tool: Bnd-0.0.357 Bundle-Localization: plugin Bnd-LastModified: 1334819004300 Bundle-Name: first-bundle Bundle-ManifestVersion: 2 Import-Package: org.codehaus.plexus.util Bundle-SymbolicName: org.mydemo.first-bundle
Created attachment 214289 [details] Example, as provided in 'steps to reporoduce'
*** This bug has been marked as a duplicate of bug 376543 ***
build.properties was missing because I tried to create a minimalistic example, and was not aware of issue you've marked as duplicated. Adding build.properties does not solve the issue I've describe, and Export-Package is still removed.
last line in MANIFEST.MF not terminated by a line break, see screenshot
Created attachment 214302 [details] MANIFEST editor error
Yes, that was the case -- missing line break. I wonder if Eclipse is able to read such plug-ins, because I faced this problem when tried to migrate builds of existing plug-ins. Since Tycho parses MANIFEST.MF, and creates a modified version, warning about some line being ignored is a nice to have.
Probably the build should fail in this case, right?
(In reply to comment #7) > Probably the build should fail in this case, right? Ideally yes, but the MANIFEST parser we are using (org.eclipse.osgi.framework.util.Headers ) seems to be lenient in this regard. Need to investigate which parser the PDE MANIFEST editor is using and whether it's possible or worth it using a stricter parser.
PDE UI has a more strict manifest parser [1] which causes the problem to be detected as in editor screenshot, but it's too entangled with PDE for reuse in tycho. BND has a bundle verifier but it's on semantic level only and reuses java.util.jar.Manifest for low-level parsing which does not detect missing linebreaks neither [2]. For now I don't think we can catch the missing line break problem with acceptable effort. [1] http://git.eclipse.org/c/pde/eclipse.pde.ui.git/tree/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/JarManifestErrorReporter.java#n109 [2] https://github.com/bndtools/bnd/blob/master/biz.aQute.bndlib/src/aQute/lib/osgi/Verifier.java#L190
Could we not combine our currently used parser with an additional end of file check? AFAIK, the last characters in a MANIFEST.MF must always be a line break.
"AFAIK, the last characters in a MANIFEST.MF must always be a line break." :( Could you throw an error or add the missing line break?
(In reply to comment #11) > "AFAIK, the last characters in a MANIFEST.MF must always be a line break." > > :( Could you throw an error or add the missing line break? see PDE discussion on bug 256787 basically the only manifest parser implementation I know of which handles the missing line break correctly/fixes it automatically for you is in PDE. As of now PDE parser can't be easily reused as 1. it's not available as a maven artifact 2. it will drag in lots of unwanted dependencies MANIFEST format is known to be obscure (e.g. 72 *byte* line length limit etc.) and not editable by humans without proper editor support. For now I have to say if you use anything else than the PDE manifest editor to edit MANIFEST files, you are doomed.
Just created a gerrit changeset to add validation of Manifest-Files regarding missing empty line at the end of it: https://git.eclipse.org/r/136046
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required. 0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done if issue is still present when latest release: * Create a new issue at https://github.com/eclipse/tycho/issues/ ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience) ** In the GitHub description, start with a link to this bugzilla ticket ** Optionally add new content to the description if it can helps towards resolution ** Submit GitHub issue * Update bugzilla ticket ** Add to "See also" property (up right column) the link to the newly created GitHub issue ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>" ** Set status as CLOSED MOVED ** Submit All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.