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

Use all MSBuild binding redirects in NuGet.Frameworks AppDomain #9634

Merged
merged 4 commits into from
Jan 19, 2024

Conversation

ladipro
Copy link
Member

@ladipro ladipro commented Jan 11, 2024

Context

The secondary AppDomain hosting NuGet.Frameworks was set up with a binding redirect for Microsoft.Build but not its dependencies. Additionally, MSBuild.exe loader policy was set to MultiDomainHost, making it possible to share only Framework assemblies between AppDomains, but still loading MSBuild assemblies domain specific. These issues were resulting in NGEN rejections at run-time.

Changes Made

Made the GenerateAppDomainConfig target use all binding redirects from MSBuild.exe.config and switched to MultiDomain loader policy. Also pluralized the relevant identifiers (redirect -> redirects).

Testing

Experimental VS insertion with PerfDDRITs & Speedometer runs.

@ladipro ladipro marked this pull request as ready for review January 15, 2024 14:49
@JanKrivanek
Copy link
Member

Btw. the original change was not inserted into 17.9 - correct? (just trying to see if this will need backporting)

@ladipro
Copy link
Member Author

ladipro commented Jan 15, 2024

Btw. the original change was not inserted into 17.9 - correct? (just trying to see if this will need backporting)

Correct, the regression is only in 17.10/main.

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Looks good.
Though to me it is very advanced feature taking nontrivial efforts to understand - it definitely deserves more hints - I'd at least put the https://github.com/dotnet/msbuild/blob/main/documentation/NETFramework-NGEN.md#nugetframeworks in the comment of GenerateAppDomainConfig

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

My instinct is to go forward with this and keep an eye out for other regressions. I agree that given where we are in the 17.10 cycle we have time to react if we do notice any (that overpower the gain in JIT).

src/MSBuild/XMake.cs Show resolved Hide resolved
src/Build/Microsoft.Build.csproj Outdated Show resolved Hide resolved
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
@ladipro ladipro enabled auto-merge (squash) January 19, 2024 08:28
@ladipro ladipro merged commit 0932b43 into main Jan 19, 2024
8 checks passed
@ladipro ladipro deleted the exp/fix-binding-redirects branch January 19, 2024 08:51
rainersigwald pushed a commit that referenced this pull request Jan 22, 2024
…#9673)

Add Microsoft.BuildXL.Processes PackageReference in Bootstrap project

This an existing issue exposed (somehow) by #9634. In particular, `System.Threading.Channels.dll`, an indirect dependency, is missing from the bootstrap output.
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.

3 participants