Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30371

Symlinks still not supported on unix with JGit 3.7.1

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Ubuntu 12.04
      Java 1.7
      Jenkins 1.628
      git-client-plugin 1.19.0 (JGit 3.7.1.201504261725-r)
      git-plugin 2.4.0

      Configuring Jenkins to use JGit, cloning a git repo containing symlinks leads to a clone where symlinks are replaced by files. The created clone config file contains the following:

      [core]
          symlinks = false

      According to what I read in this JGit issue, I thought the issue would have been solved by meeting the following conditions:

      • running Jenkins on java 7
      • Using JGit>3.7.0, i.e. using git-client-plugin>=1.18.0

      It seems I was wrong, but I don't know where to look now.

          [JENKINS-30371] Symlinks still not supported on unix with JGit 3.7.1

          Alexandre Feblot added a comment - Or just dropping in plugins/git-client/WEB-INF/lib/ the missing jar downloaded here: http://jcenter.bintray.com/org/eclipse/jgit/org.eclipse.jgit.java7/3.7.1.201504261725-r/org.eclipse.jgit.java7-3.7.1.201504261725-r.jar (found on that page: http://mavensearch.io/repo/org.eclipse.jgit/org.eclipse.jgit.java7/3.7.1.201504261725-r ) and restart Jenkins.

          Mark Waite added a comment -

          I doubt that we can include the "java7" jar file in the current git client plugin, since I suspect that those files are a separate jar file because they require java 7. The git client plugin must continue to run on Java 6 until it is updated to depend on Jenkins 1.625 or later. Inserting a java 7 requirement risks breaking users that are running slaves on Java 6, or even users running an older Jenkins version with the master on Java 6.

          Rather than recompile, you might consider downloading the jar file as built and released by the Eclipse project. I believe it is located in the maven repository as this jar file.

          Mark Waite added a comment - I doubt that we can include the "java7" jar file in the current git client plugin, since I suspect that those files are a separate jar file because they require java 7. The git client plugin must continue to run on Java 6 until it is updated to depend on Jenkins 1.625 or later. Inserting a java 7 requirement risks breaking users that are running slaves on Java 6, or even users running an older Jenkins version with the master on Java 6. Rather than recompile, you might consider downloading the jar file as built and released by the Eclipse project. I believe it is located in the maven repository as this jar file .

          Damned, you're right, I guess. As mentionned here:

          Native symbolic links are supported, but only if you are using Java 7 or newer and include the org.eclipse.jgit.java7 jar/bundle in the classpath, provided the file system supports them. For Windows you must have Windows Vista/Windows 2008 or newer, use a non-administrator account and have the SeCreateSymbolicLinkPrivilege.]:

          Would you already be able to give me an ETA for the git client plugin update which will set Jenkins 1.625 as a req? (weeks, months, year(s)?)

          I guess there is no way to cleverly and conditionally activate the java7 jar only with Java 7 or more?

          Also, thanks for the link to the maven central jar.

          Alexandre Feblot added a comment - Damned, you're right, I guess. As mentionned here : Native symbolic links are supported, but only if you are using Java 7 or newer and include the org.eclipse.jgit.java7 jar/bundle in the classpath, provided the file system supports them. For Windows you must have Windows Vista/Windows 2008 or newer, use a non-administrator account and have the SeCreateSymbolicLinkPrivilege.]: Would you already be able to give me an ETA for the git client plugin update which will set Jenkins 1.625 as a req? (weeks, months, year(s)?) I guess there is no way to cleverly and conditionally activate the java7 jar only with Java 7 or more? Also, thanks for the link to the maven central jar.

          Mark Waite added a comment -

          The git client plugin does not move to a new base version of Jenkins until that base version is at least 6 months old. Often the base version is closer to 18 months old before the plugin is updated to use a newer base version. The 1.625 release is the first LTS release to not support Java 6, so I suspect it will be 6-9 months after the release of 1.625. That means it is at least 6 months away before Java 7 will be required for the git client plugin.

          Mark Waite added a comment - The git client plugin does not move to a new base version of Jenkins until that base version is at least 6 months old. Often the base version is closer to 18 months old before the plugin is updated to use a newer base version. The 1.625 release is the first LTS release to not support Java 6, so I suspect it will be 6-9 months after the release of 1.625. That means it is at least 6 months away before Java 7 will be required for the git client plugin.

          Hi,
          After testing, it seems that we can have the java7 jar in the plugin all the time:
          When running with Java 7 or more, we have symlinks working as expected, and with Java 6, the plugin still works properly, although without symlink functionality, of course.
          Could you give it a try?
          If you confirm, git-client could be updated without waiting 6+ months, even in the forthcoming 12.0.0, without any bad side effect.

          Alexandre Feblot added a comment - Hi, After testing, it seems that we can have the java7 jar in the plugin all the time: When running with Java 7 or more, we have symlinks working as expected, and with Java 6, the plugin still works properly, although without symlink functionality, of course. Could you give it a try? If you confirm, git-client could be updated without waiting 6+ months, even in the forthcoming 12.0.0, without any bad side effect.

          Mark Waite added a comment -

          Pull request 193 proposes the change to include symlink support with JGit on Java 7.

          Interactive testing of that change is still needed, but the automated tests pass, and the code compiles and executes tests on Java 6 and Java 7.

          Mark Waite added a comment - Pull request 193 proposes the change to include symlink support with JGit on Java 7. Interactive testing of that change is still needed, but the automated tests pass, and the code compiles and executes tests on Java 6 and Java 7.

          Thanks Mark!
          I cross my fingers now to see it merged soon.

          Alexandre Feblot added a comment - Thanks Mark! I cross my fingers now to see it merged soon.

          Code changed in jenkins
          User: Mark Waite
          Path:
          pom.xml
          http://jenkins-ci.org/commit/git-client-plugin/cce0f8b30373ebce707aaf8457640cea7fe4489d
          Log:
          JENKINS-30371 Distribute JGit java7 jar to allow JGit symlink support

          JGit symlink support is optional with JGit 3.7.1. It requires a copy of
          the JGit java7 jar, a Java 7 VM, and a file system which supports symbolic
          links. Including the jar file in a Java 6 environment is safe because
          the JGit code won't load the additional jar when running on Java 6.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: pom.xml http://jenkins-ci.org/commit/git-client-plugin/cce0f8b30373ebce707aaf8457640cea7fe4489d Log: JENKINS-30371 Distribute JGit java7 jar to allow JGit symlink support JGit symlink support is optional with JGit 3.7.1. It requires a copy of the JGit java7 jar, a Java 7 VM, and a file system which supports symbolic links. Including the jar file in a Java 6 environment is safe because the JGit code won't load the additional jar when running on Java 6.

          Code changed in jenkins
          User: Mark Waite
          Path:
          pom.xml
          src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
          http://jenkins-ci.org/commit/git-client-plugin/d48982900e34e7c821c91b124cc4d523e439570c
          Log:
          Merge pull request #193 from MarkEWaite/master-JENKINS-30371-jgit-symlinks

          [Fix JENKINS-30371] allow symlinks with jgit

          Compare: https://github.com/jenkinsci/git-client-plugin/compare/11d9be244177...d48982900e34

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: pom.xml src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java http://jenkins-ci.org/commit/git-client-plugin/d48982900e34e7c821c91b124cc4d523e439570c Log: Merge pull request #193 from MarkEWaite/master- JENKINS-30371 -jgit-symlinks [Fix JENKINS-30371] allow symlinks with jgit Compare: https://github.com/jenkinsci/git-client-plugin/compare/11d9be244177...d48982900e34

          Mark Waite added a comment -

          Fix included in git client plugin 1.19.1 released 26 Dec 2015

          Mark Waite added a comment - Fix included in git client plugin 1.19.1 released 26 Dec 2015

            markewaite Mark Waite
            alexf Alexandre Feblot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: