-
Notifications
You must be signed in to change notification settings - Fork 1.2k
MSBuild Server dogfood (#12120) #50389
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables MSBuild server functionality for the .NET SDK build process by setting the MSBUILDUSESERVER
environment variable to 1. This change is part of dogfooding MSBuild server before making it default in certain scenarios.
- Sets
MSBUILDUSESERVER=1
environment variable in SDK build pipeline templates - Enables MSBuild server for both test template execution and main build steps
ba90c7f
to
0c07fad
Compare
81b2bd1
to
a61619f
Compare
@SimaTian additional places to add the env var to: |
I assume you'll eventually want to turn this on for arcade after flighting it with a few other repos first. |
Failures![]() TemplateEngine macOS x64This is a known failure being tracked here: #50948 (comment) TestBuild Linux x64Not sure what's going on here. Haven't seen this failure before with RunFileTests.Pack. @jjonescz Any ideas on this test failure? ![]() TestBuild macOS arm64This is a known failure being tracked here: #50784 |
@echo off | ||
title SDK Build ($RepoRoot) | ||
set DOTNET_CLI_USE_MSBUILD_SERVER=1 | ||
set MSBUILDUSESERVER=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be added to the sdk-build-env.ps1
too which is constructed below.
That might explain why only linux legs are currently failing and windows ones are not.
@echo off | ||
title SDK Build ($RepoRoot) | ||
set DOTNET_CLI_USE_MSBUILD_SERVER=1 | ||
set MSBUILDUSESERVER=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm dogfooding this while investigating the failures that happen in CI. I cannot repro them so far but I noticed something:
When I run
dotnet test ./test/dotnet.Tests/ --filter "FullyQualifiedName~RunFileTests.Pack"
I normally see all the test results in the stdout.
But when I set DOTNET_CLI_USE_MSBUILD_SERVER=1
before running that same command, it seems a separate process is used to run the tests. But the original dotnet test
process doesn't show any test outputs. Which also impacts my ability to inspect what is going on...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed this while debugging and I agree it is annoying and problematic.
I think I will have to take a look at the way sdk launches the msbuild app for tests - server adds one layer of indirection (e.g. it spawns another process) for the build. There is supposed to be some redirect, but the tests are wired separately from the rest.
public class MSBuildCommand(
IEnumerable<string> msbuildArgs,
string? msbuildPath = null
) : MSBuildForwardingApp(MSBuildArgs.AnalyzeMSBuildArguments([..msbuildArgs], CommonOptions.PropertiesOption,
vs
public class MSBuildCommand : TestCommand
so maybe these are working differently?
{ | ||
public GivenThatWeWantToPublishIncrementally(ITestOutputHelper log) : base(log) | ||
{ | ||
// During the dogfood, we want the MSBuild server on for build of the pipeline. Not for the tests - it breaks outputs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I cannot repro the failures locally, could the problem with RunFileTests.Pack
be that it relies on dotnet/msbuild#12156, i.e., the virtual in-memory project should be available for MSBuild sub-tasks, and that is not working with MSBuild server?
We would like to move forward with making MSBuild server default in some scenarios.
Before we do that, we need to dogfood the feature.
Initial testing suggests it works nicely - so far it works in our internal pipelines an on our local dev loop. We're also already dogfooding in aspnetcore for several months.
So sdk is one of the logical next steps we would like to take.