MSBuild broken after update to 1.5 beta 135

Hi,

I just updated our CI system from beta 77 to beta 135 and tried to run our MSBuild task on our build servers. We set two properties for the MSBuild task but after the update Continua CI is no longer able to expand the variables in those proterties.

The MSBuild properties are:

Version="%VersionMajor%.%VersionMinor%.%VersionRelease%.%VersionBuild%“
VersionMSI=”%VersionMajor%.100.%VersionBuild%“

The variables VersionMajor, VersionMinor and VersionRelease are defined in the configurations, VersionBuild is defined for the project. Did the property settings for the MSBuild task changed?

I added the build log and the agent’s debug log below.

We really appreciate a quick solution to our problem. Our build process is completely blocked by this problem.

Regards

Kay Zumbusch



This is the build log output:

5:26:48 PMStage: Build
5:27:43 PM    Server To Agent Workspace Sync
5:27:43 PM        Started syncing files from the server[192.168.182.37] to the agent [BUILD004]
5:27:43 PM        Workspace Syncing
5:27:43 PM            Using UNC Transport.
5:27:43 PM            /Output** > /
5:27:43 PM                0 files found.
5:27:43 PM            __variables* > __variables
5:27:43 PM                \SRV007\ContinuaCI\Ws\MailStore_Dev\134__variables\SRV007_Environment.xml > C:\ContinuaCI\Workspace\Ws\134__variables\SRV007_Environment.xml
5:27:43 PM                \SRV007\ContinuaCI\Ws\MailStore_Dev\134__variables\VariableNamespaces.xml > C:\ContinuaCI\Workspace\Ws\134__variables\VariableNamespaces.xml
5:27:43 PM        Finished syncing files from the server [192.168.182.37] to the agent [BUILD004].
5:28:10 PM    MSBuild [Source\MailStore.proj]
5:28:10 PM        Action ‘MSBuild [Source\MailStore.proj]’ has failed due to an error.
5:28:10 PM        Could not expand query 'Version=”%VersionMajor%.%VersionMinor%.%VersionRelease%.%VersionBuild%"’. Exception of type ‘Continua.Stepping.Variables.VariableTypeException’ was thrown.
5:28:10 PM    Agent To Server Workspace Sync
5:28:10 PM        Started syncing files from the agent to the server.
5:28:10 PM        Workspace Syncing
5:28:10 PM            Using UNC Transport.
5:28:10 PM            / < /Output**
5:28:10 PM                0 files found.
5:28:10 PM            \Setups < Source\src\Setup\output*.exe
5:28:10 PM                0 files found.
5:28:10 PM            \Setups < Source\src\Setup\output*.msi
5:28:10 PM                0 files found.
5:28:10 PM            __variables < __variables*
5:28:10 PM                \SRV007\ContinuaCI\Ws\MailStore_Dev\134__variables\BUILD004_Environment.xml < C:\ContinuaCI\Workspace\Ws\134__variables\BUILD004_Environment.xml
5:28:10 PM                \SRV007\ContinuaCI\Ws\MailStore_Dev\134__variables\SRV007_Environment.xml < C:\ContinuaCI\Workspace\Ws\134__variables\SRV007_Environment.xml
5:28:10 PM                \SRV007\ContinuaCI\Ws\MailStore_Dev\134__variables\VariableNamespaces.xml < C:\ContinuaCI\Workspace\Ws\134__variables\VariableNamespaces.xml
5:28:10 PM        Finished syncing files from the agent to the server.
5:27:16 PM    Artifacts Registration
5:27:16 PM        Started registering artifacts
5:27:16 PM        Setups*.exe
5:27:16 PM            0 files
5:27:16 PM        Setups*.msi
5:27:16 PM            0 files
5:27:16 PM        variable | __variables**.xml
5:27:16 PM            C:\ContinuaCI\Ws\MailStore_Dev\134__variables\BUILD004_Environment.xml
5:27:16 PM            C:\ContinuaCI\Ws\MailStore_Dev\134__variables\SRV007_Environment.xml
5:27:16 PM            C:\ContinuaCI\Ws\MailStore_Dev\134__variables\VariableNamespaces.xml
5:27:16 PM        Finished registering artifacts


This is the log from the agent:

Medium: 5:37:05 PM [Debug] [Agent Build Runner] Workspace initialisation complete. Result: Success
Medium: 5:37:05 PM [Debug] [Agent Build Runner] Executing action ‘MSBuild [${ProjectFile}]’. Creating variable namespaces
Medium: 5:37:05 PM [Debug] [Agent Build Runner] Executing action ‘MSBuild [${ProjectFile}]’. Creating descriptors
Medium: 5:37:05 PM [Debug] [Agent Build Runner] Executing action ‘MSBuild [${ProjectFile}]’. Expanding action names
Medium: 5:37:05 PM [Debug] [Agent Build Runner] Executing action ‘MSBuild [Source\MailStore.proj]’. Expanded name: ''
Medium: 5:37:05 PM [Debug] [Agent Build Runner] Executing action ‘MSBuild [Source\MailStore.proj]’. Running
Medium: 5:37:05 PM [Debug] Running action ‘MSBuild [Source\MailStore.proj] (MSBuildAction)’.
Medium: 5:37:05 PM [Execute Action] Action 'MSBuild [Source\MailStore.proj] 'has failed due to an error: Could not expand query ‘Version="%VersionMajor%.%VersionMinor%.%VersionRelease%.%VersionBuild%"’. Exception of type ‘Continua.Stepping.Variables.VariableTypeException’ was thrown.
Medium: 5:37:05 PM [Debug] [Agent Stepping Log] Processing 2 messages of type Continua.Stepping.Common.Message
Medium: 5:37:05 PM [Debug] [Agent Stepping Log] Sending 2 messages of type Continua.Stepping.Common.Message
Medium: 5:37:05 PM [Debug] [Agent Build Runner] Executing action ‘MSBuild [Source\MailStore.proj]’. Run result:
Medium: 5:37:05 PM [Debug] [Agent Build Runner] Executing action ‘MSBuild [Source\MailStore.proj]’. Serialising namespace hierarchy.
Medium: 5:37:05 PM [Debug] [Agent Build Runner] Executing action ‘MSBuild [Source\MailStore.proj]’. Done.

I had a look through the commits between the two versions you mentioned and couldn’t find any changes that might cause this error, but as far as I can tell nothing in the variable expansion has been touched.

The Continua.Stepping.Variables.VariableTypeException is only ever thrown from one method, and only when a TryParse fails, eg
[code]case ElementType.Numeric:decimal d;if (decimal.TryParse(variable.Value, out d))return new NumericDescriptor(d);throw new VariableTypeException();[/code]

This suggests to me that the variable values are not the correct type for the defined variable type? ie your variables are defined as numeric but something other than numeric has been assigned to them? So perhaps the issue is actually occurring earlier. How are you setting these variables?

Hi Vincent,

the variables are defined as

VariableName: Area of effect, type, prompt, value
VersionMajor: configuration, numeric, numeric, 9
VersionMinor: configuration, numeric, numeric, 1
VersionRelease: configuration, numeric, numeric, 0
VersionBuild: project, expression, , $Repository.MailStore.LatestChangesetId$

I reentered all preset variable values but the problem persist. There were no traling spaces or any other invalid character. I was able to narrow it down to the configuration variables. “VersionBuild” evaluated just fine and is set to the latest subversion commit of the selected branch. I don’t get why those variables got evaluated just fine in version 77 and don’t work any more in 135.

I just changed the value type of the static veraibles to text but that just made it worse. The values are evaluated just fine, but all got double quotes added. This is the expanded MSBuild parameter: Version="“9”.“1”.“0”.9862".

I’d guess you added some code to escape the variables shown on the start dialog and added quotes to them. But “9” does not evaluate to numeric very well if you include the quotes.

Regards

Kay Zumbusch

What repository type are you using? $Repository.MailStore.LatestChangesetId$ would only work for repositories that use numbers for changeset id’s, like subversion. We’ll test this here again today and see if we can figure out what is going on.

Hi Kay,

Thanks for reporting this. We are in fact wrapping values entered in the start build dialog with quotes. This was introduced as part of an update to the checkbox select, where we are updating each of the items with quotes for adding to a comma delimited list.

This is a critical fault and we will get a new build out today with a fix for this.