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

Subversion checkouts creates files for symlinks

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • subversion-plugin
    • None
    • Platform: All, OS: Linux

      The check out of project containing checked in symlinks creates a workspace
      with files instead of symlinks. E.g., creating a repository containing
      the elements:

      $ svn co file://$PWD/test/trunk/data
      A data/file.link
      A data/file.txt
      Checked out revision 3.
      $ ls -l data
      total 12
      lrwxrwxrwx 1 mrohan mrohan 8 Jun 28 17:55 file.link -> file.txt
      rw-rw-r- 1 mrohan mrohan 16 Jun 28 17:55 file.txt

      Within Hudson, the workspace contains the elements:

      $ ls -l data
      total 16
      rw-rw-r- 1 hudson hudson 13 Jun 28 17:53 file.link
      rw-rw-r- 1 hudson hudson 16 Jun 28 17:53 file.txt
      $ cat data/file.link
      link file.txt

      There is no newline in the file created.

        1. output.1.310.txt
          0.5 kB
        2. output.1.311.txt
          0.5 kB
        3. svnkit.w-def.0.log
          12 kB
        4. svnkit.wo-def.0.log
          12 kB

          [JENKINS-3949] Subversion checkouts creates files for symlinks

          in SubversionSCM.java lines 1656-1658:
          // work around for
          http://www.nabble.com/Slow-SVN-Checkout-tf4486786.html
          if(System.getProperty("svnkit.symlinks")==null)
          System.setProperty("svnkit.symlinks","false");

          could this be the cause of the problem on Hudson Unix nodes?

          the SVNKit FAQ suggests to disable symlinks only for 'older' versions of SVNKit,
          whilst for the latest one with proper JNA support (as in svnkit/1.3.0-hudson-1)
          symlinks feature should remain enabled.

          Andrea Barbieri added a comment - in SubversionSCM.java lines 1656-1658: // work around for http://www.nabble.com/Slow-SVN-Checkout-tf4486786.html if(System.getProperty("svnkit.symlinks")==null) System.setProperty("svnkit.symlinks","false"); could this be the cause of the problem on Hudson Unix nodes? the SVNKit FAQ suggests to disable symlinks only for 'older' versions of SVNKit, whilst for the latest one with proper JNA support (as in svnkit/1.3.0-hudson-1) symlinks feature should remain enabled.

          mkrohan added a comment -

          I'm not familiar with the Hudson code base, but the snippet included
          suggested running Hudson with "java -Dsvnkit.symlinks=true -jar hudson.jar"
          would enable symlinks. I tried this for v1.314 and I'm afraid I'm still
          seeing a file containing "link file.txt". This does not invalidate the
          coding suggestion, just additional info.

          mkrohan added a comment - I'm not familiar with the Hudson code base, but the snippet included suggested running Hudson with "java -Dsvnkit.symlinks=true -jar hudson.jar" would enable symlinks. I tried this for v1.314 and I'm afraid I'm still seeing a file containing "link file.txt". This does not invalidate the coding suggestion, just additional info.

          Have you tried turning on some debugging?
          https://wiki.svnkit.com/Troubleshooting

          with the file logging.properties:
          svnkit.level=FINEST
          svnkit-network.level=FINEST
          svnkit-fsfs.level=FINEST
          svnkit-wc.level=FINEST
          svnkit-cli.level=FINEST
          #
          handlers = java.util.logging.FileHandler

          #java.util.logging.FileHandler.pattern = %h/svnkit.%u.log
          java.util.logging.FileHandler.pattern = svnkit.%u.log
          java.util.logging.FileHandler.limit = 0
          java.util.logging.FileHandler.count = 1
          java.util.logging.FileHandler.append = false
          java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

          turning on some debugging for Hudson would help especially for
          hudson.scm.Initializer to check if somehow svnkit.symlinks is set to false

          Andrea Barbieri added a comment - Have you tried turning on some debugging? https://wiki.svnkit.com/Troubleshooting with the file logging.properties: svnkit.level=FINEST svnkit-network.level=FINEST svnkit-fsfs.level=FINEST svnkit-wc.level=FINEST svnkit-cli.level=FINEST # handlers = java.util.logging.FileHandler #java.util.logging.FileHandler.pattern = %h/svnkit.%u.log java.util.logging.FileHandler.pattern = svnkit.%u.log java.util.logging.FileHandler.limit = 0 java.util.logging.FileHandler.count = 1 java.util.logging.FileHandler.append = false java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter turning on some debugging for Hudson would help especially for hudson.scm.Initializer to check if somehow svnkit.symlinks is set to false

          mkrohan added a comment -

          This logging suggestion worked: my initial test of "svnkit.symlinks"
          was not valid as the test job had "Use update" enabled. Disabling this,
          i.e., forcing a clean checkout, with "-Dsvnkit.symlinks=true" on the
          java command line generated a workspace with the expected symlinks
          instead of files.

          For your reference, I'm attaching the svnkit logs for the runs without
          the svnkit.symlinks defn, and with the definitions.

          mkrohan added a comment - This logging suggestion worked: my initial test of "svnkit.symlinks" was not valid as the test job had "Use update" enabled. Disabling this, i.e., forcing a clean checkout, with "-Dsvnkit.symlinks=true" on the java command line generated a workspace with the expected symlinks instead of files. For your reference, I'm attaching the svnkit logs for the runs without the svnkit.symlinks defn, and with the definitions.

          mkrohan added a comment -

          Created an attachment (id=769)
          SVNKit log file without -Dsvnkit.symlinks=true on cmd line

          mkrohan added a comment - Created an attachment (id=769) SVNKit log file without -Dsvnkit.symlinks=true on cmd line

          mkrohan added a comment -

          Created an attachment (id=770)
          SVNKit log file with -Dsvnkit.symlinks=true on cmd line

          mkrohan added a comment - Created an attachment (id=770) SVNKit log file with -Dsvnkit.symlinks=true on cmd line

          dodok1 added a comment -

          I wuold like to point out that there is simple test case in
          SubversionSCMTest::testSymbolicLinkCheckout() to check this problem.

          I think that this problem has something to do with JNA.

          dodok1 added a comment - I wuold like to point out that there is simple test case in SubversionSCMTest::testSymbolicLinkCheckout() to check this problem. I think that this problem has something to do with JNA.

          dodok1 added a comment -

          After correcting my test case , I approve that solution is to remove those
          lines setting svnkit.symlinks to true.
          The issue with slow checkouts was solved in svnkit 1.3.0 using JNA.

          As soon as I will test in on the real deployment, I will commit that change.

          dodok1 added a comment - After correcting my test case , I approve that solution is to remove those lines setting svnkit.symlinks to true. The issue with slow checkouts was solved in svnkit 1.3.0 using JNA. As soon as I will test in on the real deployment, I will commit that change.

          dodok1 added a comment -

          solved in trunk, removed obsolete workaround

          dodok1 added a comment - solved in trunk, removed obsolete workaround

          Tommy McNeely added a comment -

          If anyone else thinks they are being bit by this very old bug, please check to see if you are actually affected by https://issues.jenkins-ci.org/browse/JENKINS-14217 ... which is what was getting us.

          ~tommy

          Tommy McNeely added a comment - If anyone else thinks they are being bit by this very old bug, please check to see if you are actually affected by https://issues.jenkins-ci.org/browse/JENKINS-14217 ... which is what was getting us. ~tommy

            Unassigned Unassigned
            mkrohan mkrohan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: