-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Pass generators to CSC during component discovery #25292
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
Conversation
This will presumably need tests etc, but I'm pretty unfamiliar with the ASP.Net repo |
@@ -231,6 +232,7 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
ResponseFiles="$(CompilerResponseFile)" | |||
RuntimeMetadataVersion="$(RuntimeMetadataVersion)" | |||
SharedCompilationId="$(SharedCompilationId)" | |||
SkipAnalyzers="true" |
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.
Note: this will only work once they are using the RC1 SDK correct? This change in our targets didn't make P8 IIRC
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'm not 100% sure, but I just grabbed the preview8 SDK bits and it seems to be there in the targets.
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.
Just verified myself and yes it made .NET P8.
Thanks @chsienki. Should we consider this for RC1 (in which case a retarget to |
@chsienki could you rebase this change (or make this change) in the Just noticed @Pilchie's comment stating the same. Retargeting this PR would bring in random changes from the master branch, so rebasing would be the way to go. |
2d845e4
to
d959084
Compare
Rebased and re-targeted onto |
Hmm, looks like 5.0 is on an earlier SDK version; we don't have access to Unfortunately that means users would see double warnings from analyzers, as they'll be emitted as part of discovery and then again during compilation. Generally VS seems to hide the duplicates when they occur at the same location, which is true for general compiler warnings as they're |
Yes, we ran into too many problems attempting to update the SDK and gave up. A nicer way to say it is that we deferred the work to early in RC2.
Would this affect anyone outside this repo❔ If it's just those changing code in VS, I suggest that's not great but is livable. CI builds run w/ warn-as-error in any case. Which reminds me: The analyzers will run in command line ( |
BTW build should be using the |
Yes, those targets are in the SDK and will affect RC1 users. |
@@ -187,6 +187,7 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
AddModules="@(AddModules)" | |||
AdditionalFiles="@(AdditionalFiles)" | |||
AllowUnsafeBlocks="$(AllowUnsafeBlocks)" | |||
Analyzers="@(Analyzer)" |
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.
@pranavkm couldn't we just remove the ANalyzers from this phase wholesale?
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.
Source generators are also considered analyzers, and they need to happen in this phase.
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.
Yep, thats the problem, and why we added the new SkipAnalyzers
argument.
Equally we're going to have this issue if a generator emits a warning too, so we might need to re-think the strategy a little bit? I wonder if we should just disable all wanings (-warn 0
) for the component discovery phase? That way any warnings would only show up in the second phase, and errors in the first phase would stop the second running anyway.
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'll give bumping up the SDK another try. If we get it updated to the latest and greatest, perhaps we get this change in as-is.
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 wonder if we should just disable all wanings (
-warn 0
) for the component discovery phase? That way any warnings would only show up in the second phase, and errors in the first phase would stop the second running anyway.
ya I think that'd be best
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.
Ok, I've disabled warnings and removed the SkipAnalyzers
param. Means that phase might be a little slower until you upgrade the SDK and can use it again, but everything should work as expected.
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.
Should we file a follow up issue to move to SkipAnalyzers
at some point in the future?
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.
Yes, I'll open an issue to track.
@chsienki are you able to merge this change or do you need help with it? |
I don't have permission to do the actual merge :) |
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.
@chsienki could you file the follow up issue?
Filled #25365 to follow up. |
Thanks @chsienki ! |
I'm having a similar issue to this and #24526 Where is the proper place to report the issue? @chsienki @jaredpar |
Hi @EdCharbeneau. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Addresses #24526