You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cecil is an "interesting" complication: it's a dependency of
Java.Interop, but Xamarin.Android use requires that it be "vendorized"
-- renamed as `Xamarin.Android.Cecil.dll` -- to avoid previously seen
issues because it's an unsigned assembly, and thus There Can Be Only
One `Mono.Cecil.dll` loaded into an AppDomain, and whichever is loaded
first "wins", but that version may not be compatible with what other
assemblies in the AppDomain need, and...
Renaming the assembly was just seen as the easiest solution.
This choice hasn't been without its own shortcomings; see e.g. commits
168c94d ("priorities"), cfa74d3 (downstream build system changes),
5eeb287 ("rebuilds are hard"), 6717275 ("because of 168c94d,
xamarin-android 'owns' the checkout, but that may not be API
compatible, oops"), etc., etc.
Plus, it kinda became moot with [dotnet/android@0c9f83b7][0]
which removed the `mono` git submodule from xamarin-android. Instead
of building mono from source -- and, implicitly, building *cecil* from
source -- mono was instead obtained from a "mono archive" which
contained a prebuilt `Mono.Cecil.dll` which was "renamed" to
`Xamarin.Android.Cecil.dll`.
Which meant that in a xamarin-android build, cecil should *never* be
built from source anymore, which in turn meant that -- give or take
the occasional build system bug --
`Java.Interop/src/Xamarin.Android.Cecil` and company were "dead code",
as far as the commercial product is concerned.
Meanwhile, the existance of `src/Xamarin.Android.Cecil` proved to be
an ongoing source of maintenance pain, as -- depending on the IDE --
it couldn't build reliably, or would rebuild when it shouldn't have.
Rethink the whole Cecil relationship. If xamarin-android doesn't
require a cecil source checkout, why not ditch it entirely?
Remove the `external/cecil` git submodule, and the
`src/Xamarin.Android.Cecil*` projects, and replace them with NuGet
package references to the [`Mono.Cecil` NuGet package][1].
What this means is that a "pure Java.Interop" build will now have
*different* assembly references than the "same" utilities built from
xamarin-android. For example, `generator.exe`, when built from
Java.Interop, will reference `Mono.Cecil.dll`, while it will instead
reference `Xamarin.Android.Cecil.dll` when built from xamarin-android.
The `$(CecilSourceDirectory)` MSBuild property is used to determine
whether the Mono.Cecil NuGet package or the `Xamarin.Android.Cecil.dll`
assembly reference should be used at build time.
[0]: dotnet/android@0c9f83b
[1]: https://www.nuget.org/packages/Mono.Cecil/0.11.2
0 commit comments