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

Problem with spaces in path names on XP

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: ant-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: Windows XP
    • Similar Issues:

      Description

      This is a little weird. I got an ant build working fine but I had to define a
      property for the build to succeed. As soon as I did the log showed that the path
      to ant was now proving to be a problem.

      In the first case, this is the command that was executed:

      cmd.exe /C "C:\Program Files\eclipse\plugins\org.apache.ant_1.6.5\bin\ant.bat"
      -file build.xml && exit %%ERRORLEVEL%%

      In the second case this was the command:

      cmd.exe /C "C:\Program Files\eclipse\plugins\org.apache.ant_1.6.5\bin\ant.bat"
      -file build.xml "-DTOMCAT_HOME=C:\Tomcat\Tomcat 5.5" && exit %%ERRORLEVEL%%

      The only difference is the addition of "-DTOMCAT_HOME=C:\Tomcat\Tomcat 5.5", but
      this is the error I get:

      'C:\Program' is not recognized as an internal or external command,
      operable program or batch file.

      Note that without the property definition I don't get this error.

        Attachments

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Fixed in 1.157.

          Windows never fail to amaze me when it comes to its handling of processes.

          Quoting from "cmd.exe /?"

          ------------------------
          If /C or /K is specified, then the remainder of the command line after
          the switch is processed as a command line, where the following logic is
          used to process quote (") characters:

          1. If all of the following conditions are met, then quote characters
          on the command line are preserved:

          • no /S switch
          • exactly two quote characters
          • no special characters between the two quote characters,
            where special is one of: &<>()@^|
          • there are one or more whitespace characters between the
            the two quote characters
          • the string between the two quote characters is the name
            of an executable file.

          2. Otherwise, old behavior is to see if the first character is
          a quote character and if so, strip the leading character and
          remove the last quote character on the command line, preserving
          any text after the last quote character.
          ------------------------

          Also, JDK6 Process implementation for Windows does a lot of rather ad-hoc
          computation to convert String[] to a single String as required by the
          CreateProcess API, so Hudson had to work around this problem, too.

          This fix is in 1.157.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Fixed in 1.157. Windows never fail to amaze me when it comes to its handling of processes. Quoting from "cmd.exe /?" ------------------------ If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters: 1. If all of the following conditions are met, then quote characters on the command line are preserved: no /S switch exactly two quote characters no special characters between the two quote characters, where special is one of: &<>()@^| there are one or more whitespace characters between the the two quote characters the string between the two quote characters is the name of an executable file. 2. Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character. ------------------------ Also, JDK6 Process implementation for Windows does a lot of rather ad-hoc computation to convert String[] to a single String as required by the CreateProcess API, so Hudson had to work around this problem, too. This fix is in 1.157.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            judge2005 judge2005
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: