https://bugzilla.redhat.com/show_bug.cgi?id=1196167
Bug ID: 1196167 Summary: tycho-extras: One of setGitDir or setWorkTree must be called Product: Fedora Version: rawhide Component: tycho-extras Assignee: rgrunber@redhat.com Reporter: mizdebsk@redhat.com QA Contact: extras-qa@fedoraproject.org CC: eclipse-sig@lists.fedoraproject.org, mizdebsk@redhat.com, rgrunber@redhat.com
Description of problem: It looks like tycho-sourceref-jgit is not compatible with jgit used in Fedora. When trying to use tycho-sourceref-jgit from tycho-packaging-plugin, an IllegalArgumentException is thrown.
Version-Release number of selected component (if applicable): 0.22.0-2
Reproducer:
<plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-packaging-plugin</artifactId> <version>${tycho-version}</version> <configuration> <format>yyyyMMdd-HHmm</format> <sourceReferences> <generate>true</generate> </sourceReferences> </configuration> <dependencies> <dependency> <groupId>org.eclipse.tycho.extras</groupId> <artifactId>tycho-sourceref-jgit</artifactId> <version>${tycho-extras-version}</version> </dependency> </dependencies> </plugin>
Result: Caused by: java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called. at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:587) at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:554) at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:92) at org.eclipse.tycho.extras.sourceref.jgit.JGitSourceReferencesProvider.getSourceReferencesHeader(JGitSourceReferencesProvider.java:41) at org.eclipse.tycho.packaging.sourceref.SourceReferenceComputer.addSourceReferenceHeader(SourceReferenceComputer.java:50) at org.eclipse.tycho.packaging.PackagePluginMojo.updateManifest(PackagePluginMojo.java:253) at org.eclipse.tycho.packaging.PackagePluginMojo.createPluginJar(PackagePluginMojo.java:210) at org.eclipse.tycho.packaging.PackagePluginMojo.execute(PackagePluginMojo.java:138) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
https://bugzilla.redhat.com/show_bug.cgi?id=1196167
--- Comment #1 from Mikolaj Izdebski mizdebsk@redhat.com --- This seems to be caused by missing git repo in build directory. Creating git repo "fixes" the issue.
https://bugzilla.redhat.com/show_bug.cgi?id=1196167
--- Comment #2 from Roland Grunberg rgrunber@redhat.com --- I don't think this is a bug, although the error is a little cryptic. tycho-sourceref-jgit is meant to find the git repository and generate the artifact build qualifiers based on the last commit to that subproject. If there isn't git repository to be found, this will fail (See http://dev.eclipse.org/mhonarc/lists/tycho-user/msg04214.html). Upstream probably builds directly off the git repo so this works for them, but the sources shipped (git archive) have the repository stripped away.
One solution is to recreate the sources using a git shallow clone. Another is to just remove the jgit provider (http://pkgs.fedoraproject.org/cgit/eclipse.git/tree/eclipse-remove-jgit-prov...), which can be done now with macros (either %pom_remove_dep, or %pom_xpath_remove depending on whether the former supports dependencies defined within a plugin).
https://bugzilla.redhat.com/show_bug.cgi?id=1196167
--- Comment #3 from Roland Grunberg rgrunber@redhat.com --- I've added a section at https://fedoraproject.org/wiki/Tycho#Build_Qualifiers to describe this issue.
While I could imagine a modification to tycho-extras jgit timestamp provider that defaults to regular timestamps if a git repository isn't found, I'm not sure if we should really be working around this problem on behalf of users. I can keep this bug open for a while in case we decide to add such a feature.
https://bugzilla.redhat.com/show_bug.cgi?id=1196167
--- Comment #5 from Fedora End Of Life jkurik@fedoraproject.org --- This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'.
Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
https://bugzilla.redhat.com/show_bug.cgi?id=1196167
Fedora End Of Life jkurik@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution|--- |EOL Last Closed| |2016-12-20 08:17:13
--- Comment #6 from Fedora End Of Life jkurik@fedoraproject.org --- Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug.
Thank you for reporting this bug and we are sorry it could not be fixed.
eclipse-sig@lists.stg.fedoraproject.org