runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[release/7.0-rc2] Updating inbox source generators to Roslyn 4.4 and removing polyfill approach

Open joperezr opened this issue 3 years ago • 2 comments

Backport of https://github.com/dotnet/runtime/pull/75717 to release/7.0-rc2

/cc @CyrusNajmabadi @jkoritzinsky @stephentoub

Customer Impact

Testing

Risk

joperezr avatar Sep 20 '22 04:09 joperezr

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@joperezr please fill out the template, add servicing-consider, and send the email to Tactics.

carlossanlop avatar Sep 20 '22 16:09 carlossanlop

Tagging subscribers to this area: @dotnet/area-meta See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of https://github.com/dotnet/runtime/pull/75717 to release/7.0-rc2

/cc @CyrusNajmabadi @jkoritzinsky @stephentoub

Description

This PR is upgrading all of the 7.0 inbox source generators to use Roslyn version 4.4, which allows us to remove the polyfill approach from them and instead use the inbox Roslyn APIs for finding an attribute in a performant manner.

We originally tried applying these changes in PR https://github.com/dotnet/runtime/pull/74822 before the RC2 snap, but it caused issues when ingesting the change in the sdk repo since we didn't have a prerelease version of the SDK with the compilers that we required in order to do so. Now that RC1 has been released, this shouldn't be a problem any longer.

Customer Impact

After this change goes in, the only way to consume dotnet/runtime (without warnings or disabled analyzers) will be by using a Roslyn4.4 compiler. These source generators are on by default when targeting dotnet 7.0, so all projects automatically pass them in to the compiler. Since these source generators will now depend on Roslyn 4.4, then the consuming app will need to use the Roslyn 4.4 compilers too, which can be done via using any of the following:

  • Building using an SDK which is .NET 7 RC1 or older.
  • Building using Visual Studio 17.4 preview 2 or older.
  • Manually referencing Microsoft.NET.Compilers.Toolset package version 4.4.0-2.22423.18 or older

Risk

Low/Medium: since we need this change to be ingested upstack and released into an SDK in order to fully test End-To-End. This is also in a sense reducing risk, as it is removing from the inbox source generators the dependency to Roslyn API that was not fully tested and only source-copied. After this, we will now instead depend on the Roslyn tested bits.

Author: joperezr
Assignees: joperezr
Labels:

Servicing-consider, area-Meta, source-generator

Milestone: -

ghost avatar Sep 20 '22 17:09 ghost

JIT failures are a known issue in wasm: https://github.com/dotnet/runtime/issues/75391 Approved, signed off, ready to merge. :shipit:

carlossanlop avatar Sep 20 '22 18:09 carlossanlop