Skip to content
  • Jonathan Peppers's avatar
    Bump to dotnet/installer/main@d5520378 8.0.200-alpha.1.22511.1 (#7451) · 5b7c5bff
    Jonathan Peppers authored
    Changes: https://github.com/dotnet/installer/compare/11f6b8f7129e34d5317f47ccbc110b2b11c05749...d552037815b75e01be05b6e8d269d54413363e7f
    Changes: https://github.com/dotnet/linker/compare/5f9bfd94d9c687207872ae03f751ea19704381c0...493ce626f3278b2d0fd883330bf11a64254981bb
    Changes: https://github.com/dotnet/runtime/compare/6d10e4c8bcd9f96ccd73748ff827561afa09af57...b8d49801fe03b96d2fead3d97a11dce1e723dd17
    
    Context: https://github.com/dotnet/runtime/issues/77273
    Context: https://github.com/dotnet/runtime/commit/e46523032d72c8b0d2b14ce4b14229a8c268a6e5
    Context: https://github.com/dotnet/runtime/issues/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 745214de
    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
    5b7c5bff