From f5c3ee205a130edbc260556f17dc7e9fa4e9fea4 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Tue, 20 Nov 2018 15:35:08 -0500 Subject: [PATCH] [mono-runtimes] Update @(MonoFacadeAssembly) Fixes: https://github.com/xamarin/xamarin-android/issues/1879 Add the following Facade assemblies to `@(MonoFacadeAssembly)`: * `System.Buffers.dll` * `System.Memory.dll` * `System.Threading.Tasks.Extensions.dll` Note: list was reordered to be sorted as per **sort**(1), and generated with the following shell code on macOS: $ cd external/mono/mcs/class/Facades $ for d in `find . -depth 1 -type d | grep -v 'netstandard\|System.Drawing.Primitives\|System.Net.Http.Rtc' | sort -f` ; do n=`basename "$d"`; echo " "; done | pbcopy The `netstandard` and `System.Drawing.Primitives` directory are excluded so that the comment and following `@(MonoFacadeAssembly)` entries in `ProfileAssemblies.projitems` are still relevant. --- Documentation/workflow/HowToBumpMono.md | 250 ++++++++++++++++++ src/mono-runtimes/ProfileAssemblies.projitems | 28 +- 2 files changed, 266 insertions(+), 12 deletions(-) create mode 100644 Documentation/workflow/HowToBumpMono.md diff --git a/Documentation/workflow/HowToBumpMono.md b/Documentation/workflow/HowToBumpMono.md new file mode 100644 index 00000000000..c859da4733b --- /dev/null +++ b/Documentation/workflow/HowToBumpMono.md @@ -0,0 +1,250 @@ +# How To Bump Mono + +There will eventually be two ways that xamarin-android depends on mono: + + 1. Via [source code](#mono-source), or + 2. Via [mono archive](#mono-archive) + + + + +## Mono Source + +When using mono from source -- which is required for all versions of mono +before the `mono/2018-10` release branch -- the +[`external/mono`](../../external) git submodule reference is used. + +Currently, many parts of the xamarin-android build system *require* the +presence and use of mono source code, including: + + * The [`src/Mono.Posix`](../../src/Mono.Posix) and + [`src/Mono.Data.Sqlite`](../../src/Mono.Data.Sqlite) builds. + * Inclusion of PDB2MDB source code within + [`src/Xamarin.Android.Build.Tasks`](../../src/Xamarin.Android.Build.Tasks). + * Inclusion of networking and related code into + [`src/monodroid`](../../src/monodroid). + +We are working to remove these source dependencies so that we can support using +a [Mono Archive](#mono-archive) in the future. + +Until a Mono Archive *exists* and can be *used*, source code integration must +fulfill the following checklist: + + - [ ] [Update `.gitmodules`](#update-gitmodules). + - [ ] [Update `external/mono` submodule reference](#update-mono-submodule). + - [ ] [Update system mono used for the build](#update-system-mono). + - [ ] [Update `MonoAndroid` Profile Assemblies](#update-profile) + - [ ] [Ensure it *builds*](#build). + - [ ] [Ensure unit tests *pass*](#unit-tests). + - [ ] [Check for API Breakage](#api-validation). + - [ ] [Create a Pull Request](#create-pr). + - [ ] [Ask for QA Validation](#qa-validation) (***LAST***). + + + + +### Update `.gitmodules` + +Update [`.gitmodules`](../../.gitmodules) to refer to the correct mono branch. + + + + +### Update `external/mono` + +Update the git submodule reference that [`external/mono`](../../external) refers to: + + cd external/mono + git checkout BRANCH-NAME + git pull --rebase + + + + +### Update system mono + +The `$(MonoRequiredMinimumVersion)` and `$(MonoRequiredMaximumVersion)` values +within [`Configuration.props`](../../Configuration.props) +should be updated to correspond to the version number used in the mono submodule. + +These version numbers can be found in +[mono's `configure.ac`](https://github.com/mono/mono/blob/master/configure.ac) +in the `AC_INIT()` statement. + +The `$(_DarwinMonoFramework)` and `%(RequiredProgram.DarwinMinimumUrl)` values +within [`build-tools/dependencies/dependencies.projitems`](../../build-tools/dependencies/dependencies.projitems) +should be updated to corresponds to the version number used in the mono submodule. + +`%(DarwinMinimumUrl)` must be a macOS `.pkg` file and must exist. + +For example, see commit +[606675b5](https://github.com/xamarin/xamarin-android/commit/606675b59f52595e3030c529de4c856fb347edd8): + +```diff +diff --git a/Configuration.props b/Configuration.props +index a2a9c1d1..ec78ddb4 100644 +--- a/Configuration.props ++++ b/Configuration.props +@@ -70,8 +70,8 @@ + $(MSBuildThisFileDirectory)external\Java.Interop + $(MSBuildThisFileDirectory)external\llvm + $(MSBuildThisFileDirectory)external\mono +- 5.14.0 +- 5.15.0 ++ 5.16.0 ++ 5.17.0 + True + $(MonoRequiredMinimumVersion).0 + $(MSBuildThisFileDirectory)external\mono\external\linker +diff --git a/build-tools/dependencies/dependencies.projitems b/build-tools/dependencies/dependencies.projitems +index f4a2f60e..1bd5d8c2 100644 +--- a/build-tools/dependencies/dependencies.projitems ++++ b/build-tools/dependencies/dependencies.projitems +@@ -1,7 +1,7 @@ + + + +- <_DarwinMonoFramework>MonoFramework-MDK-5.14.0.141.macos10.xamarin.universal.pkg ++ <_DarwinMonoFramework>MonoFramework-MDK-5.16.0.106.macos10.xamarin.universal.pkg + <_AptGetInstall>apt-get -f -u install + + +@@ -59,7 +59,7 @@ + $(MonoRequiredMaximumVersion) + $(MonoRequiredDarwinMinimumVersion) + $(MSBuildThisFileDirectory)..\scripts\mono-version +- https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-04/116/8ae8c52383b43892fb7a35dbf0992738bd52fa90/$(_DarwinMonoFramework) ++ https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-06/78/341142d7656f43239a041b2c44f00acfb8fa7c59/$(_DarwinMonoFramework) + installer -pkg "$(AndroidToolchainCacheDirectory)\$(_DarwinMonoFramework)" -target / + + +``` + + + + +### Update `MonoAndroid` Profile Assemblies + +[`src/mono-runtimes/ProfileAssemblies.projitems`](../../src/mono-runtimes/ProfileAssemblies.projitems) +has three item groups that may need to be updated: + + * `@(MonoFacadeAssembly)` + * `@(MonoProfileAssembly)` + * `@(MonoTestAssembly)` + +There must be a `@(MonoFacadeAssembly)` entry for every Facade assembly that +must be shipped in the SDK. Facade assemblies are installed into the +`bin/$(Configuration)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Facades` +directory. + +The `@(MonoFacadeAssembly)` list can be updated with this shell code on macOS: + + $ cd external/mono/mcs/class/Facades + $ for d in `find . -depth 1 -type d | grep -v 'netstandard\|System.Drawing.Primitives\|System.Net.Http.Rtc' | sort -f` ; do + n=`basename "$d"`; + echo " "; + done | pbcopy + +The `@(MonoProfileAssembly)` item group is for non-Facade assemblies, which are +installed into the +`bin/$(Configuration)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0` +directory. This item group must be updated whenever a new BCL assembly is added. + +The `@(MonoTestAssembly)` item group contains unit test assemblies, executed by +[`tests/BCL-Tests`](../../tests/BCL-Tests). +The `%(MonoTestAssembly.SourcePath)` item metadata is the directory name within +`external/mono/mcs/class` which contains files needed for execution by the unit +tests. +The `%(MonoTestAssembly.TestType)` item metadata is the *type* of unit test +assembly; valid values are `xunit` (for xUnit unit test assemblies), +`reference` (for ???), and the empty string/not set (for NUnit assemblies). + + + + +### Ensure it *builds* + +`make all` only builds a subset of the full Xamarin.Android SDK: support +for only select ABIs (host OS, x86, armeabi-v7a), only one `Mono.Android.dll` +version, and *no* builds for Windows support. + +Ensure that `make all` builds *first*. Once that builds, move on to using +`make jenkins`, which adds support for *all* ABIs, *plus* AOT and LLVM +compilers, plus Windows binaries. + +See [`Documentation/building/unix-instructions.md`](../building/unix-instructions.md). + + + + +### Ensure Unit Tests *Pass* + +Run the unit tests by using `make all-tests run-all-tests`. + +All unit tests should pass. + +See [`Documentation/building/unix-instructions.md`](../building/unix-instructions.md). + + + + +### Create a Pull Request + +Create a Pull Request (PR) on the https://github.com/xamarin/xamarin-android repo. + +Add the **full-mono-integration-build** label to the PR. This ensures that +the PR build is the full `make jenkins` build. + +The resulting PR *should* be green before merging. + + + + +### Check for API Breakage + +The `make run-api-compatibility-tests` target will check the built assemblies +for API breakage. + +PR builds may report API breakage in the left-hand pane, in an +**API Compatibility Checks** link. If the API Compatibility Checks link is +not present, no API breakage was detected. + +For example, this build: + + + +links to this set of reported API breakage: + + + +**To fix reported API breakage**, the mono sources may need to be updated, *or* +the [`xamarin/xamarin-android-api-compatibility`](https://github.com/xamarin/xamarin-android-api-compatibility/) +repo will need to be updated to "accept" the reported breakage, by updating +the [`external/xamarin-android-api-compatibility`](../../external) submodule +reference. + +See the xamarin-android-api-compatibility repo for details. + + + + +### Ask for QA Validation + +Asking QA for validation should be done ***last***. + +Once QA approves, the mono bump PR can be merged. + + + + +## Mono Archives + +A "Mono Archive" is a binary package (`.zip` file) which contains *binary* +mono artifacts, *not* source code. + +See also: + + * The [Mono SDKs Integration project](https://github.com/xamarin/xamarin-android/projects/10) + * Commit [f970cd50](https://github.com/xamarin/xamarin-android/commit/f970cd50d2c19dcb4b62cc1dd1198c31cc10a2df) + +TODO. :-) diff --git a/src/mono-runtimes/ProfileAssemblies.projitems b/src/mono-runtimes/ProfileAssemblies.projitems index 7a95aa884b3..8043c201e48 100644 --- a/src/mono-runtimes/ProfileAssemblies.projitems +++ b/src/mono-runtimes/ProfileAssemblies.projitems @@ -2,15 +2,16 @@ - + - + + - + @@ -29,13 +30,13 @@ - + - - + + @@ -47,6 +48,7 @@ + @@ -61,8 +63,8 @@ - + @@ -76,8 +78,8 @@ - + @@ -96,12 +98,12 @@ - + - + @@ -118,14 +120,15 @@ - + - + + @@ -139,6 +142,7 @@ +