[release/7.0-rc2] Updating inbox source generators to Roslyn 4.4 and removing polyfill approach
Backport of https://github.com/dotnet/runtime/pull/75717 to release/7.0-rc2
/cc @CyrusNajmabadi @jkoritzinsky @stephentoub
Customer Impact
Testing
Risk
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.
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: |
|
| Milestone: | - |
JIT failures are a known issue in wasm: https://github.com/dotnet/runtime/issues/75391 Approved, signed off, ready to merge. :shipit: