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

Jenkins does not recognize UNC paths as absolute workspace paths

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • None
    • Windows

    Description

      If a build uses a UNC path as the 'Use custom workspace' (under 'Advanced Project Options'), the path is not recognized as an absolute path, but instead the path is appended into the default 'Workspace Root Directory' (master) or to the 'Remote FS root' (slave).

      Thijs Brobbel has emailed a patch fixing this problem, see patch in the link. I have also attached Thijs's patch.

      With the patch it's possible to use paths like \\hostname\sharename\path\to\workspace as the custom workspace.

      The use case is to allow parallel downstream builds on multiple slaves on Windows, without having to copy workspace data back and forth.

      Attachments

        Activity

          oleg_nenashev Oleg Nenashev added a comment -

          Hello,

          Most of Windows utilities (including copy, cmd, etc.) don't work properly with UNC paths. Build steps like "Execute batch command" won't work; many plugins utilizing native calls may fail as well.

          In my opinion, patch won't help in general case. You should map remote directories to the drive letter

          oleg_nenashev Oleg Nenashev added a comment - Hello, Most of Windows utilities (including copy, cmd, etc.) don't work properly with UNC paths. Build steps like "Execute batch command" won't work; many plugins utilizing native calls may fail as well. In my opinion, patch won't help in general case. You should map remote directories to the drive letter
          tonia Toni Arte added a comment -

          The fact that many Windows commands are broken is not the point. If you use an UNC path as a custom workspace, you can use the 'pushd <uncpath>' command to map that share into a drive letter within the build itself, instead of hardcoding the letters beforehand.

          Also the SCM checkout phase can checkout to an UNC path, without having to do extra pre-SCM buildsteps.

          tonia Toni Arte added a comment - The fact that many Windows commands are broken is not the point. If you use an UNC path as a custom workspace, you can use the 'pushd <uncpath>' command to map that share into a drive letter within the build itself, instead of hardcoding the letters beforehand. Also the SCM checkout phase can checkout to an UNC path, without having to do extra pre-SCM buildsteps.

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/16d9c5946488418751bc269d31746e998d0ad77b
          Log:
          [FIXED JENKINS-19821] recognize UNC path as absolute

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/16d9c5946488418751bc269d31746e998d0ad77b Log: [FIXED JENKINS-19821] recognize UNC path as absolute

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/6450647d64b423528431d112b3ca57b7488ce4a8
          Log:
          [FIXED JENKINS-19821] recognize UNC path as absolute

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/6450647d64b423528431d112b3ca57b7488ce4a8 Log: [FIXED JENKINS-19821] recognize UNC path as absolute
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #2912
          [FIXED JENKINS-19821] recognize UNC path as absolute (Revision 6450647d64b423528431d112b3ca57b7488ce4a8)

          Result = SUCCESS
          Nicolas De Loof : 6450647d64b423528431d112b3ca57b7488ce4a8
          Files :

          • core/src/main/java/hudson/FilePath.java
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2912 [FIXED JENKINS-19821] recognize UNC path as absolute (Revision 6450647d64b423528431d112b3ca57b7488ce4a8) Result = SUCCESS Nicolas De Loof : 6450647d64b423528431d112b3ca57b7488ce4a8 Files : core/src/main/java/hudson/FilePath.java
          tiesmaster Thijs Brobbel added a comment -

          Thnx! It seems that it's in the latest release, so I think the issue can be closed.

          Nice to know that my patch eventually made it, although, a bit late

          tiesmaster Thijs Brobbel added a comment - Thnx! It seems that it's in the latest release, so I think the issue can be closed. Nice to know that my patch eventually made it, although, a bit late

          People

            Unassigned Unassigned
            tonia Toni Arte
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: