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

Invalid environment variable values when running hierarchical jobs on windows slaves

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None

      If you try to run a hierarchical job on a windows slave the WORKSPACE environment variable will contain slashes.

      e.g.

      WORKSPACE=C:\JenkinsSlave\workspace\Folder/Test

      The root cause of this is that Slave.getWorkspaceFor(...) calls AbstractItem.getFullName() which will build up the name using '/' as the separator.

          [JENKINS-13649] Invalid environment variable values when running hierarchical jobs on windows slaves

          https://github.com/jenkinsci/jenkins/pull/461

          Actually safest to fix this in FilePath, and additionally, the spec of FilePath's constructor that takes a relative path could have surfaced this issue anyway

          Stephen Connolly added a comment - https://github.com/jenkinsci/jenkins/pull/461 Actually safest to fix this in FilePath, and additionally, the spec of FilePath's constructor that takes a relative path could have surfaced this issue anyway

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/c92c2217ecb0078f021fab7c9a053d9e63f12143
          Log:
          [FIXES JENKINS-13649] As FilePath(FilePath,String) expects multi-segment relative paths, we should ensure that the multiple segments are using the correct separator character for the remote OS

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/c92c2217ecb0078f021fab7c9a053d9e63f12143 Log: [FIXES JENKINS-13649] As FilePath(FilePath,String) expects multi-segment relative paths, we should ensure that the multiple segments are using the correct separator character for the remote OS

          Code changed in jenkins
          User: Nicolas De loof
          Path:
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/708b609ccce2ca8334acb9f5399a7d199a33880a
          Log:
          Merge pull request #461 from stephenc/master

          Fixes JENKINS-13649

          Compare: https://github.com/jenkinsci/jenkins/compare/207134d...708b609

          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/708b609ccce2ca8334acb9f5399a7d199a33880a Log: Merge pull request #461 from stephenc/master Fixes JENKINS-13649 Compare: https://github.com/jenkinsci/jenkins/compare/207134d...708b609

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          core/src/test/java/hudson/FilePathTest.java
          http://jenkins-ci.org/commit/jenkins/71debc2b8942844c721d7849b48286dc13c3c8db
          Log:
          JENKINS-13649 Adding a test case

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: core/src/test/java/hudson/FilePathTest.java http://jenkins-ci.org/commit/jenkins/71debc2b8942844c721d7849b48286dc13c3c8db Log: JENKINS-13649 Adding a test case

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1697
          [FIXES JENKINS-13649] As FilePath(FilePath,String) expects multi-segment relative paths, we should ensure that the multiple segments are using the correct separator character for the remote OS (Revision c92c2217ecb0078f021fab7c9a053d9e63f12143)
          JENKINS-13649 Adding a test case (Revision 71debc2b8942844c721d7849b48286dc13c3c8db)

          Result = UNSTABLE
          Stephen Connolly : c92c2217ecb0078f021fab7c9a053d9e63f12143
          Files :

          • core/src/main/java/hudson/FilePath.java

          Stephen Connolly : 71debc2b8942844c721d7849b48286dc13c3c8db
          Files :

          • core/src/test/java/hudson/FilePathTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #1697 [FIXES JENKINS-13649] As FilePath(FilePath,String) expects multi-segment relative paths, we should ensure that the multiple segments are using the correct separator character for the remote OS (Revision c92c2217ecb0078f021fab7c9a053d9e63f12143) JENKINS-13649 Adding a test case (Revision 71debc2b8942844c721d7849b48286dc13c3c8db) Result = UNSTABLE Stephen Connolly : c92c2217ecb0078f021fab7c9a053d9e63f12143 Files : core/src/main/java/hudson/FilePath.java Stephen Connolly : 71debc2b8942844c721d7849b48286dc13c3c8db Files : core/src/test/java/hudson/FilePathTest.java

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/a957ccc8363ffb78f40abbf0f5afdc33d6877e24
          Log:
          [FIXES JENKINS-13649] As FilePath(FilePath,String) expects multi-segment relative paths, we should ensure that the multiple segments are using the correct separator character for the remote OS
          (cherry picked from commit c92c2217ecb0078f021fab7c9a053d9e63f12143)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/a957ccc8363ffb78f40abbf0f5afdc33d6877e24 Log: [FIXES JENKINS-13649] As FilePath(FilePath,String) expects multi-segment relative paths, we should ensure that the multiple segments are using the correct separator character for the remote OS (cherry picked from commit c92c2217ecb0078f021fab7c9a053d9e63f12143)

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          core/src/test/java/hudson/FilePathTest.java
          http://jenkins-ci.org/commit/jenkins/d424217cc0c2238755ef4eb757c1cd08322a6429
          Log:
          JENKINS-13649 Adding a test case
          (cherry picked from commit 71debc2b8942844c721d7849b48286dc13c3c8db)

          Conflicts:

          core/src/test/java/hudson/FilePathTest.java

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: core/src/test/java/hudson/FilePathTest.java http://jenkins-ci.org/commit/jenkins/d424217cc0c2238755ef4eb757c1cd08322a6429 Log: JENKINS-13649 Adding a test case (cherry picked from commit 71debc2b8942844c721d7849b48286dc13c3c8db) Conflicts: core/src/test/java/hudson/FilePathTest.java

          dogfood added a comment -

          Integrated in jenkins_ui-changes_branch #30
          [FIXES JENKINS-13649] As FilePath(FilePath,String) expects multi-segment relative paths, we should ensure that the multiple segments are using the correct separator character for the remote OS (Revision c92c2217ecb0078f021fab7c9a053d9e63f12143)
          JENKINS-13649 Adding a test case (Revision 71debc2b8942844c721d7849b48286dc13c3c8db)

          Result = SUCCESS
          Stephen Connolly : c92c2217ecb0078f021fab7c9a053d9e63f12143
          Files :

          • core/src/main/java/hudson/FilePath.java

          Stephen Connolly : 71debc2b8942844c721d7849b48286dc13c3c8db
          Files :

          • core/src/test/java/hudson/FilePathTest.java

          dogfood added a comment - Integrated in jenkins_ui-changes_branch #30 [FIXES JENKINS-13649] As FilePath(FilePath,String) expects multi-segment relative paths, we should ensure that the multiple segments are using the correct separator character for the remote OS (Revision c92c2217ecb0078f021fab7c9a053d9e63f12143) JENKINS-13649 Adding a test case (Revision 71debc2b8942844c721d7849b48286dc13c3c8db) Result = SUCCESS Stephen Connolly : c92c2217ecb0078f021fab7c9a053d9e63f12143 Files : core/src/main/java/hudson/FilePath.java Stephen Connolly : 71debc2b8942844c721d7849b48286dc13c3c8db Files : core/src/test/java/hudson/FilePathTest.java

            stephenconnolly Stephen Connolly
            stephenconnolly Stephen Connolly
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: