Skip to content

Conversation

@Youssef1313
Copy link
Member

Fixes #62610

@ghost ghost added Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee. labels Aug 8, 2022
@Youssef1313 Youssef1313 marked this pull request as ready for review August 9, 2022 11:07
@Youssef1313 Youssef1313 requested a review from a team as a code owner August 9, 2022 11:07
@RikkiGibson RikkiGibson self-assigned this Aug 9, 2022
@Youssef1313 Youssef1313 requested a review from a team as a code owner August 11, 2022 07:12
@Youssef1313 Youssef1313 requested a review from a team August 11, 2022 07:12
Comment on lines 83 to 90
<!-- TODO: Remove once we consume an SDK with the fix from https://github.com/dotnet/wpf/pull/6799 -->
<Target Name="RemoveDuplicateAnalyzers" BeforeTargets="CoreCompile">
<ItemGroup>
<FilteredAnalyzer Include="@(Analyzer->Distinct())" />
<Analyzer Remove="@(Analyzer)" />
<Analyzer Include="@(FilteredAnalyzer)" />
</ItemGroup>
</Target>
Copy link
Member Author

@Youssef1313 Youssef1313 Aug 11, 2022

Choose a reason for hiding this comment

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

@Youssef1313 Youssef1313 requested a review from a team as a code owner August 11, 2022 08:41
@Youssef1313
Copy link
Member Author

@RikkiGibson This is green now :)

Copy link
Member

@jaredpar jaredpar left a comment

Choose a reason for hiding this comment

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

Can't use a hash set cause of deteriminism issues but everything else looks good.

</ItemGroup>
</Target>

<!-- TODO: Remove once we consume an SDK with the fix from https://github.com/dotnet/wpf/pull/6799 -->
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can you match the general format for a work around comment as used in the rest of the file

Suggested change
<!-- TODO: Remove once we consume an SDK with the fix from https://github.com/dotnet/wpf/pull/6799 -->
<!-- Workaround for https://github.com/dotnet/wpf/pull/6799 -->

};

var resolvedReferences = ArrayBuilder<AnalyzerFileReference>.GetInstance();
var resolvedReferences = PooledHashSet<AnalyzerFileReference>.GetInstance();
Copy link
Member

Choose a reason for hiding this comment

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

Can't use a hash set here because it introduces non-determinism into the compilation. Think we need two collections here: the resolved list and the hash set.

@jaredpar
Copy link
Member

@RikkiGibson PTAL

@Youssef1313 Youssef1313 requested a review from jaredpar August 21, 2022 13:19
@RikkiGibson
Copy link
Member

It looks like a test baseline needs to be updated.

@Youssef1313
Copy link
Member Author

@RikkiGibson @jaredpar Anything else needed here?

@RikkiGibson
Copy link
Member

Thanks for the ping @Youssef1313.

I think we should do a few checks before merging here. Other projects could get that same issue with WPF projects that we had to work around if they start consuming this compiler. I'd like to test-insert this change to VS to verify the impact, but I won't be able to until our internal build gets fixed. I'll follow up when I have more info.

@RikkiGibson
Copy link
Member

Have created a test insertion (internal only) for this.

@JoeRobich
Copy link
Member

@RikkiGibson Test insertion is passing.

@RikkiGibson
Copy link
Member

Would like to merge as soon as we can verify dotnet/wpf#6792 (comment).

@RikkiGibson
Copy link
Member

I think we are good to go here since this should be going into RC1 at the same time as the WPF fix.

@RikkiGibson RikkiGibson merged commit ee9808b into dotnet:main Sep 1, 2022
@RikkiGibson
Copy link
Member

Thanks @Youssef1313!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report when the same analyzer is passed multiple times

5 participants