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

Add runtime patches to eliminate pre-builts #12318

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Oct 12, 2021

* Don't build Microsoft.Windows.Compatibility during source-build
* Don't build test projects during source-build
* Don't restore Microsoft.DiaSymReader.Native
* Don't build source generators that target older Roslyn versions
Copy link
Member

@dagood dagood Oct 12, 2021

Choose a reason for hiding this comment

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

  • Don't build source generators that target older Roslyn versions

I don't know the context here, but to poke at it: are these source generators that ship in the framework? Would not building these prevent someone who is using source-build with a manually-lowered Roslyn version (acquired from NuGet.org) from building a repo that relies on the source generators? Or is that scenario impossible?

Copy link
Member Author

Choose a reason for hiding this comment

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

are these source generators that ship in the framework?

See dotnet/sdk#20355 for more information on what we are doing here.

In short, we are building our source-generators twice, each targeting different Roslyn versions:

  • 3.11
  • 4.0

The 4.0 targeted version ships in the framework (we are still building the 4.0 versions in source-build). And they both ship in the NuGet packages.

The reason we want to do this is so we can use new APIs introduced in 4.0, but keep our source-generators working in VS 2019 which uses the 3.x Roslyn version. The 3.x versions are slower and don't support new language features (e.g. file-scoped namespaces).

Would not building these prevent someone who is using source-build with a manually-lowered Roslyn version (acquired from NuGet.org) from building a repo that relies on the source generators? Or is that scenario impossible?

That scenario is impossible to build dotnet/runtime because we are using new language features that only came in Roslyn 4.0. It also would mean that the source generators that ship in the framework couldn't be built, since they need the new Roslyn APIs. Lastly, in order to target net6.0, you need to use the new Roslyn version.

Copy link
Member

Choose a reason for hiding this comment

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

That scenario is impossible to build dotnet/runtime

Maybe I'm not parsing this right, but I'm not talking about building dotnet/runtime with a lowered Roslyn version, I mean any user's project. dotnet new console + net6.0 + lowered Roslyn. Just exploring areas where it sounds like this change could cause a functional gap for source-built SDK users anywhere.

The 4.0 targeted version ships in the framework (we are still building the 4.0 versions in source-build). And they both ship in the NuGet packages.

Because we only ship the source-built framework, not nuget packages, to source-build SDK users, sounds like that means there's no way that SDK users can even tell we didn't build the 3.11 version. I think that means this is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

I mean any user's project. dotnet new console + net6.0 + lowered Roslyn

That is what my last sentence meant:

Lastly, in order to target net6.0, you need to use the new Roslyn version.

You can't build a dotnet new console template with an older version of Roslyn because the template uses new language features that older Roslyn versions don't support (like global usings).

@eerhardt eerhardt merged commit fa15731 into dotnet:release/6.0.1xx Oct 13, 2021
@eerhardt eerhardt deleted the RuntimePreBuiltElimination branch October 13, 2021 16:15
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.

4 participants