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

MSBuild Command Line Arguments quotes being stripped...not 5552

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: msbuild-plugin
    • Labels:
      None
    • Environment:
      Windows 7/2008
    • Similar Issues:

      Description

      I've been following JENKINS-5552 and this seems to be a different, but same issue. No matter what I put in the Command Line Arguments section of the "Build a Visual Studio project of solution using MSBuild" the command is parsed and the quotes needed are stripped. Since we have to use devenv.com, I cannot use the /p: command parameters. Attempting to us /build "Release|Win32" results in the quotes being stripped. This only happens when there are no spaces. "Release|Any CPU" appears to get the quotes re-established as the tokenizer recognizes the space. Can we just have this field get passed verbatim?

        Attachments

          Activity

          Hide
          sogabe sogabe added a comment -

          @gboissinot Would you merge pull/7 and release this plugin?

          Show
          sogabe sogabe added a comment - @gboissinot Would you merge pull/7 and release this plugin?
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jonathan Zimmerman
          Path:
          src/main/java/hudson/plugins/msbuild/MsBuildBuilder.java
          src/test/java/hudson/plugins/msbuild/MsBuildBuilderTest.java
          http://jenkins-ci.org/commit/msbuild-plugin/11525049ed173f941d6ec6e87694269ef40d9920
          Log:
          JENKINS-17876 Directly invoke QuotedStringTokenizer so quotes can be preserved in both the installation default args and the instance args.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jonathan Zimmerman Path: src/main/java/hudson/plugins/msbuild/MsBuildBuilder.java src/test/java/hudson/plugins/msbuild/MsBuildBuilderTest.java http://jenkins-ci.org/commit/msbuild-plugin/11525049ed173f941d6ec6e87694269ef40d9920 Log: JENKINS-17876 Directly invoke QuotedStringTokenizer so quotes can be preserved in both the installation default args and the instance args.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          pom.xml
          src/main/java/hudson/plugins/msbuild/MsBuildBuilder.java
          src/test/java/hudson/plugins/msbuild/MsBuildBuilderTest.java
          http://jenkins-ci.org/commit/msbuild-plugin/0ae0e878b29ff22072286e65fc198f32a0cdb46c
          Log:
          Merge pull request #7 from tyrius02/master

          [FIXED JENKINS-17876] Use QuotedStringTokenizer when constructing msbuild command-line arguments

          Compare: https://github.com/jenkinsci/msbuild-plugin/compare/dbf9ee71a1a5...0ae0e878b29f

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: pom.xml src/main/java/hudson/plugins/msbuild/MsBuildBuilder.java src/test/java/hudson/plugins/msbuild/MsBuildBuilderTest.java http://jenkins-ci.org/commit/msbuild-plugin/0ae0e878b29ff22072286e65fc198f32a0cdb46c Log: Merge pull request #7 from tyrius02/master [FIXED JENKINS-17876] Use QuotedStringTokenizer when constructing msbuild command-line arguments Compare: https://github.com/jenkinsci/msbuild-plugin/compare/dbf9ee71a1a5...0ae0e878b29f
          Hide
          damiandixon damian dixon added a comment -

          It looks like this fix has introduced a problem with the following command line:

          /p:"VCBuildAdditionalOptions=/M20" /p:Configuration="Debug for Release" /p:platform="Win32" /v:n

          This ends up thus:

          cmd.exe /C C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /p:"VCBuildAdditionalOptions=/M20" '/p:Configuration="Debug for Release"' /p:platform="Win32" /v:n C:\hudson\config\jobs\MapLink-Checkout\workspace\SDK\ThirdParty\Xalan-C\Xalan-Cx.sln && exit

          Giving the following error:

          MSBUILD : error MSB1008: Only one project can be specified.
          Switch: Release

          Show
          damiandixon damian dixon added a comment - It looks like this fix has introduced a problem with the following command line: /p:"VCBuildAdditionalOptions=/M20" /p:Configuration="Debug for Release" /p:platform="Win32" /v:n This ends up thus: cmd.exe /C C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /p:"VCBuildAdditionalOptions=/M20" '/p:Configuration="Debug for Release"' /p:platform="Win32" /v:n C:\hudson\config\jobs\MapLink-Checkout\workspace\SDK\ThirdParty\Xalan-C\Xalan-Cx.sln && exit Giving the following error: MSBUILD : error MSB1008: Only one project can be specified. Switch: Release
          Hide
          franlero François Le Rolland added a comment -

          I have the same issue as Damian.

          I think the problem come from spaces in parameter values. Like for Damian, one of my parameters contains spaces and it's surrounded by quotes (') in the command line.
          I have the same error message: Only one project can be specified.

          To solve the issue, I have to roll back to previous version of the plugin (1.15).

          Regards,
          François

          Show
          franlero François Le Rolland added a comment - I have the same issue as Damian. I think the problem come from spaces in parameter values. Like for Damian, one of my parameters contains spaces and it's surrounded by quotes (') in the command line. I have the same error message: Only one project can be specified. To solve the issue, I have to roll back to previous version of the plugin (1.15). Regards, François

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              agallant Andrew Gallant
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: