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

file.separator is returning / on Windows.

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • harvest-plugin
    • None
    • Jenkins Version 2.125
      Jenkins Master OS: SLES 12
      Jenkins Node OS : Windows Server 2016

    Description

      Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

       

      C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl https://jenkins.****.com/computer/windows-node/slave-agent.jnlp -secret **** -workDir "D:\jenkins\windows"

       

      System Information for Slave shows correct information for file.separator:

      Windows slave, version 3.19

      System Properties

      Name  ↓ Value   
      apple.laf.useScreenMenuBar true
      awt.toolkit sun.awt.windows.WToolkit
      file.encoding Cp1252
      file.encoding.pkg sun.io
      file.separator '\' (without quotes)
      java.awt.graphicsenv sun.awt.Win32GraphicsEnvironment
      java.awt.printerjob sun.awt.windows.WPrinterJob
      java.class.path agent.jar
      java.class.version 52.0
         

       

      When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

       

      Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
      echo File.separator if(isUnix()){
      echo 'isUnix()'
      }else{
      echo 'WINDOWS'
      }

      Attachments

        Activity

          dockerstar Umesh Chhabra created issue -
          dockerstar Umesh Chhabra made changes -
          Field Original Value New Value
          Description Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

           

          C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl [https://jenkins.****.com/computer/windows-node/slave-agent.jnlp|https://jenkins.%2A%2A%2A%2A.com/computer/windows-node/slave-agent.jnlp] -secret **** -workDir "D:\jenkins\windows"

           

          System Information for Slave shows correct information for file.separator:

          Windows slave, version 3.19
          h1. System Properties
          ||[Name  ↓|https://myjenkins.aafes.com/computer/windows-node/systemInfo]||[Value   |https://myjenkins.aafes.com/computer/windows-node/systemInfo]||
          |apple.laf.useScreenMenuBar|true|
          |awt.toolkit|sun.awt.windows.WToolkit|
          |file.encoding|Cp1252|
          |file.encoding.pkg|sun.io|
          |file.separator|\||
          |java.awt.graphicsenv|sun.awt.Win32GraphicsEnvironment|
          |java.awt.printerjob|sun.awt.windows.WPrinterJob|
          |java.class.path|agent.jar|
          |java.class.version|52.0|
          | | |

           

          When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

           

          Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
              echo File.separator if(isUnix())\{
                  echo 'isUnix()'
              }else\{
                  echo 'WINDOWS'
              }
          Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

           

          C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl [https://jenkins.****.com/computer/windows-node/slave-agent.jnlp|https://jenkins.%2A%2A%2A%2A.com/computer/windows-node/slave-agent.jnlp] -secret **** -workDir "D:\jenkins\windows"

           

          System Information for Slave shows correct information for file.separator:

          Windows slave, version 3.19
          h1. System Properties
          ||[Name  ↓|https://myjenkins.aafes.com/computer/windows-node/systemInfo]||[Value   |https://myjenkins.aafes.com/computer/windows-node/systemInfo]||
          |apple.laf.useScreenMenuBar|true|
          |awt.toolkit|sun.awt.windows.WToolkit|
          |file.encoding|Cp1252|
          |file.encoding.pkg|sun.io|
          |file.separator||\||
          |java.awt.graphicsenv|sun.awt.Win32GraphicsEnvironment|
          |java.awt.printerjob|sun.awt.windows.WPrinterJob|
          |java.class.path|agent.jar|
          |java.class.version|52.0|
          | | |

           

          When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

           

          Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
           echo File.separator if(isUnix())\{
           echo 'isUnix()'
           }else\{
           echo 'WINDOWS'
           }
          dockerstar Umesh Chhabra made changes -
          Description Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

           

          C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl [https://jenkins.****.com/computer/windows-node/slave-agent.jnlp|https://jenkins.%2A%2A%2A%2A.com/computer/windows-node/slave-agent.jnlp] -secret **** -workDir "D:\jenkins\windows"

           

          System Information for Slave shows correct information for file.separator:

          Windows slave, version 3.19
          h1. System Properties
          ||[Name  ↓|https://myjenkins.aafes.com/computer/windows-node/systemInfo]||[Value   |https://myjenkins.aafes.com/computer/windows-node/systemInfo]||
          |apple.laf.useScreenMenuBar|true|
          |awt.toolkit|sun.awt.windows.WToolkit|
          |file.encoding|Cp1252|
          |file.encoding.pkg|sun.io|
          |file.separator||\||
          |java.awt.graphicsenv|sun.awt.Win32GraphicsEnvironment|
          |java.awt.printerjob|sun.awt.windows.WPrinterJob|
          |java.class.path|agent.jar|
          |java.class.version|52.0|
          | | |

           

          When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

           

          Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
           echo File.separator if(isUnix())\{
           echo 'isUnix()'
           }else\{
           echo 'WINDOWS'
           }
          Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

           

          C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl [https://jenkins.****.com/computer/windows-node/slave-agent.jnlp|https://jenkins.%2A%2A%2A%2A.com/computer/windows-node/slave-agent.jnlp] -secret **** -workDir "D:\jenkins\windows"

           

          System Information for Slave shows correct information for file.separator:

          Windows slave, version 3.19
          h1. System Properties
          ||[Name  ↓|https://myjenkins.aafes.com/computer/windows-node/systemInfo]||[Value   |https://myjenkins.aafes.com/computer/windows-node/systemInfo]||
          |apple.laf.useScreenMenuBar|true|
          |awt.toolkit|sun.awt.windows.WToolkit|
          |file.encoding|Cp1252|
          |file.encoding.pkg|sun.io|
          |file.separator|/|
          |java.awt.graphicsenv|sun.awt.Win32GraphicsEnvironment|
          |java.awt.printerjob|sun.awt.windows.WPrinterJob|
          |java.class.path|agent.jar|
          |java.class.version|52.0|
          | | |

           

          When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

           

          Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
           echo File.separator if(isUnix())\{
           echo 'isUnix()'
           }else\{
           echo 'WINDOWS'
           }
          dockerstar Umesh Chhabra made changes -
          Description Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

           

          C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl [https://jenkins.****.com/computer/windows-node/slave-agent.jnlp|https://jenkins.%2A%2A%2A%2A.com/computer/windows-node/slave-agent.jnlp] -secret **** -workDir "D:\jenkins\windows"

           

          System Information for Slave shows correct information for file.separator:

          Windows slave, version 3.19
          h1. System Properties
          ||[Name  ↓|https://myjenkins.aafes.com/computer/windows-node/systemInfo]||[Value   |https://myjenkins.aafes.com/computer/windows-node/systemInfo]||
          |apple.laf.useScreenMenuBar|true|
          |awt.toolkit|sun.awt.windows.WToolkit|
          |file.encoding|Cp1252|
          |file.encoding.pkg|sun.io|
          |file.separator|/|
          |java.awt.graphicsenv|sun.awt.Win32GraphicsEnvironment|
          |java.awt.printerjob|sun.awt.windows.WPrinterJob|
          |java.class.path|agent.jar|
          |java.class.version|52.0|
          | | |

           

          When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

           

          Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
           echo File.separator if(isUnix())\{
           echo 'isUnix()'
           }else\{
           echo 'WINDOWS'
           }
          Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

           

          C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl [https://jenkins.****.com/computer/windows-node/slave-agent.jnlp|https://jenkins.%2A%2A%2A%2A.com/computer/windows-node/slave-agent.jnlp] -secret **** -workDir "D:\jenkins\windows"

           

          System Information for Slave shows correct information for file.separator:

          Windows slave, version 3.19
          h1. System Properties
          ||[Name  ↓|https://myjenkins.aafes.com/computer/windows-node/systemInfo]||[Value   |https://myjenkins.aafes.com/computer/windows-node/systemInfo]||
          |apple.laf.useScreenMenuBar|true|
          |awt.toolkit|sun.awt.windows.WToolkit|
          |file.encoding|Cp1252|
          |file.encoding.pkg|sun.io|
          |file.separator|\|
          |java.awt.graphicsenv|sun.awt.Win32GraphicsEnvironment|
          |java.awt.printerjob|sun.awt.windows.WPrinterJob|
          |java.class.path|agent.jar|
          |java.class.version|52.0|
          | | |

           

          When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

           

          Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
           echo File.separator if(isUnix())\{
           echo 'isUnix()'
           }else\{
           echo 'WINDOWS'
           }
          dockerstar Umesh Chhabra made changes -
          Description Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

           

          C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl [https://jenkins.****.com/computer/windows-node/slave-agent.jnlp|https://jenkins.%2A%2A%2A%2A.com/computer/windows-node/slave-agent.jnlp] -secret **** -workDir "D:\jenkins\windows"

           

          System Information for Slave shows correct information for file.separator:

          Windows slave, version 3.19
          h1. System Properties
          ||[Name  ↓|https://myjenkins.aafes.com/computer/windows-node/systemInfo]||[Value   |https://myjenkins.aafes.com/computer/windows-node/systemInfo]||
          |apple.laf.useScreenMenuBar|true|
          |awt.toolkit|sun.awt.windows.WToolkit|
          |file.encoding|Cp1252|
          |file.encoding.pkg|sun.io|
          |file.separator|\|
          |java.awt.graphicsenv|sun.awt.Win32GraphicsEnvironment|
          |java.awt.printerjob|sun.awt.windows.WPrinterJob|
          |java.class.path|agent.jar|
          |java.class.version|52.0|
          | | |

           

          When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

           

          Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
           echo File.separator if(isUnix())\{
           echo 'isUnix()'
           }else\{
           echo 'WINDOWS'
           }
          Using Jenkins build master on SUSE SLES 12 together with a node machine (Windows Server 2016) connected by JNLP and running under Windows Service as follows:

           

          C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe -Xrs -jar agent.jar -jnlpUrl [https://jenkins.****.com/computer/windows-node/slave-agent.jnlp|https://jenkins.%2A%2A%2A%2A.com/computer/windows-node/slave-agent.jnlp] -secret **** -workDir "D:\jenkins\windows"

           

          System Information for Slave shows correct information for file.separator:

          Windows slave, version 3.19
          h1. System Properties
          ||[Name  ↓|https://myjenkins.aafes.com/computer/windows-node/systemInfo]||[Value   |https://myjenkins.aafes.com/computer/windows-node/systemInfo]||
          |apple.laf.useScreenMenuBar|true|
          |awt.toolkit|sun.awt.windows.WToolkit|
          |file.encoding|Cp1252|
          |file.encoding.pkg|sun.io|
          |file.separator|{{'\' (without quotes)}}|
          |java.awt.graphicsenv|sun.awt.Win32GraphicsEnvironment|
          |java.awt.printerjob|sun.awt.windows.WPrinterJob|
          |java.class.path|agent.jar|
          |java.class.version|52.0|
          | | |

           

          When I execute distributed build on Windows Server for checking out Harvest CA, file.separator used as '/'

           

          Also when I run the following script through pipeline on Windows node, I get file.separator value as '/' (without quote):
           echo File.separator if(isUnix())\{
           echo 'isUnix()'
           }else\{
           echo 'WINDOWS'
           }
          oleg_nenashev Oleg Nenashev added a comment -

          File.separator is a Java API invocation. It will always return Master's separator if you whitelist the method. So Pipeline issue is not a defect.

          If Harvest plugin behaves in such way, likely there is a defect there

          oleg_nenashev Oleg Nenashev added a comment - File.separator is a Java API invocation. It will always return Master's separator if you whitelist the method. So Pipeline issue is not a defect. If Harvest plugin behaves in such way, likely there is a defect there
          oleg_nenashev Oleg Nenashev made changes -
          Component/s core [ 15593 ]
          Component/s remoting [ 15489 ]
          abedwards Adam added a comment -

          hi oleg_nenashev i no longer use this plugin, so chances are I will not fix the issue.  would recommend you fix yourself and send a PR.  I can probably accept the PR if I still have access.

          abedwards Adam added a comment - hi oleg_nenashev i no longer use this plugin, so chances are I will not fix the issue.  would recommend you fix yourself and send a PR.  I can probably accept the PR if I still have access.
          oleg_nenashev Oleg Nenashev added a comment -

          abedwards I am just a guy who triages incoming issues. I do not use the plugin on my own, and I will unlikely fix it as well.

          I can check and restore your permissions tho. If you are not interested in the plugin, would you be fine if I mark it for adoption?

          oleg_nenashev Oleg Nenashev added a comment - abedwards I am just a guy who triages incoming issues. I do not use the plugin on my own, and I will unlikely fix it as well. I can check and restore your permissions tho. If you are not interested in the plugin, would you be fine if I mark it for adoption?
          dockerstar Umesh Chhabra added a comment -

          oleg_nenashev Thank you for looking into this issue.

          For time being, Let's ignore the Harvest Plugin. When I run the following script, I get the separator as '/':

           

          node('windows'){

          echo File.separator if(isUnix()){
          echo 'isUnix()' 
          }else{
          echo 'WINDOWS'
          }}

           

          This is just a plain groovy script I am running through plugin on a windows node. I am getting te result as:

          '/' (without quotes)

          WINDOWS

           

           

          dockerstar Umesh Chhabra added a comment - oleg_nenashev Thank you for looking into this issue. For time being, Let's ignore the Harvest Plugin. When I run the following script, I get the separator as '/':   node('windows'){ echo File.separator if(isUnix()){ echo 'isUnix()'  }else{ echo 'WINDOWS' }}   This is just a plain groovy script I am running through plugin on a windows node. I am getting te result as: '/' (without quotes) WINDOWS    
          abedwards Adam added a comment -

          hi oleg_nenashev please put the plugin up for adoption, thanks.

          abedwards Adam added a comment - hi oleg_nenashev please put the plugin up for adoption, thanks.
          dockerstar Umesh Chhabra added a comment -

          Hi oleg_nenashev, I now understand the pipeline concept. Thanks for the clarification. 

          dockerstar Umesh Chhabra added a comment - Hi oleg_nenashev , I now understand the pipeline concept. Thanks for the clarification. 
          oleg_nenashev Oleg Nenashev added a comment -

          Harvest plugin is also marked for adoption. I will unassign this and other issues

          oleg_nenashev Oleg Nenashev added a comment - Harvest plugin is also marked for adoption. I will unassign this and other issues
          oleg_nenashev Oleg Nenashev made changes -
          Assignee Adam [ abedwards ]
          limors Limor Segal Shevah added a comment - - edited

          Hi, 

          I wonder if there is any fix for that or workaround? it should be basic requirement 

          Thanks

          limors Limor Segal Shevah added a comment - - edited Hi,  I wonder if there is any fix for that or workaround? it should be basic requirement  Thanks

          People

            Unassigned Unassigned
            dockerstar Umesh Chhabra
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: