Skip to content

Commit 5b7c5bf

Browse files
Bump to dotnet/installer@d5520378 8.0.200-alpha.1.22511.1 (#7451)
Changes: dotnet/installer@11f6b8f...d552037 Changes: dotnet/linker@5f9bfd9...493ce62 Changes: dotnet/runtime@6d10e4c...b8d4980 Context: dotnet/runtime#77273 Context: dotnet/runtime@e465230 Context: dotnet/runtime#77385 Build and run under .NET 8! .NET 8 is used by default for the default build. Running unit tests also requires installing .NET 6 and .NET 7 as well. Configure dotnet6 + dotnet7 + dotnet8 NuGet feeds. Run `darc update-dependencies --id 152596` to update the dotnet/installer version in `eng/Version.Details.xml`. (ID values come from [Maestro][0].) Update `AutoImport.props` to only evaluate default android items in .NET 8. Update `$(DotNetTargetFrameworkVersion)` to 8.0, and `$(DotNetStableTargetFramework)` to `net7.0`. (Technically .NET 7 isn't stable *yet*, but it will be soon enough…) Update `*.apkdesc` files so that unit tests pass. Update `PackagingTest.CheckIncludedAssemblies()` test to remove assemblies which are no longer included in .NET 8-based apps. Update `use-dot-net.yaml` to take a new `quality` parameter, and install .NET Core 3.1 quality=GA, not 3.1.417 specifically. Avoids the error: dotnet-install: Failed to locate the latest version in the channel '3.1.417' with 'preview' quality for 'dotnet-sdk', os: 'win', architecture: 'x64'. Update `src/Mono.Android.Export` to pass `MethodAttributes.Static | MethodAttributes.Public` to the `DynamicMethod` constructor, not just `MethodAttributes.Static`. This avoids a `NotSupportedException` under .NET 8; see also dotnet/runtime@e4652303 and dotnet/runtime#77273: System.NotSupportedException: Wrong MethodAttributes or CallingConventions for DynamicMethod. Only public, static, standard supported at System.Reflection.Emit.DynamicMethod.CheckConsistency(MethodAttributes attributes, CallingConventions callingConvention) at System.Reflection.Emit.DynamicMethod.Init(String name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] signature, Type owner, Module m, Boolean skipVisibility, Boolean transparentMethod) at System.Reflection.Emit.DynamicMethod..ctor(String name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Module m, Boolean skipVisibility) at Java.Interop.DynamicCallbackCodeGenerator.GenerateNativeCallbackDelegate() at Java.Interop.DynamicCallbackCodeGenerator.GetCallback() at Java.Interop.DynamicCallbackCodeGenerator.Create(MethodInfo method) at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr) Update `XASdkTests.DotNetPublish()` for .NET 8. With 745214d we asserted that builds using the *non-* latest target framework would use a `Mono.Android.dll` reference assembly *from the build*, not from an existing published/NuGet-provided `Microsoft.Android.Ref` package. This started failing because `$(TargetFramework)`=net7.0-android is no longer the latest framework and thus *should* be using published packages, not in-tree bits: Build should be using C:\a_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Ref.33\34.0.0-ci.pr.gh7451.52\ref\net7.0\Mono.Android.dll Expected: True But was: False Update the test to instead make this assertion only for the latest target framework (`net8.0-android`), skipping .NET 7. Remove an assertion of no build warnings under `net7.0`; this isn't currently possible, due to dotnet/runtime#77385. Update the `Microsoft.NETCore.App.Runtime.AOT.Cross` SDK package names when `$(AotAssemblies)`=True; the names do not (yet?) include the .NET version in the package names. When installing multiple .NET SDKs into a single folder with the `dotnet-install.{.sh,ps1}` script -- needed to run the unit tests -- you can hit an issue where `dotnet` no longer runs: dotnet --info Exited with code: 137 The problem is that the `dotnet` binary can get overwritten by an older .NET, and be completely broken. The solution is: 1. Install the newest .NET first, followed by any older versions 2. Use `dotnet-install.ps1 -SkipNonVersionedFiles` or `dotnet-install.sh --skip-non-versioned-files` so the `dotnet` binary isn't overwritten This results in the newest .NET SDK, with side-by-side older .NET SDKs installed as well. Rename `tests/api-compatibility/acceptable-breakages-vReference-net7.0.txt` to use `-net8.0`, as the default `$(TargetFramework)` for `Mono.Android.dll` changed. [0]: https://maestro-prod.westus2.cloudapp.azure.com/3074/https:%2F%2Fgithub.com%2Fdotnet%2Finstaller/latest/graph
1 parent f5e7541 commit 5b7c5bf

File tree

35 files changed

+225
-215
lines changed

35 files changed

+225
-215
lines changed

Configuration.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<DebugType Condition=" '$(DebugType)' == '' ">portable</DebugType>
4848
<Deterministic Condition=" '$(Deterministic)' == '' ">True</Deterministic>
4949
<LangVersion Condition=" '$(LangVersion)' == '' ">latest</LangVersion>
50+
<AndroidNet7Version Condition=" '$(AndroidNet7Version)' == '' ">33.0.1</AndroidNet7Version>
5051
<AndroidNet6Version Condition=" '$(AndroidNet6Version)' == '' ">32.0.476</AndroidNet6Version>
5152
</PropertyGroup>
5253
<PropertyGroup Condition=" '$(HostOS)' == '' ">

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project>
22

33
<PropertyGroup>
4-
<DotNetTargetFrameworkVersion>7.0</DotNetTargetFrameworkVersion>
4+
<DotNetTargetFrameworkVersion>8.0</DotNetTargetFrameworkVersion>
55
<DotNetTargetFramework>net$(DotNetTargetFrameworkVersion)</DotNetTargetFramework>
66
<DotNetAndroidTargetFramework>$(DotNetTargetFramework)-android</DotNetAndroidTargetFramework>
77
<!-- Used for bootstrap, command-line tooling, and desktop NUnit projects -->
8-
<DotNetStableTargetFramework>net6.0</DotNetStableTargetFramework>
8+
<DotNetStableTargetFramework>net7.0</DotNetStableTargetFramework>
99
<TargetFrameworkNETStandard>netstandard2.0</TargetFrameworkNETStandard>
1010
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
1111
<BuildOutputDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\</BuildOutputDirectory>

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUNTIME := $(shell which mono64 2> /dev/null && echo mono64 || echo mono)
77
SOLUTION = Xamarin.Android.sln
88
TEST_TARGETS = build-tools/scripts/RunTests.targets
99
API_LEVEL ?=
10-
PREPARE_NET_FX = net6.0
10+
PREPARE_NET_FX = net7.0
1111
PREPARE_ARGS =
1212
PREPARE_PROJECT = build-tools/xaprepare/xaprepare/xaprepare.csproj
1313
PREPARE_MSBUILD_FLAGS = $(PREPARE_MSBUILD_ARGS) $(MSBUILD_ARGS)

NuGet.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<!-- ensure only the sources defined below are used -->
66
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />
77
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" />
8-
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
8+
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
99
<!-- This is needed (currently) for the Xamarin.Android.Deploy.Installer dependency, getting the installer -->
1010
<!-- Android binary, to support delta APK install -->
1111
<add key="xamarin.android util" value="https://pkgs.dev.azure.com/xamarin/public/_packaging/Xamarin.Android/nuget/v3/index.json" />
12-
<!-- Added manually for dotnet/runtime 6.0.9 -->
13-
<add key="darc-pub-dotnet-emsdk-3f6c45a" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3f6c45a2/nuget/v3/index.json" />
14-
<add key="darc-pub-dotnet-runtime-8c6bcad" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-8c6bcad1/nuget/v3/index.json" />
12+
<!-- Added manually for dotnet/runtime 6.0.11 -->
13+
<add key="darc-pub-dotnet-emsdk-c3fc739" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-c3fc739c/nuget/v3/index.json" />
14+
<add key="darc-pub-dotnet-runtime-1e1f688" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-1e1f688d/nuget/v3/index.json" />
1515
</packageSources>
1616
<disabledPackageSources />
1717
</configuration>

build-tools/automation/azure-pipelines.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ stages:
179179
# xabuild still depends on .NET Core 3 or earlier
180180
- template: yaml-templates\use-dot-net.yaml
181181
parameters:
182-
version: 3.1.417
182+
version: 3.1
183+
quality: GA
183184

184185
# Downgrade the XA .vsix installed into the instance of VS that we are building with so that we don't restore/build against a test version.
185186
# The VS installer will attempt to resume any failed or partial installation before trying to downgrade Xamarin.Android.

build-tools/automation/yaml-templates/setup-test-environment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ steps:
3636
displayName: set JI_JAVA_HOME
3737
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))
3838

39+
# Install .NET 6 for legacy tests
3940
- template: use-dot-net.yaml
4041
parameters:
42+
version: 6.0
43+
quality: GA
4144
remove_dotnet: ${{ parameters.remove_dotnet }}
4245

46+
# Install latest .NET
47+
- template: use-dot-net.yaml
48+
4349
- task: DotNetCoreCLI@2
4450
displayName: shut down existing build daemons
4551
inputs:

build-tools/automation/yaml-templates/use-dot-net.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
parameters:
55
version: $(DotNetSdkVersion)
6+
quality: $(DotNetSdkQuality)
67
remove_dotnet: false
78

89
steps:
@@ -37,7 +38,7 @@ steps:
3738
$sleepTime = $sleepTime * 2
3839
}
3940
}
40-
& .\dotnet-install.ps1 -Version ${{ parameters.version }} -InstallDir $DotNetRoot -Verbose
41+
& .\dotnet-install.ps1 -Channel ${{ parameters.version }} -Quality ${{ parameters.quality }} -InstallDir $DotNetRoot -SkipNonVersionedFiles -Verbose
4142
displayName: install .NET Core ${{ parameters.version }}
4243
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
4344
@@ -46,7 +47,7 @@ steps:
4647
(if [[ "${{ parameters.remove_dotnet }}" == "true" ]] ; then rm -rfv $DOTNET_ROOT; fi) &&
4748
curl -L https://dot.net/v1/dotnet-install.sh --retry 5 --retry-max-time 300 > dotnet-install.sh &&
4849
chmod +x dotnet-install.sh &&
49-
./dotnet-install.sh --version ${{ parameters.version }} --install-dir $DOTNET_ROOT --verbose &&
50+
./dotnet-install.sh --channel ${{ parameters.version }} --quality ${{ parameters.quality }} --install-dir $DOTNET_ROOT --skip-non-versioned-files --verbose &&
5051
PATH="$DOTNET_ROOT:$PATH" &&
5152
echo "##vso[task.setvariable variable=DOTNET_ROOT]$DOTNET_ROOT" &&
5253
echo "##vso[task.setvariable variable=PATH]$PATH"

build-tools/automation/yaml-templates/variables.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ variables:
1818
- name: NUnit.NumberOfTestWorkers
1919
value: 4
2020
- name: DotNetSdkVersion
21-
value: 6.0.300
21+
value: 7.0.1xx
22+
- name: DotNetSdkQuality
23+
value: preview
2224
- name: GitHub.Token
2325
value: $(github--pat--vs-mobiletools-engineering-service2)
2426
- name: HostedMacImage
@@ -32,9 +34,9 @@ variables:
3234
- name: TeamName
3335
value: XamarinAndroid
3436
- name: DotNetTargetFramework
35-
value: net7.0
37+
value: net8.0
3638
- name: DotNetStableTargetFramework
37-
value: net6.0
39+
value: net7.0
3840
# Workaround: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1585820
3941
- name: _WriteTelemetryProperties
4042
value: false

build-tools/create-packs/Directory.Build.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
</PropertyGroup>
123123
<ItemGroup>
124124
<_NuGetSources Include="$(OutputPath.TrimEnd('\'))" />
125-
<!-- This allows us to install our Android .NET 6 packs -->
125+
<!-- This allows us to install our older Android .NET packs -->
126+
<_NuGetSources Include="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
126127
<_NuGetSources Include="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
127128
<_PreviewPacks Condition=" '$(AndroidLatestStableApiLevel)' != '$(AndroidLatestUnstableApiLevel)' " Include="$(XamarinAndroidSourcePath)bin\Build$(Configuration)\nuget-unsigned\Microsoft.Android.Ref.$(AndroidLatestUnstableApiLevel).*.nupkg" />
128129
<_InstallArguments Include="android" />

build-tools/create-packs/Microsoft.NET.Sdk.Android.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ about the various Microsoft.Android workloads.
3535
<ReplaceFileContents
3636
SourceFile="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.NET.Sdk.Android\WorkloadManifest.in.json"
3737
DestinationFile="$(WorkloadManifestJsonPath)"
38-
Replacements="@WORKLOAD_VERSION@=$(WorkloadVersion);@NET6_VERSION@=$(AndroidNet6Version)">
38+
Replacements="@WORKLOAD_VERSION@=$(WorkloadVersion);@NET7_VERSION@=$(AndroidNet7Version);@NET6_VERSION@=$(AndroidNet6Version)">
3939
</ReplaceFileContents>
4040
<ReplaceFileContents
4141
SourceFile="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.NET.Sdk.Android\WorkloadManifest.in.targets"
4242
DestinationFile="$(WorkloadManifestTargetsPath)"
43-
Replacements="@NET6_VERSION@=$(AndroidNet6Version)">
43+
Replacements="@NET7_VERSION@=$(AndroidNet7Version);@NET6_VERSION@=$(AndroidNet6Version)">
4444
</ReplaceFileContents>
4545

4646
<ItemGroup>

0 commit comments

Comments
 (0)