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/arcade #2719

Merged
merged 12 commits into from
May 11, 2022

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Apr 4, 2022

This pull request updates the following dependencies

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

  • Subscription: 804c25ee-49d5-43ef-33a4-08d978982a86
  • Build: 20220505.2
  • Date Produced: May 5, 2022 8:12:44 PM UTC
  • Commit: ba1c3aff4be864c493031d989259ef92aaa23fc3
  • Branch: refs/heads/main

…331.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat
 From Version 7.0.0-beta.22171.2 -> To Version 7.0.0-beta.22181.2
…406.10

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat
 From Version 7.0.0-beta.22171.2 -> To Version 7.0.0-beta.22206.10
…415.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat
 From Version 7.0.0-beta.22171.2 -> To Version 7.0.0-beta.22215.2
…422.4

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat
 From Version 7.0.0-beta.22171.2 -> To Version 7.0.0-beta.22222.4
…425.6

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat
 From Version 7.0.0-beta.22171.2 -> To Version 7.0.0-beta.22225.6
@vitek-karas
Copy link
Member

/cc @sbomer @agocke

This is failing because it's trying to update the repo to use .NET 7 SDK/runtime. I must admit I don't know if we should do that yet.
For one it would require people working on this to install .NET 7 typically globally for local development.
And then it updates this to Preview.2 version, but the latest official release is Preview.3 and runtime is on Preview.4.

I don't know enough about these automated PRs - can we just overwrite the versions but keep the rest of the update (to latest Arcade)?

@agocke
Copy link
Member

agocke commented May 4, 2022

Nope, the newest arcade has a dependency on .net 7, so we’ll need to find the issue with .net 7 and fix it

@vitek-karas
Copy link
Member

It's not an "issue" - we simply need to update couple of places so that everything is 7 - not hard.
OK - if that's what is has to be - let's move to 7 then.

@lewing
Copy link
Member

lewing commented May 9, 2022

We're well over half way into .NET 7, it makes sense to self host on it at this point.

dotnet-maestro bot and others added 3 commits May 9, 2022 12:26
…505.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat
 From Version 7.0.0-beta.22171.2 -> To Version 7.0.0-beta.22255.2
Some small refactoring of the build files to avoid having to update multiple places with the new TFM.
Note that not all can be updated as they are used verbatim in the NuGet package, so can't rely on repo-only properties.

Also currently I left the source code to repeat these. Eventually we might investigate generating `.cs` files in the msbuild to "inject" the TFM and other constants from the MSBuild to the compiled code.

For the Roslyn tests, I hardcoded a new 7.0.0-preview.2 ref package reference, but this feels really weird - note that so far we've been testing against 6.0.0-preview.5 version. Ideally there would be some way to deduce the ref package version from the currently used SDK, and use that in the tests.

The formatting changes are induced by running `lint`. I assume this is because of the SDK version change as well, but I don't know for sure.
@dotnet-maestro dotnet-maestro bot requested a review from sbomer as a code owner May 9, 2022 13:55
@@ -0,0 +1,5 @@
// <auto-generated/>
Copy link
Member

Choose a reason for hiding this comment

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

I spent couple of minutes trying to figure out why this got generated here, but no luck.
The theory is: since this project has source generators enabled and redirected to a different path, it's "weird". So I tried to recreate this in a simple repro project (console app using RegEx class), but no luck, in it the source generator didn't produce any file like this.

Not worth blocking the PR on this.

Copy link
Member

Choose a reason for hiding this comment

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

To repro this you have to set:

    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    <CompilerGeneratedFilesOutputPath>generated</CompilerGeneratedFilesOutputPath>

I observed it in a simple console app using preview 2, even for apps that don't use regex. Looks like it's already fixed in preview 3 so we can just remove it when we upgrade to the next preview.

@@ -13,7 +13,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<PropertyGroup>
<UsingILLinkTasksSdk>true</UsingILLinkTasksSdk>
<ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\net6.0\ILLink.Tasks.dll</ILLinkTasksAssembly>
<ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\net7.0\ILLink.Tasks.dll</ILLinkTasksAssembly>
Copy link
Member

Choose a reason for hiding this comment

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

This can't use a property - since this file is injected into the nuget package as-is.

/// This allows tools to understand which methods are unsafe to call when compiling ahead of time.
/// </remarks>
[AttributeUsage (AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)]
public sealed class RequiresDynamicCodeAttribute : Attribute
Copy link
Member

Choose a reason for hiding this comment

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

Some tests are failing because RequiresDynamicCode doesn't allow class targets, (I tihnk because dotnet/runtime#67778 hasn't made it into this version). I think we need to keep this for now.

Copy link
Member

Choose a reason for hiding this comment

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

We can't really keep it because then there's two of them and the compiler doesn't know which one to pick.
I think we should basically bump the SDK to Preview3 in this change - ahead of Arcade. It should not cause much trouble - I just didn't get to to it yet today.
If should also resolve the RegEx problem as you mention below.

@@ -0,0 +1,5 @@
// <auto-generated/>
Copy link
Member

Choose a reason for hiding this comment

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

To repro this you have to set:

    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    <CompilerGeneratedFilesOutputPath>generated</CompilerGeneratedFilesOutputPath>

I observed it in a simple console app using preview 2, even for apps that don't use regex. Looks like it's already fixed in preview 3 so we can just remove it when we upgrade to the next preview.

@agocke
Copy link
Member

agocke commented May 10, 2022

Preview 3 doesn't have the RDC changes -- might have to wait for P4 for that.

@vitek-karas
Copy link
Member

Let's wait for P4. I verified that updating to the latest P4 build everything seems to work. I don't want to upgrade the repo to a nightly build though... and P4 should be released soon anyway.

@dotnet-maestro dotnet-maestro bot merged commit 9d7304a into main May 11, 2022
@dotnet-maestro dotnet-maestro bot deleted the darc-main-3a65fa7f-262c-4578-97fd-670249162fc8 branch May 11, 2022 15:05
@ViktorHofer
Copy link
Member

and runtime is on Preview.4.

@vitek-karas, dotnet/runtime is on the publicly released preview-3 SDK: https://github.com/dotnet/runtime/blob/2fe067d05c25310072a4cea3fb4d8549f2bf8ab3/global.json#L3

The linker dependency update in dotnet/runtime is now failing because you are moving faster here than we do in dotnet/runtime which must be avoided. Can we downgrade the SDK used in this repo to the publicly released preview-3 one?

@sbomer
Copy link
Member

sbomer commented May 12, 2022

I hope we don't actually need to downgrade the SDK - seems like we just need to pick a lower runtime version for Mono.Linker.csproj. Can we keep building it for for net6.0, or target an earlier net7.0 preview there instead @vitek-karas?

@vitek-karas
Copy link
Member

We can't really downgrade since we need a new attribute from framework which is only in P4.
#2794 makes the change which @sbomer suggested. We will build the product (linker, analyzer, ...) as net6.0 while still using net7.0 Preview4 for all our tests.
Once runtime upgrades to P4 we can retarget the product to net7.0 as well.

@ViktorHofer
Copy link
Member

Sounds good, thanks.

agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
[main] Update dependencies from dotnet/arcade


 - Update the linker repo to .NET 7

Some small refactoring of the build files to avoid having to update multiple places with the new TFM.
Note that not all can be updated as they are used verbatim in the NuGet package, so can't rely on repo-only properties.

Also currently I left the source code to repeat these. Eventually we might investigate generating `.cs` files in the msbuild to "inject" the TFM and other constants from the MSBuild to the compiled code.

For the Roslyn tests, I hardcoded a new 7.0.0-preview.2 ref package reference, but this feels really weird - note that so far we've been testing against 6.0.0-preview.5 version. Ideally there would be some way to deduce the ref package version from the currently used SDK, and use that in the tests.

The formatting changes are induced by running `lint`. I assume this is because of the SDK version change as well, but I don't know for sure.

 - Merge branch 'darc-main-3a65fa7f-262c-4578-97fd-670249162fc8' of https://github.com/dotnet/linker into darc-main-3a65fa7f-262c-4578-97fd-670249162fc8

 - Merge remote-tracking branch 'mono/main' into darc-main-3a65fa7f-262c-4578-97fd-670249162fc8

 - Update to preview 3 SDK

 - Update to .NET 7 Preview 4 which should have the necessary changes.

 - Formatting

Commit migrated from dotnet/linker@9d7304a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants