-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Polyfill the incremental generator ForAttributeWithMetadataName from roslyn (for LibraryImportGenerator). #71652
Conversation
…roslyn (for LibraryImportGenerator).
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsFollowup to #70911 Note: I'm going to add EventSourceGenerator (also in this project) in a followup to this PR.
|
...raries/System.Runtime.InteropServices/src/System/Collections/Generic/ValueListBuilder.Pop.cs
Outdated
Show resolved
Hide resolved
cc @jkoritzinsky and @AaronRobinsonMSFT PTAL. For context, @CyrusNajmabadi is helping us add a much more performant way for source generators that depend on Attributes to run, and with these PRs he is onboarding generators one-by-one. Since you are the owners of the LibraryImportGenerator, do you mind taking a look at the changes and make sure it makes sense? |
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.
Looks like we'll need to update the version of Roslyn that we test the LibraryImportGenerator against, but other than that LGTM
@jkoritzinsky why would we need to do that? (from my perspective, the point of polyfilling was to help the runtime team not have to take a dependency on a new roslyn version). Thanks! |
The incremental tests are failing as they need the change in the generator infra to support the |
If we have to do this anyways, do we want the polyfill at all? |
@jkoritzinsky any thoughts on #71652 (comment) ? @joperezr for context, Roslyn4 has an actual bug in it which can't be fixed in the polyfill layer. It's unclear to me how we intend to get that fix out to your layer such that you can consume it. |
Given that we should be able to consume the new Roslyn soon (within the month?) it might be okay to wait. But if we're causing enough perf issues to show up in VS traces, then it might be worthwhile to take the polyfill. |
I just took a quick look at things and found out something useful: Arcade's minimum SDK version is 7.0.0 Preview 5. That means that we can update our Roslyn version that we ship the generators with (the This still won't let us use the new API Cyrus is polyfilling here (as that is going to be in the next preview). I think it's definitely worthwhile to update the Roslyn version we're building these tests against to the version above, and I think it's probably worth it to polyfill the API if it will give us big performance improvements. |
@jkoritzinsky can you help with the change you want to see made here? I'm not entirely sure where i should make it. Thanks! |
…to the public version that matches the SDK that arcade's global.json is referencing (also the public version used by VS 17.3 Preview 2)
Made the change! I figured out that the version I shared is the same as the most recent published version (built from the same commit), so I used the "public" package version instead of the one I shared previously. |
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.
Other than the failing tests (which sound like they're a known issue with us waiting on a new version?), LGTM.
…st MicrosoftCodeAnalysisVersion_4_X
@jkoritzinsky NativeTypeWithConstructorAndFromNativeValueMethod_ReportsDiagnostic (not related to generators afaict) failed on CI. Running locally it passes. Do you know what the issue might be here? |
I’m not sure. I’ll take a look tomorrow. If it’s blocking, you can disable the test. We’re going to be rewriting that analyzer very soon, so the existing tests aren’t particularly useful. |
I can do that if you're sure. I am a bit concerned that this is due to the roslyn update, and that somehow may be breaking you in some way. I'd def love if someone can actually check to see what's going on so there isn't some unintentional regression. |
@jkoritzinsky can you help here? i think this is hte last day we can get this in. @joperezr as well. |
I'm heads-down on getting other work in for LibraryImportGenerator before the code-complete deadline. I don't think I'll have bandwidth to get to this today. |
@jkoritzinsky @joperezr is there someone else we can pull in? Today is the last day to get this in. So if we miss this it won't happen till the next release. |
This is an important perf fix. It's fine to go beyond tomorrow for .NET 7. (But sooner the better.) If we don't get it in tomorrow, it'll just miss P7. |
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.
The change LGTM
The test failure is due to the change in Roslyn to prefer nint
over IntPtr
when adding a method that has IntPtr
in the signature. This failure is fine as we were using the "Preview" langversion so we understand that these sorts of changes happen when we update Roslyn versions.
/azp run runtime Restarting the runtime CI since the failing tests have now been removed, so just ensuring that we have a green CI before merging. |
Azure Pipelines successfully started running 1 pipeline(s). |
The remaining JIT failure is unrelated, so I'll go ahead and merge this. |
/backport to release/7.0-preview7 |
Started backporting to release/7.0-preview7: https://github.com/dotnet/runtime/actions/runs/2666797473 |
@joperezr backporting to release/7.0-preview7 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Polyfill the incremental generator ForAttributeWithMetadataName from roslyn (for LibraryImportGenerator).
Applying: Move common code to shared location
Using index info to reconstruct a base tree...
M src/libraries/System.Text.RegularExpressions/gen/System.Text.RegularExpressions.Generator.csproj
A src/libraries/System.Text.RegularExpressions/src/System/Collections/Generic/ValueListBuilder.Pop.cs
Falling back to patching base and 3-way merge...
CONFLICT (rename/rename): Rename src/libraries/System.Text.RegularExpressions/src/System/Collections/Generic/ValueListBuilder.Pop.cs->src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ValueListBuilder.Pop.cs in HEAD. Rename src/libraries/System.Runtime.InteropServices/src/System/Collections/Generic/ValueListBuilder.Pop.cs->src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ValueListBuilder.Pop.cs in Move common code to shared location
Auto-merging src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ValueListBuilder.Pop.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Move common code to shared location
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
…roslyn (for LibraryImportGenerator). (dotnet#71652) Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Followup to #70911
Note: I'm going to add EventSourceGenerator (also in this project) in a followup to this PR.