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

Gerrit-plugin modifies ant command line which is not compatible on windows

      Gerrit modified my ant task by adding GIT specific environment variables in a way that causes the ant task to go belly up.

      Here is a snippet from the log from a build where I have turned the escaping off. Note that the escaping option doesn't really fix the problem. Both variants (escaping on and off) fail.

      16:18:18  c:\temp\hudsonwork\gerrit>exit 0 
      16:18:18  [TestProject] $ cmd.exe /C '"c:\java\apache-ant-1.8.2\bin\ant.bat -file build.xml "-DGERRIT_PATCHSET_UPLOADER=""Some Dude"" <somedude@hotmail.com>" -DGERRIT_CHANGE_URL=http://edo-git:8082/7 -DGERRIT_CHANGE_ID=I497fbd0d12d27ce4fa540a7cda578c1a41ced7ad -DGERRIT_CHANGE_NUMBER=7 "-DGERRIT_PATCHSET_UPLOADER_NAME=Some Dude" "-DGERRIT_CHANGE_SUBJECT=dont rely on the existence of local.properties" -DGERRIT_PATCHSET_UPLOADER_EMAIL=somedude@hotmail.com -DGERRIT_BRANCH=master -DGERRIT_REFSPEC=refs/changes/07/7/1 -DGERRIT_PATCHSET_NUMBER=1 "-DGERRIT_CHANGE_OWNER_NAME=Some Dude" -DGERRIT_PATCHSET_REVISION=497fbd0d12d27ce4fa540a7cda578c1a41ced7ad -DGERRIT_PROJECT=com.test.project "-DGERRIT_CHANGE_OWNER=""Some Dude"" <somedude@hotmail.com>" -DGERRIT_CHANGE_OWNER_EMAIL=somedude@hotmail.com -Dsdk.dir=c:/java/android-sdk-windows debug && exit %%ERRORLEVEL%%"'
      16:18:18  Buildfile: c:\temp\hudsonwork\gerrit\TestProject\build.xml
      16:18:19  
      16:18:19  BUILD FAILED
      16:18:19  Target "Dude" does not exist in the project "TestProject". 
      

      When I build the project without the gerrit-trigger plugin I get the following (correct) format.

      16:45:09  [TestProject] $ cmd.exe /C '"c:\java\apache-ant-1.8.2\bin\ant.bat -file build.xml -Dsdk.dir=c:/java/android-sdk-windows debug && exit %%ERRORLEVEL%%"'
      16:45:09  Buildfile: c:\temp\hudsonwork\gerrit\TestProject\build.xml
      

      Why are those attributes added in the first place? It would probably be easiest to just add a configuration switch to disable modification of the command line.

          [JENKINS-11779] Gerrit-plugin modifies ant command line which is not compatible on windows

          Rainer Burgstaller created issue -
          Rainer Burgstaller made changes -
          Description Original: Gerrit modified my ant task by adding GIT specific environment variables in a way that causes the ant task to go belly up.

          Here is a snippet from the log from a build where I have turned the escaping off. Note that the escaping option doesn't really fix the problem. Both variants (escaping on and off) fail.

          {noformat}
          16:18:18 c:\temp\hudsonwork\gerrit>exit 0
          16:18:18 [TestProject] $ cmd.exe /C '"c:\java\apache-ant-1.8.2\bin\ant.bat -file build.xml "-DGERRIT_PATCHSET_UPLOADER=""Some Dude"" <somedude@hotmail.com>" -DGERRIT_CHANGE_URL=http://edo-git:8082/7 -DGERRIT_CHANGE_ID=I497fbd0d12d27ce4fa540a7cda578c1a41ced7ad -DGERRIT_CHANGE_NUMBER=7 "-DGERRIT_PATCHSET_UPLOADER_NAME=Some Dude" "-DGERRIT_CHANGE_SUBJECT=dont rely on the existence of local.properties" -DGERRIT_PATCHSET_UPLOADER_EMAIL=somedude@hotmail.com -DGERRIT_BRANCH=master -DGERRIT_REFSPEC=refs/changes/07/7/1 -DGERRIT_PATCHSET_NUMBER=1 "-DGERRIT_CHANGE_OWNER_NAME=Some Dude" -DGERRIT_PATCHSET_REVISION=497fbd0d12d27ce4fa540a7cda578c1a41ced7ad -DGERRIT_PROJECT=com.test.project "-DGERRIT_CHANGE_OWNER=""Some Dude"" <somedude@hotmail.com>" -DGERRIT_CHANGE_OWNER_EMAIL=somedude@hotmail.com -Dsdk.dir=c:/java/android-sdk-windows debug && exit %%ERRORLEVEL%%"'
          16:18:18 Buildfile: c:\temp\hudsonwork\gerrit\TestProject\build.xml
          {noformat}

          When I build the project without the gerrit-trigger plugin I get the following (correct) format.

          {noformat}
          16:45:09 [TestProject] $ cmd.exe /C '"c:\java\apache-ant-1.8.2\bin\ant.bat -file build.xml -Dsdk.dir=c:/java/android-sdk-windows debug && exit %%ERRORLEVEL%%"'
          16:45:09 Buildfile: c:\temp\hudsonwork\gerrit\TestProject\build.xml
          {noformat}


          Why are those attributes added in the first place? It would probably be easiest to just add a configuration switch to disable modification of the command line.
          New: Gerrit modified my ant task by adding GIT specific environment variables in a way that causes the ant task to go belly up.

          Here is a snippet from the log from a build where I have turned the escaping off. Note that the escaping option doesn't really fix the problem. Both variants (escaping on and off) fail.

          {noformat}
          16:18:18 c:\temp\hudsonwork\gerrit>exit 0
          16:18:18 [TestProject] $ cmd.exe /C '"c:\java\apache-ant-1.8.2\bin\ant.bat -file build.xml "-DGERRIT_PATCHSET_UPLOADER=""Some Dude"" <somedude@hotmail.com>" -DGERRIT_CHANGE_URL=http://edo-git:8082/7 -DGERRIT_CHANGE_ID=I497fbd0d12d27ce4fa540a7cda578c1a41ced7ad -DGERRIT_CHANGE_NUMBER=7 "-DGERRIT_PATCHSET_UPLOADER_NAME=Some Dude" "-DGERRIT_CHANGE_SUBJECT=dont rely on the existence of local.properties" -DGERRIT_PATCHSET_UPLOADER_EMAIL=somedude@hotmail.com -DGERRIT_BRANCH=master -DGERRIT_REFSPEC=refs/changes/07/7/1 -DGERRIT_PATCHSET_NUMBER=1 "-DGERRIT_CHANGE_OWNER_NAME=Some Dude" -DGERRIT_PATCHSET_REVISION=497fbd0d12d27ce4fa540a7cda578c1a41ced7ad -DGERRIT_PROJECT=com.test.project "-DGERRIT_CHANGE_OWNER=""Some Dude"" <somedude@hotmail.com>" -DGERRIT_CHANGE_OWNER_EMAIL=somedude@hotmail.com -Dsdk.dir=c:/java/android-sdk-windows debug && exit %%ERRORLEVEL%%"'
          16:18:18 Buildfile: c:\temp\hudsonwork\gerrit\TestProject\build.xml
          16:18:19
          16:18:19 BUILD FAILED
          16:18:19 Target "Dude" does not exist in the project "TestProject".
          {noformat}

          When I build the project without the gerrit-trigger plugin I get the following (correct) format.

          {noformat}
          16:45:09 [TestProject] $ cmd.exe /C '"c:\java\apache-ant-1.8.2\bin\ant.bat -file build.xml -Dsdk.dir=c:/java/android-sdk-windows debug && exit %%ERRORLEVEL%%"'
          16:45:09 Buildfile: c:\temp\hudsonwork\gerrit\TestProject\build.xml
          {noformat}


          Why are those attributes added in the first place? It would probably be easiest to just add a configuration switch to disable modification of the command line.
          Rainer Burgstaller made changes -
          Link New: This issue is related to JENKINS-10692 [ JENKINS-10692 ]
          Nothize T made changes -
          Link New: This issue depends on JENKINS-7053 [ JENKINS-7053 ]
          Nothize T made changes -
          Link Original: This issue depends on JENKINS-7053 [ JENKINS-7053 ]
          rin_ne made changes -
          Labels New: windows
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 142022 ] New: JNJira + In-Review [ 175591 ]
          Jesse Glick made changes -
          Labels Original: windows New: stalled-pr windows

            rsandell rsandell
            rburgst2 Rainer Burgstaller
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: