Bug 52587 - msbuild behavior re: path translation has changed
Summary: msbuild behavior re: path translation has changed
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Ankit Jain
Depends on:
Reported: 2017-02-16 21:53 UTC by Andi McClure
Modified: 2017-02-16 23:10 UTC (History)
2 users (show)

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 GitHub or 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:

Description Andi McClure 2017-02-16 21:53:23 UTC
Xamarin.Android frequently has <Exec /> lines containing paths in the command argumnts. Here is one example

<DarwinInstall>installer -pkg "$(AndroidToolchainCacheDirectory)\$(_DarwinMonoFramework)" -target /</DarwinInstall>

The Xamarin.Android build scripts rely on the \ being automatically converted to /.

When we upgraded system mono from 4.8 (mono-4.8.0-branch) to 4.9 (2017-02) all of these scripts stop working. The problem is that in 4.8, the conversion process was that *all* \s became /s. In 4.9 however a heuristic is used:


…which converts only \s in strings that "look like" paths. Command line invocations never "look like" paths because they are not paths, they are strings that contain paths.

I do not know what the definition of "correct" behavior here is (although my opinion is both the 4.8 behavior and the 4.9 behavior are surprising, and whatever the documentation is it should be clearly documented somewhere). However, from talking to Ankit, as I understand this behavior should not have *changed* between 4.8. So I am assigning this to him.

You can see the effects here https://github.com/xamarin/xamarin-android/pull/445
Comment 1 Ankit Jain 2017-02-16 23:10:20 UTC
update: The issue in the PR build was due to `mono` missing the `$PATH`. Also, the difference in behavior was seen between a 4.6 build and 4.9 build, due to the `$PATH` issue. Closing.