-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Run code quality analyzers in the coreclr/tools directory #74825
Conversation
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.
LGTM once the CI green
cc @dotnet/crossgen-contrib @dotnet/ilc-contrib |
src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReaderGen.cs
Show resolved
Hide resolved
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 good otherwise, thanks for cleaning it up!
} |
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.
Can you please check if this should be "ported" to linker repo as well? (Probably the setting for lint to do this for us).
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.
Opened https://github.com/dotnet/linker/issues/3018 to track enabling runtime code-quality analyzer on top of existing linker analyzers
await MergeSortCore<T, T[], ArrayAccessor<T>, TComparer, TCompareAsEqualAction>.ParallelSort(localCopyOfHalfOfArray, 0, halfLen, comparer); | ||
await rightSortTask; | ||
await MergeSortCore<T, T[], ArrayAccessor<T>, TComparer, TCompareAsEqualAction>.ParallelSort(localCopyOfHalfOfArray, 0, halfLen, comparer).ConfigureAwait(true); | ||
await rightSortTask.ConfigureAwait(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.
Why true
rather than false
?
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 familiar with what is happening in the code and although less performant and deadlock prone, using ConfigureAwait(true) does virtually the same as just awaiting for it. If you believe it should be false, I can change it
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 will merge it as is for now, let me know if you want me to create a follow-up change about this :D
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.
It's very rare to see ConfigureAwait(true)
and it's usually for a very specific reason. These should almost certainly be false.
src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs
Outdated
Show resolved
Hide resolved
src/coreclr/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs
Outdated
Show resolved
Hide resolved
src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureTranslator.cs
Outdated
Show resolved
Hide resolved
.../ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeFormatWriterGen.cs
Show resolved
Hide resolved
dotnet#74825 (review) I don't think we need to run on the same thread.
#74825 (review) I don't think we need to run on the same thread.
The `readonly` addition was one of the 3600 diffs in dotnet#74825. `MarkStrategy` can have mutable state that was getting lost because Roslyn considers it valid to put `_marker` into a temporary before calling instance methods on it. This resulted in DependencyGraphViewer hanging after seeing tens of thousands of new graphs being added.
The `readonly` addition was one of the 3600 diffs in #74825. `MarkStrategy` can have mutable state that was getting lost because Roslyn considers it valid to put `_marker` into a temporary before calling instance methods on it. This resulted in DependencyGraphViewer hanging after seeing tens of thousands of new graphs being added.
Adds the <RunAnalyzers> property set to true into the different ilc projects
Adds some custom configurations into the editorconfig of ilc