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

Roslyn non-source-only build fixes #72360

Merged
merged 6 commits into from
Mar 5, 2024
Merged

Conversation

mmitche
Copy link
Member

@mmitche mmitche commented Mar 1, 2024

These changes make it possible to build roslyn in non-source-only modes in the VMR:

  • Remove some vertical build (non-source-only) exclusions that were added during the PoC phase of the VMR
  • When packing the language server nuget package, Pack only the rid that the current vertical is building.
  • Mark a couple benchmark projects as IsTestProject. Tests are excluded by default when building the VMR
  • Mark a couple of test utility projects as test utility projects. When not building tests, these projects are excluded from the build.

These changes make it possible to build roslyn in non-source-only modes in the VMR:
- Remove some vertical build (non-source-only) exclusions that were added during the PoC phase of the VMR
- When packing the language server nuget package, Pack only the rid that the current vertical is building.
- Mark a couple benchmark projects as IsTestProject. Tests are excluded by default when building the VMR
- Mark a couple of test utility projects as test utility projects. When not building tests, these projects are excluded from the build.
@mmitche mmitche requested review from a team as code owners March 1, 2024 18:15
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 1, 2024
<RuntimeIdentifiers>win-x64;win-x86;win-arm64;linux-x64;linux-arm64;linux-musl-x64;linux-musl-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<!-- List of runtime identifiers that we want to publish an executable for. -->
<!-- When building a VMR vertical, we don't need to pack everything. Just pack the passed in TargetRid. -->
<RuntimeIdentifiers Condition="'$(TargetRid)' != ''">$(TargetRid)</RuntimeIdentifiers>
Copy link
Member

Choose a reason for hiding this comment

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

Where do we document TargetRid? Think of the exercise we're going through with RoslynPortableRuntimeIdentifiers right now. We're looking at that, searching for it in the code, can't find any references and are assuming "it's probably okay to delete this item". A rationale developer could apply the exact same logic to $(TargetRid) uses.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated comments and added more docs for TargetRid (currently in PR)

@@ -10,6 +10,7 @@
<LangVersion>11</LangVersion>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<NoWarn>$(NoWarn);NETSDK1206</NoWarn>
<IsTestProject>true</IsTestProject>
Copy link
Member Author

Choose a reason for hiding this comment

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

These aren't correct. Will revert.

Copy link
Member Author

Choose a reason for hiding this comment

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

Change this to ExcludeFromDotNetBuild when not building tests (no effect outside of VMR builds) and added pointers to docs.

So, when test projects are excluded, exclude this benchmark project.
See https://github.com/dotnet/arcade/blob/main/Documentation/UnifiedBuild/Unified-Build-Controls.md for information
on controls. -->
<ExcludeFromDotNetBuild Condition="'$(DotNetBuildTests)' != 'true'">true</ExcludeFromDotNetBuild>
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if there should be some <IsBenchmarkProject> flag and the logic to exclude those from VMR would be shared somewhere like Directory.Build.props - then we would not need to copy the long comment to each benchmark project.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, Arcade has a flag for identifying performance test projects: https://github.com/dotnet/arcade/blob/87d89025bdd8827c016e4083660d31f497670e5c/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.props#L5

Problem with that is that it assumes that those projects are run with the old xunit.performance library which hopefully no one uses anymore. So Arcade would need a bit more work before performance test projects can set the <IsPerformanceTestProject>true</IsPerformanceTestProject> property.

Copy link
Member

Choose a reason for hiding this comment

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

okay, I meant more like a flag only local to the roslyn repo to share this logic instead of copy-pasting it

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I can do that.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jjonescz I looked into doing this. There's no place to insert such a flag without duplicating the arcade logic around project exclusion. This is because the common logic that processes project exclusion is imported via a .NET SDK hook prior to any roslyn common targets files (e.g. eng/Imports.BeforeArcade.targets).

@mmitche
Copy link
Member Author

mmitche commented Mar 5, 2024

@jjonescz I may need some input on the integration test failure. It doesn't seem to be related, but I want to make sure.

@jjonescz
Copy link
Member

jjonescz commented Mar 5, 2024

Yes, that's known flaky test. Should be fixed now though via #72391, so I will try rerunning it (it should run with latest main merged in automatically I think); or you can get this force-merged perhaps

@mmitche
Copy link
Member Author

mmitche commented Mar 5, 2024

Yes, that's known flaky test. Should be fixed now though via #72391, so I will try rerunning it (it should run with latest main merged in automatically I think); or you can get this force-merged perhaps

Retry doesn't re-merge.

/azp run

@mmitche mmitche merged commit cc94c18 into dotnet:main Mar 5, 2024
27 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants