Bug 40560 - XDG_CONFIG_HOME not respected in iOS
Summary: XDG_CONFIG_HOME not respected in iOS
Status: RESOLVED FEATURE
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: XI 9.8 (tvOS / C7)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-04-20 16:58 UTC by Cody Beyer (MSFT)
Modified: 2016-04-20 18:03 UTC (History)
4 users (show)

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


Attachments
Sample (30.18 KB, application/zip)
2016-04-20 16:58 UTC, Cody Beyer (MSFT)
Details


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

Description Cody Beyer (MSFT) 2016-04-20 16:58:38 UTC
Created attachment 15784 [details]
Sample

# Description

Using XDG_CONFIG_HOME to set a custom path for config files works as expected on Android, but does not appear to function properly on iOS

# Sample

Attached

# Sample Output

Android:

>Before Setting XDG_CONFIG_HOME:/data/data/Android.Android/files/.config
>XDG_CONFIG_HOME:/data/data/Android.Android/files
>After Setting XDG_CONFIG_HOME:/data/data/Android.Android/files
>destinationPath:/data/data/Android.Android/files/xamarin*


iOS:

>Before Setting XDG_CONFIG_HOME:/var/mobile/Containers/Data/Application/02D9BC94-7DFA-4E10-8A7E-0B72A50EE7E7/Documents/.config
>XDG_CONFIG_HOME:/var/mobile/Containers/Data/Application/02D9BC94-7DFA-4E10-8A7E-0B72A50EE7E7/Documents
>After Setting XDG_CONFIG_HOME:/var/mobile/Containers/Data/Application/02D9BC94-7DFA-4E10-8A7E-0B72A50EE7E7/Documents/.config
>destinationPath:/var/mobile/Containers/Data/Application/02D9BC94-7DFA-4E10-8A7E-0B72A50EE7E7/Documents/.config/xamarin

# Steps to Reproduce 

1. Downloads sample
2. Run on iOS Device 

# Expcted Results

“After Setting XDG_CONFIG_HOME” should equal “XDG_CONFIG_HOME”

# Actual Results

“After Setting XDG_CONFIG_HOME” is equal to “Before Setting XDG_CONFIG_HOME”

# Versions

=== Xamarin Studio Business ===

Version 6.0 (build 4968)
Installation UUID: 8de31dd3-bae5-4d28-a912-02a69acafc5b
Runtime:
	Mono 4.4.0 (mono-4.4.0-branch/a3fabf1) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 404000122

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.3 (10183.3)
Build 7D175

=== Xamarin.iOS ===

Version: 9.8.0.244 (Xamarin Business)
Hash: 977921b
Branch: cycle7
Build date: 2016-04-07 14:20:17-0400

=== Xamarin.Android ===

Version: 6.1.0.37 (Xamarin Business)
Android SDK: /Users/codybeyer/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 25.1.1
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.3

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Version: 2.8.0.244 (Xamarin Business)

=== Xamarin Inspector ===

Version: 0.7.2.0
Hash: 357da8b
Branch: master
Build date: Thu Apr 14 20:41:42 UTC 2016

=== Build Information ===

Release ID: 600004968
Git revision: ab7092ce63351276394f283e4f9c8646baf51fce
Build date: 2016-04-08 09:30:34-04
Xamarin addins: be0a0aef6ec8b075b4ba4690bd147d1e33c2abd7
Build lane: monodevelop-lion-cycle7

=== Operating System ===

Mac OS X 10.11.4
Darwin Codys-MacBook-Pro.local 15.4.0 Darwin Kernel Version 15.4.0
	Fri Feb 26 22:08:05 PST 2016
	root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Xamarin Inspector 0.7.2.0
Comment 1 Sebastien Pouliot 2016-04-20 18:03:45 UTC
The implementation is, by design, different on iOS as we need to query the OS for the correct directories (e.g. it changed over time for different iOS versions). Re-using Mono's implementation would lead to application rejections (e.g. storing files to the wrong place).

Android is GNU/Linux*-based and shares Mono's implementation, which supports XDG_CONFIG_HOME, a freedesktop specification (which Apple does not follow).

[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html