History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2711
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Scott Hunter
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Regression in MSBuild properties - no longer quoted

Created: 05/May/16 02:54 PM   Updated: 11/May/16 09:37 AM
Component/s: None
Affects Version/s: 6.1.14
Fix Version/s: 6.1.15

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Windows


 Description  « Hide
After upgrading to 6.1.14 our MSBuild tasks no longer run. It looks like this is due to an incorrect change in the way properties are passed on the command line. The double-quoting of property values no longer works properly.

In our case, we have a variable named NuGetPath which is set to

C:\BuildToolsQB\windows\nuget\2.8.60717.93\NuGet.exe

this is passed to MSBuild using the Build Properties list with name NuGetPath and value ${vars.getValue("NuGetPath")}

after upgrading, I can see that the command line is no longer quoted, and the backslashes are messed up:

/property:NuGetPath=C:BuildToolsQBwindows\nuget.8.60717.93NuGet.exe

Looking in the source, I can see that the setProperties method in MSBuildCommand was changed in a recent version, and the new version of the code handles quoting of properties incorrectly. The previous version of the method works correctly by using addArgValue to quote the entire command line argument which is the correct approach.

 All   Comments   Work Log   Change History      Sort Order:
Scott Hunter [05/May/16 05:31 PM]
Upon further examination, the previous version did not quote the arguments either (in this case they are not necessary).

The problem is still in the use of addArgLine though. I believe the correct code would be:

for (Property each : properties) {
  String str = String.format("/property:%s=%s", each.getName(), each.getValue());
  addArgValue(str);
}

Each property should be an individual argument. Let ProcessBuilder handle double-quoting if necessary (e.g. if name or value contain whitespace).

Steve Luo [06/May/16 11:12 AM]
Hi Scott,

You are right. We intended to fix issue QB-2695 and caused this error. Thank you for pointing this out. Will fix in next patch release.