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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Fixed
    • msbuild-plugin
    • None
    • Windows 7/2008

    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

          sogabe sogabe added a comment -

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

          sogabe sogabe added a comment - @gboissinot Would you merge pull/7 and release this plugin?

          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.

          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.

          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

          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
          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

          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

          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

          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

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

            Dates

              Created:
              Updated:
              Resolved: