Bug 31068 - fonts.config in Mono 4 breaks Mac App Store Sandboxing
Summary: fonts.config in Mono 4 breaks Mac App Store Sandboxing
Status: RESOLVED DUPLICATE of bug 30919
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Configuration ()
Version: 4.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-12 11:24 UTC by John Conners
Modified: 2015-06-15 08:01 UTC (History)
1 user (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 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:
Status:
RESOLVED DUPLICATE of bug 30919

Description John Conners 2015-06-12 11:24:08 UTC
The following line in fonts.config:

<cachedir>~/Library/Caches/com.xamarin.fontconfig</cachedir>

Was changed to this in Mono 4:

<cachedir>/Users/builder/Library/Caches/com.xamarin.fontconfig</cachedir>

Problem is when you do anything in System.Drawing, like this:

using( var img = new System.Drawing.Bitmap( 100, 100 ) ) {}

that tries to create the fontconfig cache folder in that absolute path if it can. In a sandboxed Mac App that is not allowed and so Apple will reject the app straight away. Changing fonts.config on the machine is no good since the packaged version in MonoBundle seems to revert to its own version with that hard coded path.

Basically any Mac app that uses System.Drawing cannot be sandboxed and pass Apple's review using Mono 4.0 and above as a result of this config file change.

For reference, I've mentioned this before here:

https://bugzilla.xamarin.com/show_bug.cgi?id=22931
Comment 1 John Conners 2015-06-13 07:15:26 UTC
See a more detailed discussion of the problem (which is building libfontconfig with that absolute path) here: 

http://forums.xamarin.com/discussion/42593/how-to-work-around-absolute-fontconfig-path-in-mono-4-that-breaks-sandboxed-apps
Comment 2 John Conners 2015-06-15 08:01:26 UTC

*** This bug has been marked as a duplicate of bug 30919 ***