Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] Update dependencies from dotnet/installer #6598

Merged
merged 153 commits into from
May 5, 2022

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Jan 3, 2022

This pull request updates the following dependencies

Coherency Updates

The following updates ensure that dependencies with a CoherentParentDependency
attribute were produced in a build used as input to the parent dependency's build.
See Dependency Description Format

  • Coherency Updates:
    • Microsoft.NET.ILLink.Tasks: from 6.0.200-1.22178.2 to 7.0.100-1.22226.2 (parent: Microsoft.Dotnet.Sdk.Internal)

From https://github.com/dotnet/installer

  • Subscription: b29aadf3-b2f8-4ccf-1cac-08d9cecf52c9
  • Build: 20220427.1
  • Date Produced: April 27, 2022 8:08:59 AM UTC
  • Commit: ebd9c5c2b28b3f76878fe1f4b4b02759b1490315
  • Branch: refs/heads/main

…220102.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.21623.6 -> To Version 7.0.100-alpha.1.22052.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.21628.1 (parent: Microsoft.Dotnet.Sdk.Internal
@jonathanpeppers jonathanpeppers marked this pull request as draft January 3, 2022 15:40
@jonathanpeppers
Copy link
Member

This is our "test .NET 7" PR.

@jonathanpeppers jonathanpeppers changed the title [main] Update dependencies from dotnet/installer [main] test .NET 7 builds Jan 3, 2022
@jonathanpeppers
Copy link
Member

It appears that dotnet-install.sh hits a 404:

dotnet-install: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.100-alpha.1.22052.1/dotnet-sdk-7.0.100-alpha.1.22052.1-osx-x64.tar.gz. Returned HTTP status code: 404.
dotnet-install: Download failed: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.100-alpha.1.22052.1/dotnet-sdk-7.0.100-alpha.1.22052.1-osx-x64.tar.gz
dotnet-install: The resource at https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.100-alpha.1.22052.1/dotnet-sdk-7.0.100-alpha.1.22052.1-osx-x64.tar.gz is not available.

…220104.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.21623.6 -> To Version 7.0.100-alpha.1.22054.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22053.1 (parent: Microsoft.Dotnet.Sdk.Internal
@dotnet-maestro dotnet-maestro bot changed the title [main] test .NET 7 builds [main] Update dependencies from dotnet/installer Jan 4, 2022
jonathanpeppers and others added 2 commits January 4, 2022 16:22
…220104.9

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.22053.5 -> To Version 7.0.100-alpha.1.22054.9

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22053.1 (parent: Microsoft.Dotnet.Sdk.Internal
@jonathanpeppers
Copy link
Member

This is broken until we get: dotnet/install-scripts#229

As a workaround I can change it to do:

./dotnet-install.sh --version 7.0.100-alpha.1.22054.9 --azure-feed https://dotnetbuilds.blob.core.windows.net/public

Will look into it.

jonathanpeppers and others added 17 commits January 5, 2022 15:48
Conflicts:
	eng/Version.Details.xml
	eng/Versions.props
…220105.20

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.22054.7 -> To Version 7.0.100-alpha.1.22055.20

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22055.2 (parent: Microsoft.Dotnet.Sdk.Internal
…220106.4

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.22055.18 -> To Version 7.0.100-alpha.1.22056.4

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22055.2 (parent: Microsoft.Dotnet.Sdk.Internal
Conflicts:
	eng/Version.Details.xml
	eng/Versions.props
…220107.7

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.22055.18 -> To Version 7.0.100-alpha.1.22057.7

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22057.2 (parent: Microsoft.Dotnet.Sdk.Internal
…220110.9

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.22055.18 -> To Version 7.0.100-alpha.1.22060.9

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22060.2 (parent: Microsoft.Dotnet.Sdk.Internal
Context: https://natemcmaster.com/blog/2019/01/09/netcore-primitives-3/
Context: https://github.com/dotnet/designs/blob/main/accepted/2019/runtime-binding.md#rollforward

Previously when running `dotnet` on a machine with *only* .NET 7.0 and
no .NET 6.0, you could hit:

    It was not possible to find any compatible framework version
    The framework 'Microsoft.NETCore.App', version '6.0.0' was not found.

To solve this, we need our `*.runtimeconfig.json` to allow things to
automatically roll forward to .NET 7.0 if .NET 6.0 is not found.

If we set `$(RollForward)` to `Major`:

> `Major` -- Roll forward to lowest higher major version, and lowest
> minor version, if requested major version is missing. If the
> requested major version is present, then the `Minor` policy is used.

I think this will make things work indefinitely for new .NET versions.
It should be OK to set this repo-wide.
…220112.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.22055.18 -> To Version 7.0.100-alpha.1.22062.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22061.1 (parent: Microsoft.Dotnet.Sdk.Internal
…220113.3

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.22055.18 -> To Version 7.0.100-alpha.1.22063.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22061.1 (parent: Microsoft.Dotnet.Sdk.Internal
…220114.6

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.22061.4 -> To Version 7.0.100-alpha.1.22064.6

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 7.0.100-1.22061.1 (parent: Microsoft.Dotnet.Sdk.Internal
Comment out the use of `mono_opt_aot_lazy_assembly_load` to avoid:

    java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "mono_opt_aot_lazy_assembly_load" referenced by "/data/app/~~vl16iaQCcaaGeHJth-4QRg==/com.companyname.foo-muUVAzog5TVWBfJdDzYT1Q==/lib/arm64/libmonodroid.so"
Conflicts:
	src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc
	src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc
@jonathanpeppers
Copy link
Member

jonathanpeppers commented May 5, 2022

Since the commit history here is a nightmare, here is a WIP commit message:

Bump to dotnet/installer/main@c7afae69 7.0.100-preview.4.22174.1

Changes: https://github.com/dotnet/installer/compare/04e40fa9...c7afae69
Changes: https://github.com/dotnet/runtime/compare/a21b9a2d...c5d40c9e
Changes: https://github.com/dotnet/linker/compare/01c4f590...04c49c9d

Updates to build with the .NET 7 SDK and use the runtime specified by
the SDK. We are no longer jumping ahead to consume newer dotnet/runtime
builds.

This produces a 7.0.100 Android workload.

After this is merged we should be able to enable Maestro to consume
future .NET 7 builds from dotnet/installer/main.

~~ Known Issues ~~

* AOT+LLVM crashes on startup:

https://github.com/dotnet/runtime/issues/68914

* Xamarin.Build.Download hits a breaking change with `ZipEntry`:

https://github.com/dotnet/runtime/issues/68734
https://github.com/xamarin/XamarinComponents/pull/1368

* illink outputs different MVIDs per architecture:

https://github.com/dotnet/linker/issues/2203
https://github.com/dotnet/runtime/issues/67660

* size of `libmonosgen-2.0.so` regressed:

https://github.com/dotnet/runtime/issues/68330
https://github.com/dotnet/runtime/pull/68354

* Newer .NET 7 builds crash on startup due to:

https://github.com/dotnet/runtime/pull/68701

Chose an older .NET 7 build instead.

* We can't yet push to the `dotnet7` feed. Working on this.

Co-authored-by: Jonathan Peppers <[email protected]>
Co-authored-by: Peter Collins <[email protected]>

RuntimePackNamePatterns="Microsoft.Android.Runtime.$(_AndroidRuntimePackId).**RID**"
RuntimePackRuntimeIdentifiers="android-arm;android-arm64;android-x86;android-x64"
Profile="Android"
/>
Copy link
Member

@pjcollins pjcollins May 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if this was the right thing to do for supporting net6.0 project builds, but it seems to work. Should I file something in dotnet/sdk for discussing this further?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me review this after merging... I suspect it is more complicated than just this. I think we need to somehow import the .NET 6 Microsoft.Android.Sdk pack to use our .NET 6 MSBuild tasks.

@jonpryor
Copy link
Member

jonpryor commented May 5, 2022

Context: https://github.com/dotnet/runtime/issues/56989
Context: https://github.com/dotnet/runtime/issues/68734
Context: https://github.com/dotnet/runtime/issues/68914
Context: https://github.com/dotnet/runtime/pull/68701

Changes: https://github.com/dotnet/installer/compare/04e40fa9...c7afae69

	% git diff --shortstat 04e40fa9...c7afae69
	 98 files changed, 1788 insertions(+), 1191 deletions(-)

Changes: https://github.com/dotnet/runtime/compare/a21b9a2d...c5d40c9e

	% git diff --shortstat a21b9a2d...c5d40c9e
	 28347 files changed, 1609359 insertions(+), 1066473 deletions(-)

Changes: https://github.com/dotnet/linker/compare/01c4f590...04c49c9d

	% git diff --shortstat 01c4f590...04c49c9d
	 577 files changed, 28039 insertions(+), 10835 deletions(-)

Updates to build with the .NET 7 SDK and use the runtime specified by
the SDK.  We no longer use different SDK & runtime versions.

This produces a 7.0.100 Android workload.

After this is merged we should be able to enable Maestro to consume
future .NET 7 builds from dotnet/installer/main.

~~ Known Issues ~~

AOT+LLVM crashes on startup:

  * https://github.com/dotnet/runtime/issues/68914

Xamarin.Build.Download hits a breaking change with `ZipEntry`:

  * https://github.com/dotnet/runtime/issues/68734
  * https://github.com/xamarin/XamarinComponents/pull/1368

illink outputs different MVIDs per architecture:

  * https://github.com/dotnet/linker/issues/2203
  * https://github.com/dotnet/runtime/issues/67660

Size of `libmonosgen-2.0.so` regressed:

  * https://github.com/dotnet/runtime/issues/68330
  * https://github.com/dotnet/runtime/pull/68354

Newer .NET 7 builds crash on startup:

  * https://github.com/dotnet/runtime/pull/68701
  * This is worked around by *disabling* lazy loading of AOT'd
    assemblies 6dc426f1.
  * TODO: re-enable once we get a fixed .NET 7 runtime.

TODO: We can't yet push to the `dotnet7` feed. Working on this.

Co-authored-by: Jonathan Peppers <[email protected]>
Co-authored-by: Peter Collins <[email protected]>

@jonpryor jonpryor merged commit 745214d into main May 5, 2022
@jonpryor jonpryor deleted the darc-main-0d4b4a5b-19cf-4b81-a95b-6cbd4316c663 branch May 5, 2022 21:04
jonpryor pushed a commit to dotnet/java-interop that referenced this pull request May 31, 2022
Context: dotnet/android#6598
Context: dotnet/android#7028

Update `$(TargetFrameworks)` across the various `.csproj` files to
use `$(DotNetTargetFramework)`, as xamarin/xamarin-android does.
Additionally, set `$(DotNetTargetFramework)`=net7.0 (.NET 7).

Similar to commit e7bacc3, Mono cannot be used to build against
.NET 7 reference assemblies:

	/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1232,5):
	error MSB3971: The reference assemblies for ".NETFramework,Version=v7.0" were not found.
	You might be using an older .NET SDK to target .NET 5.0 or higher.
	Update Visual Studio and/or your .NET SDK.

Fix this by updating the **Mac - Mono** CI job to *build* with .NET 7,
while Mono-focused unit tests are still run with Mono.

Note: dotnet/android#7028 will be required in order to bump
Java.Interop within xamarin-android.

Co-authored-by: Peter Collins <[email protected]>
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Sep 9, 2022
Fixes: dotnet#7302
Context: dotnet/linker#2203
Context: dotnet/runtime#67660
Context: dotnet#6598

This partially backports 745214d.

In addition to this backport to dotnet/runtime/release/6.0:

dotnet/runtime#75311

We also have another change in .NET 7 that opts into
`$(TrimmerRemoveSymbols)` by default for `Release` builds. This allows
the .NET 7 linker to have stable MVIDs for assemblies for each
architecture.

There may potentially be a dotnet/linker issue here to look into
further. However, this seems to be the best fix for getting .NET 6
projects building under .NET 7 at the moment.
jonathanpeppers added a commit that referenced this pull request Sep 9, 2022
Fixes: #7302
Context: dotnet/linker#2203
Context: dotnet/runtime#67660
Context: #6598

This partially backports 745214d.

Building a `net6.0-android` app in `Release` mode with .NET 7 can fail with many errors like:

    error XA4215: The Java type `androidx.activity.contextaware.OnContextAvailableListener` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted.

This happens because we end up with multiple assemblies, such as:

    obj/Release/net6.0-android/android-arm/linked/Xamarin.AndroidX.Activity.dll
    obj/Release/net6.0-android/android-arm64/linked/Xamarin.AndroidX.Activity.dll
    obj/Release/net6.0-android/android-x64/linked/Xamarin.AndroidX.Activity.dll
    obj/Release/net6.0-android/android-x86/linked/Xamarin.AndroidX.Activity.dll

To fix this, in addition to this backport to dotnet/runtime/release/6.0:

dotnet/runtime#75311

In .NET 7 we opt into `$(TrimmerRemoveSymbols)` by default for `Release`
builds. This allows the .NET 7 linker to have stable MVIDs for assemblies
for each architecture. Somehow when the linker outputs `.pdb` files,
it creates different MVIDs per architecture.

There may potentially be a dotnet/linker issue here to look into
further. However, this seems to be the best fix for getting .NET 6
projects building under .NET 7 at the moment.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants