Bug 22614 - MTBS fails to build when curly brackets are specified in additional mtouch arguments
Summary: MTBS fails to build when curly brackets are specified in additional mtouch ar...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.5
Hardware: PC Windows
: Normal normal
Target Milestone: 4.0.1 (C6SR1)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-09-03 16:05 UTC by Jerome Laban
Modified: 2015-10-19 08:08 UTC (History)
12 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jerome Laban 2014-09-03 16:05:18 UTC
Using Xamarin 7.4.0.108 on the Mac, and VS2013 addin 3.5.55.0, if additional mtouch arguments are specified (for instance to add custom linker exclusion files, MTBS fails.

The additional arguments are :

--dsym=true --xml=%{SolutionDir}/source/exclusions.xml

and removing the --xml=%{SolutionDir} fixes the crash, probably because the {} are not escaped when sent to the logger.

It prevents the linker exclusions to work, though.

MTBS is returning an HTTP error 500 to VS2013, and shows this exception in the mtbserver.log file :

[03-Sep-2014 15:44:53] Exception: Exception type: System.FormatException
Input string was not in a correct format.
  at System.String.ParseFormatSpecifier (System.String str, System.Int32& ptr, System.Int32& n, System.Int32& width, System.Boolean& left_align, System.String& format) [0x00000] in <filename unknown>:0 
  at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.String.Format (System.String format, System.Object[] args) [0x00000] in <filename unknown>:0 
  at Mtb.Server.LoggingHelperRecorder.LogMessage (System.String message, System.Object[] messageArgs) [0x00000] in <filename unknown>:0 
  at Mtb.Server.BuildEngine.LogMessageEvent (Microsoft.Build.Framework.BuildMessageEventArgs e) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.Utilities.TaskLoggingHelper.LogMessageFromText (System.String lineOfText, MessageImportance importance) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.Utilities.TaskLoggingHelper.LogMessage (MessageImportance importance, System.String message, System.Object[] messageArgs) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) Microsoft.Build.Utilities.TaskLoggingHelper:LogMessage (Microsoft.Build.Framework.MessageImportance,string,object[])
  at Microsoft.Build.Utilities.ToolTask.LogToolCommand (System.String message) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.Utilities.ToolTask.ExecuteTool (System.String pathToTool, System.String responseFileCommands, System.String commandLineCommands) [0x00000] in <filename unknown>:0 
  at Xamarin.iOS.Tasks.MTouchTaskBase.ExecuteTool (System.String pathToTool, System.String responseFileCommands, System.String commandLineCommands) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.Utilities.ToolTask.Execute () [0x00000] in <filename unknown>:0 
  at Xamarin.iOS.Tasks.MTouchTaskBase.Execute () [0x00000] in <filename unknown>:0 
  at Mtb.Server.InProcTaskRunner.Execute (ILoggingHelper logger, System.String taskName, System.String inputs) [0x00000] in <filename unknown>:0 
  at Mtb.Server.Commands.ExecuteTask.HandleRequest (ILoggingHelper logger, System.Object commandRequestState) [0x00000] in <filename unknown>:0 
  at Mtb.Server.BaseCommand.OnRequest (System.Net.HttpListenerContext context, System.Object commandRequestState) [0x00000] in <filename unknown>:0 
  at Mtb.Server.Listener.OnRequest (System.Object state) [0x00000] in <filename unknown>:0
Comment 1 Mohit Kheterpal 2014-09-08 10:46:46 UTC
We have tried to reproduce this issue and we are also getting the same behavior. We created the iOS application and Added '--dsym=true --xml=%{SolutionDir}/source/exclusions.xml' in "Additoinal mtouch agruments" field then run the application. We not able to run the application and getting the same above exception in mtbserver log file.

Screencast: http://www.screencast.com/t/j2JlRxsXrHn
IDE log: https://gist.github.com/sunil360/c4b8b6cf9b809cd77b46
mtvserver Log: https://gist.github.com/sunil360/76e281429076878d30f2

Environment Info:
VS 2013
Xamarin   3.5.55.0 (2db5ccd228887372e207e112bc3b5f1b16b24293)

Build host Info:
X.iOS 7.4.0.108
Xcode 5.1.1
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2014-09-16 00:26:14 UTC
I won't have time to set this up or test it myself tonight, but if we have a standard project that verifies the functionality of custom linker files [1] for Xamarin.iOS projects, it would be awesome if we could test it on:

Xamarin 3.3.47   + Xamarin.iOS 7.2.6.28
Xamarin 3.5.58   + Xamarin.iOS 7.4.0.108 
Xamarin 3.6.223 + Xamarin.iOS 8.0.0.36

> [1] http://developer.xamarin.com/guides/cross-platform/advanced/custom_linking/


If using `%{SolutionDir}` was _the_ canonical way to get this to work in the past, then we might have many users who will hit this when they upgrade to Xamarin 3.6 for iOS 8 support.

Thanks!
Comment 3 Mohit Kheterpal 2014-09-17 11:49:44 UTC
I have checked this issue and I am still getting this issue with XVS 3.6.239 + X.iOS 8.0.0.60 + Xcode 6 GMSeed.

mtbserver log : https://gist.github.com/Mohit-Kheterpal/2aedfa17d41d282fbb8a
IDE log : https://gist.github.com/Mohit-Kheterpal/c25536dfc1b2a475940b
Comment 4 Parmendra Kumar 2014-09-18 11:48:51 UTC
I have checked this issue with Xamarin 3.5.58 + Xamarin.iOS 7.4.0.108 + Xcode 5.1.1 and still getting same issue. 

While it is working fine with Xamarin 3.3.47 + Xamarin.iOS 7.2.6.28 + Xcode 5.1.1

Hence its regression from XVS 3.3.47 + X.iOS 7.2.6.28 as it is working fine with these builds.
Comment 5 Adrian Alonso 2014-09-19 11:34:26 UTC
We're not supporting the %{SolutionDir} replacement for now. But could you please check if %{ProjectDir} works for you?
Comment 6 Mohit Kheterpal 2014-09-30 06:13:49 UTC
I have checked this issue by using "--dsym=true --xml=%{ProjectDir}/source/exclusions.xml" in mtouch argument and same error is appearing in mtbserver log.

Please let me know if %{ProjectDir} is also not supported? or I have to check something else ?

As of now I am reopening this issue.

Thanks
Comment 7 Mohit Kheterpal 2014-09-30 06:21:36 UTC
An update to comment 6, I have checked this with XVS 3.7.178 + X.iOS 8.2.0.190
Comment 8 Jose Gallardo 2014-10-01 10:58:12 UTC
{SolutionDir} is not supported by v3.7.
Moving the bug to v3.9 and adding it as a known issue on v3.7 release notes.
Comment 9 PJ 2015-03-19 16:14:49 UTC
3.10 was scratched and the only milestone tracked for what was the 3.10 release is VS2015-CTP6. Moving open 3.10 bugs to 3.11 for review.
Comment 10 Jose Gallardo 2015-03-19 17:34:39 UTC
Moved to Cycle 6
Comment 11 Joaquin Jares 2015-10-19 08:08:13 UTC
I have checked this issue using
--dsym=true --xml=%{SolutionDir}/source/exclusions.xml

and it builds correctly using 4.0