Skip to content

Make compiler detection more resilient #78402

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

Merged
merged 12 commits into from
May 7, 2025
Merged

Make compiler detection more resilient #78402

merged 12 commits into from
May 7, 2025

Conversation

jaredpar
Copy link
Member

@jaredpar jaredpar commented May 1, 2025

This changes the way our build task finds the csc to launch to longer depend on the CompilerType task argument. At the core for every deployment kind of the task there is only one possible compiler that can be loaded. Hence change our logic to better assert which deployment we are in and locate the compiler based on that.

This removes the need to add extra parameters to every <Csc> invocation which was causing issues in .NET 10 SDK

This changes the way our build task finds the csc to launch to longer
depend on the `CompilerType` task argument. At the core for every
deployment kind of the task there is only one possible compiler that can
be loaded. Hence change our logic to better assert which deployment we
are in and locate the compiler based on that.
@ghost ghost added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels May 1, 2025
@@ -12,6 +12,8 @@
using Roslyn.Test.Utilities;
using Microsoft.CodeAnalysis.BuildTasks.UnitTests.TestUtilities;
using Xunit.Abstractions;
using Microsoft.CodeAnalysis.Test.Utilities;
using System.Reflection;
Copy link
Member

Choose a reason for hiding this comment

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

Consider sorting the usings.

@jaredpar jaredpar marked this pull request as ready for review May 5, 2025 16:07
@jaredpar jaredpar requested a review from a team as a code owner May 5, 2025 16:07
@jaredpar
Copy link
Member Author

jaredpar commented May 5, 2025

@dotnet/roslyn-compiler PTAL

@jaredpar
Copy link
Member Author

jaredpar commented May 6, 2025

@333fred, @chsienki, @RikkiGibson PTAL

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

Done with review pass (iteration 8). Only some minor nits/typos

@jcouv jcouv self-assigned this May 6, 2025
Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (iteration 12)

@jaredpar jaredpar enabled auto-merge (squash) May 6, 2025 23:22
@jaredpar jaredpar merged commit f64a80d into dotnet:main May 7, 2025
23 of 24 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 7, 2025
@rmarinho
Copy link
Member

rmarinho commented May 7, 2025

is this backported to preview4 ?

@jjonescz
Copy link
Member

jjonescz commented May 7, 2025

@rmarinho no, it's not, it will be in preview5. Are you hitting some issues that need this and don't have a workaround?

@rmarinho
Copy link
Member

rmarinho commented May 7, 2025

Yeah we are hitting this in .NET MAUI and VisualStudio . @jaredpar suggest a workaround

Full

but seems it doesn t work in all cases.

@jjonescz
Copy link
Member

jjonescz commented May 7, 2025

Can you link an issue that we can investigate?

@rmarinho
Copy link
Member

rmarinho commented May 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers 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.

5 participants