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

Extra " when forming cmd line arguments for parameters containing a space

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Duplicate
    • msbuild-plugin
    • None
    • Jenkins v1.520

    Description

      Hi there,

      I'm using version 1.18 of the MSBuild plugin and I've come across an issue with how it handles quotes for parameters.

      I have a matrix project setup where my build axes are specified like so:

      Name: VS
      Values: 10.0 11.0

      Name: Config:
      Values: Debug Release

      Name: TARGET
      Values: "Any CPU"

      MSBuild is invoked using the command line arguments:

      /p:Configuration="${CONFIG}";Platform="${TARGET}" /p:VisualStudioVersion=${VS}

      The resulting command line from the console output is this:

      cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nr:false /maxcpucount:8 /verbosity:normal "/p:Configuration="Debug";Platform="Any CPU"" /p:VisualStudioVersion=10.0 /p:CONFIG=Debug;VS=10.0;TARGET=Any+CPU;branch=Live Tools\Source\AssetAnalyzer\AssetAnalyzer.sln && exit %%ERRORLEVEL%% from C:\JCI\jobs\AssetAnalyzer-Live\workspace\CONFIG\Debug\TARGET\Any CPU\VS\10.0

      which reports:

      MSBUILD : error MSB1008: Only one project can be specified.
      Switch: Tools\Source\AssetAnalyzer\AssetAnalyzer.sln
      For switch syntax, type "MSBuild /help"

      I believe the command line should be:

      cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nr:false /maxcpucount:8 /verbosity:normal "/p:Configuration="Debug";Platform="Any CPU" /p:VisualStudioVersion=10.0 /p:CONFIG=Debug;VS=10.0;TARGET=Any+CPU;branch=Live Tools\Source\AssetAnalyzer\AssetAnalyzer.sln && exit %%ERRORLEVEL%% from C:\JCI\jobs\AssetAnalyzer-Live\workspace\CONFIG\Debug\TARGET\Any CPU\VS\10.0

      ie. Platform="Any CPU" instead of Platform="Any CPU""

      Can you fix this please?

      Regards,
      Tom

      Attachments

        Issue Links

          Activity

            tfields Thomas Fields created issue -
            tfields Thomas Fields added a comment -

            Downgrading to v1.17 fixes this issue. So this is a regression of https://issues.jenkins-ci.org/browse/JENKINS-17876. Please fix.

            tfields Thomas Fields added a comment - Downgrading to v1.17 fixes this issue. So this is a regression of https://issues.jenkins-ci.org/browse/JENKINS-17876 . Please fix.
            tfields Thomas Fields added a comment - Seems to be a duplicate of https://issues.jenkins-ci.org/browse/JENKINS-18543
            tfields Thomas Fields added a comment -

            Cmd line on version 1.17 is:

            cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nr:false /maxcpucount:8 /verbosity:normal "/p:Configuration=Debug;Platform=Any CPU" /p:VisualStudioVersion=10.0 /p:CONFIG=Debug;VS=10.0;TARGET=Any+CPU;branch=Live Tools\Source\AssetAnalyzer\AssetAnalyzer.sln && exit %%ERRORLEVEL%% from C:\JCI\jobs\AssetAnalyzer-Live\workspace\CONFIG\Debug\TARGET\Any CPU\VS\10.0

            I just realised that my suggestion of "/p:Configuration="Debug";Platform="Any CPU" will have quote mismatch so not sure what the fix is here.

            tfields Thomas Fields added a comment - Cmd line on version 1.17 is: cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nr:false /maxcpucount:8 /verbosity:normal "/p:Configuration=Debug;Platform=Any CPU" /p:VisualStudioVersion=10.0 /p:CONFIG=Debug;VS=10.0;TARGET=Any+CPU;branch=Live Tools\Source\AssetAnalyzer\AssetAnalyzer.sln && exit %%ERRORLEVEL%% from C:\JCI\jobs\AssetAnalyzer-Live\workspace\CONFIG\Debug\TARGET\Any CPU\VS\10.0 I just realised that my suggestion of "/p:Configuration="Debug";Platform="Any CPU" will have quote mismatch so not sure what the fix is here.

            This is a duplicate of JENKINS-18543.

            tyrius Jonathan Zimmerman added a comment - This is a duplicate of JENKINS-18543 .
            mdkf Michael Fowler made changes -
            Field Original Value New Value
            Link This issue duplicates JENKINS-18543 [ JENKINS-18543 ]
            mdkf Michael Fowler made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 149867 ] JNJira + In-Review [ 193325 ]

            People

              kdsweeney kdsweeney
              tfields Thomas Fields
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: