* Make constraint cache thread safe
Fixes: #17101
This changes the constraint cache to use ConcurrentDictionary. This code
is invoked in a multithreaded way in Blazor server resulting in internal
failures in dictionary.
Since this is a threading issue there's no good way to unit test it, but
I noticed we're missing tests in general for this class, so I added a
few for the caching behavior.
* PR feedback
Fixes: #16922
This change updates our analyzers that need access to the symbols to use
`IOperation` where possible. Using syntax analysis for this kind of
analyzer has worse performance. These analyzers run on generated code,
which can include EF migrations, the design of which amplifies these
effects.
On the path to this, I also added support for a few more cases that
operations make easy. Since we're doing this anyway, I want to have
confidence that we're checking everything (within reason). In some cases
the diagnostic experience changed a bit (including more of the
declaration/code) - I felt like all of these were OK changes. Given the
kinds of error message reported by the analyzers "don't use that type"
it seems like it's still a good enough experience without
micro-optimizing all of the locations.
This commit allows ASP.NET Core to be built on arm64 machines directly,
without relying on cross-compilation.
There's a few changes in here:
1. Ask msbuild to look into the BuildArchitecture
By default, our build systems assums the machine is x64. This
modifies the build configuration to check the architecture of the
currently running build machine, and set BuildArchitecture to that.
2. Fix crossgen in Microsoft.AspNetCore.App.Runtime
We run crossgen for supported architectures (including x64 and
arm64). For that, we need a jit that we can point crossgen to.
Generally, we can rely on the build scripts to find the right
`libclrjit.so`. However, arm64 has multiple `libclirjit.so`, for
different use-cases. There's one for arm64 (for running on arm64) and
there's another one for cross-compiling for arm64 on x64. We need to
figure out and use the right one explicitly rather than assuming the
right one gets picked up.
See https://github.com/dotnet/core-setup/pull/8468 for similar
changes made in core-setup.
This also needs https://github.com/aspnet/AspNetCore/pull/14790 to fully
work on arm64.
- When the request body PipeReader.ReadAsync throws, the connection-level
pipe should be advanced, so subsequent attempts to read from the
connection-level pipe don't fail unnecessarily