diff --git a/.external b/.external index 397ac19bcd2..72570a40307 100644 --- a/.external +++ b/.external @@ -1,2 +1,2 @@ xamarin/monodroid:master@1b907d680cc6561dcfaddc6f997d2f6ff5456644 -mono/mono:2019-08@8946e49a974ea8b75fe5b8b7e93ffd4571521a85 +mono/mono:2019-10@18920a83f423fb864a2263948737681968f5b2c8 diff --git a/Configuration.props b/Configuration.props index 7a46a11b5e1..5759bf23013 100644 --- a/Configuration.props +++ b/Configuration.props @@ -81,10 +81,10 @@ armeabi-v7a:arm64-v8a:x86 $(MSBuildThisFileDirectory)external\Java.Interop $(MSBuildThisFileDirectory)external\mono - 6.6.0 - 6.7.0 + 6.8.0 + 6.9.0 True - $(MonoRequiredMinimumVersion).54 + $(MonoRequiredMinimumVersion).61 $(MSBuildThisFileDirectory)external\mono\sdks\out\android-sources\external\linker\src $(MSBuildThisFileDirectory)external\opentk \usr diff --git a/Documentation/guides/BuildProcess.md b/Documentation/guides/BuildProcess.md index 43bf0f6b879..219e97b3571 100644 --- a/Documentation/guides/BuildProcess.md +++ b/Documentation/guides/BuildProcess.md @@ -735,12 +735,15 @@ when packaging Release applications. This corresponds to the **Native TLS 1.2+** setting in the Visual Studio property pages. - - `legacy`: Use the historical managed SSL implementation for - network interaction. This *does not* support TLS 1.2. + - `legacy`: In Xamarin.Android v10.1 and earlier, use the historical + managed SSL implementation for network interaction. This *does not* support TLS 1.2. This corresponds to the **Managed TLS 1.0** setting in the Visual Studio property pages. + In Xamarin.Android v10.2 and later, this value is ignored and the + `btls` setting is used. + - `default`: This value is unlikely to be used in Xamarin.Android projects. The recommended value to use instead is the empty string, which corresponds to the **Default** setting in the Visual Studio diff --git a/Documentation/release-notes/3753.md b/Documentation/release-notes/3753.md new file mode 100644 index 00000000000..ba91dbc4f27 --- /dev/null +++ b/Documentation/release-notes/3753.md @@ -0,0 +1,9 @@ +### Bumps to mono/mono/2019-10@18920a83 + +This brings in a multitude of changes. + +TODO: link to Mono release notes for Mono 6.8.0. + +In particular, this updates `Mono.Security.dll` to *remove* support for TLS 1.0. +When the `$(AndroidTlsProvider)` MSBuild property is set to `legacy` or +`default`, the `btls` value will now be used. \ No newline at end of file diff --git a/Documentation/workflow/HowToBumpMono.md b/Documentation/workflow/HowToBumpMono.md index b44118a7b07..180f84eda80 100644 --- a/Documentation/workflow/HowToBumpMono.md +++ b/Documentation/workflow/HowToBumpMono.md @@ -1,64 +1,18 @@ # How To Bump Mono -There will eventually be two ways that xamarin-android depends on mono: +Android uses a binary artifcats package from mono that is tied to a specific version / commit. This makes it pretty trivial to bump mono. - 1. Via [source code](#mono-source), or - 2. Via [mono archive](#mono-archive) +The folloing checklist covers what you need to do. Note, if you know the system mono version does not need changed, you can skip the first step. - - - -## 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) + - [ ] [Update MonoRequiredDarwinMinimumVersion used in the build](#update-configuration-props). + - [ ] [Update external mono commit in .external](#update-mono-external-commit). - [ ] [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 @@ -71,92 +25,21 @@ 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\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. - -This script uses the contents of `external/mono/sdks/out/android-bcl`, and thus -requires either a local monodroid sdks build, or the extraction of a -[Mono Archive](#mono-archive). - -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.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). - - -It should be possible to update `ProfileAssemblies.projitems` by running the -script `build-tools/scripts/gen-ProfileAssemblies.sh`: - - build-tools/scripts/gen-ProfileAssemblies.sh > src/mono-runtimes/ProfileAssemblies.projitems +An example within Configuration.props: + +`6.8.0` + +`6.9.0` + + + +### Update external mono commit in .external + +Updating the commit in this file will pull in the version of mono you want to bump to. +Within [`.external`](../../.external) indicate the mono branch and commit. For example: + +`mono/mono:2019-10@e9b5aec5ec7801df66117f2da730672ede15dcc6` @@ -232,17 +115,3 @@ 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/build-tools/automation/build.linux.groovy b/build-tools/automation/build.linux.groovy index 1501261fcb4..41798d79bff 100644 --- a/build-tools/automation/build.linux.groovy +++ b/build-tools/automation/build.linux.groovy @@ -27,6 +27,7 @@ def chRootPackages = ''' lib32z1 libc++-dev libgdk-pixbuf2.0-dev + libmono-btls-interface4.0-cil libncurses5-dev libsqlite3-dev libtinfo-dev:i386 diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs index 4930eb13df0..0642ea9a328 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs @@ -7,7 +7,7 @@ partial class Configurables partial class Urls { public static readonly Uri Corretto = new Uri ($"{Corretto_BaseUri}{CorrettoUrlPathVersion}/amazon-corretto-{CorrettoDistVersion}-macosx-x64.tar.gz"); - public static readonly Uri MonoPackage = new Uri ("https://download.mono-project.com/archive/6.4.0/macos-10-universal/MonoFramework-MDK-6.4.0.198.macos10.xamarin.universal.pkg"); + public static readonly Uri MonoPackage = new Uri ("https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2019-10/57/e9b5aec5ec7801df66117f2da730672ede15dcc6/MonoFramework-MDK-6.8.0.53.macos10.xamarin.universal.pkg"); } partial class Defaults diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/MacOS.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/MacOS.cs index 60d322bb5c6..a5625783be5 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/MacOS.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/MacOS.cs @@ -33,7 +33,7 @@ partial class MacOS // If you change the minimum Mono version here, please change the URL as well new MonoPkgProgram ("Mono", "com.xamarin.mono-MDK.pkg", Configurables.Urls.MonoPackage) { - MinimumVersion = "6.0.0.313", + MinimumVersion = "6.8.0.53", MaximumVersion = "6.99.0.0", }, }; diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_BuildMonoRuntimes.Unix.cs b/build-tools/xaprepare/xaprepare/Steps/Step_BuildMonoRuntimes.Unix.cs index dcd13c40f57..fff20d9d3bd 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_BuildMonoRuntimes.Unix.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_BuildMonoRuntimes.Unix.cs @@ -411,8 +411,7 @@ List PrepareMakeArguments (Context context, string workingDirectory, Lis string toolchainsPrefix = Path.Combine (GetProperty (KnownProperties.AndroidToolchainDirectory), "toolchains"); var ret = new List { - "DISABLE_IOS=1", - "DISABLE_MAC=1", + "ENABLE_ANDROID=1", $"CONFIGURATION={Configurables.Defaults.MonoSdksConfiguration}", "IGNORE_PROVISION_MXE=false", "IGNORE_PROVISION_ANDROID=true", diff --git a/external/xamarin-android-api-compatibility b/external/xamarin-android-api-compatibility index a61271e046d..50a3c52db76 160000 --- a/external/xamarin-android-api-compatibility +++ b/external/xamarin-android-api-compatibility @@ -1 +1 @@ -Subproject commit a61271e046db989b4c9ec9f4d00c4358e07a2930 +Subproject commit 50a3c52db760fa024185b8b580717f173c9f11ed diff --git a/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PreserveTlsProvider.cs b/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PreserveTlsProvider.cs index 0f1961e2fc0..043b47805d3 100644 --- a/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PreserveTlsProvider.cs +++ b/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PreserveTlsProvider.cs @@ -34,12 +34,10 @@ TypeDefinition GetTlsProvider (ModuleDefinition module) TypeDefinition type; switch (provider) { - case "btls": - type = module.GetType ("Mono.Btls.MonoBtlsProvider"); - break; case "legacy": case "default": - type = module.GetType ("Mono.Net.Security.LegacyTlsProvider"); + case "btls": + type = module.GetType ("Mono.Btls.MonoBtlsProvider"); break; default: throw new InvalidOperationException (string.Format ("Unknown TlsProvider `{0}`.", provider)); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs index 1a1cb2becd3..d9b5fcee43e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs @@ -409,13 +409,7 @@ void AddProfilers (ZipArchiveEx apk, string abi) void AddBtlsLibs (ZipArchiveEx apk, string abi) { - if (string.IsNullOrEmpty (TlsProvider) || - string.Compare ("btls", TlsProvider, StringComparison.OrdinalIgnoreCase) == 0) { - AddNativeLibrary (apk, abi, "libmono-btls-shared.so"); - } - // These are the other supported values - // * "default": - // * "legacy": + AddNativeLibrary (apk, abi, "libmono-btls-shared.so"); } void AddRuntimeLibraries (ZipArchiveEx apk, string [] supportedAbis) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index 1efd5d1bb55..17a89b0dead 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -2701,8 +2701,8 @@ public void BuildWithResolveAssembliesFailure ([Values (true, false)] bool usePa { // androidTlsProvider, isRelease, extpected new object[] { "", true, true, }, - new object[] { "default", true, false, }, - new object[] { "legacy", true, false, }, + new object[] { "default", true, true, }, + new object[] { "legacy", true, true, }, new object[] { "btls", true, true, } }; diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj index 9b22dcbca0a..0818086365e 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj @@ -328,6 +328,9 @@ Linker\Linker\MethodReferenceExtensions.cs + + Linker\Linker\OutputException.cs + Linker\Linker\OverrideInformation.cs