diff options
author | therzok <marius.ungureanu@xamarin.com> | 2017-04-25 16:03:00 +0300 |
---|---|---|
committer | therzok <marius.ungureanu@xamarin.com> | 2017-04-25 16:03:00 +0300 |
commit | 902ce678150d145a29dd5435f1b3b11f61b48df0 (patch) | |
tree | cddc24f0d1614c2e82f5b2d8def0ad3d10e2244c /main/src/addins/VersionControl | |
parent | c5ab6fd22742c285c0e8b374d6b7deb6e59514b3 (diff) |
Add comment as to why we need to dlopen libsvnclient.
Diffstat (limited to 'main/src/addins/VersionControl')
-rw-r--r-- | main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/LibSvnClient.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/LibSvnClient.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/LibSvnClient.cs index 85a76b285c..b976b4e88a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/LibSvnClient.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/LibSvnClient.cs @@ -23,6 +23,16 @@ namespace MonoDevelop.VersionControl.Subversion.Unix { public static LibSvnClient GetLib () { + // Here be linker dragons. + // Due to the way the mono dlloader works, and how svn is architected we need to manually load libsvn_client + // Because libsvn_client relies on apr_initialize being called, we need to get the right apr dependency. + // Letting mono resolve both libraries separately will only load libsvn_client's deps when needed, + // Thus it'll end up loading the wrong libapr in the case of Mac. + // We rely on using Xcode's libsvn_client, so if that isn't found or the license hasn't been accepted, + // it'll be skipped. If svn is installed from somewhere else (most commonly via brew), we end up loading + // brew's libsvn_client and the system libapr, which are mismatched on dependency versions causing a native + // crash. dlopen-ining libsvn_client allows us to handle the right mix-match of svn and apr, since it loads + // apr via the linker flags on the binary. if (Core.Platform.IsMac) { dlopen ("libsvn_client-1.0.dylib", 0x1); return new LibSvnClient2 (); |