-
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
Disable generic math due to C++/CLI incompatibilities #55540
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
CC. @danmoseley, @jeffhandley This is a draft PR so it can pass all normal CI validation and will be ready to merge before the snap tomorrow if its determined to be necessary. dotnet/wpf#4823 has some more details |
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.
😦
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.
- Thanks for getting this ready in case we need it.
- I'm actually excited to get to test our ability to turn this off. 😄
- What is the best way to verify that all traces are removed?
Have we looked for other potential places where the generic may cause problems? For example, debuggers and profilers? |
For debugging at least, I didn't encounter any issues when implementing the feature (either product or test code). I didn't attempt any profiling. I would suspect that, as with any new IL sequence (including things like |
I had already done some testing locally before the feature was ever merged. Namely just using a version of Roslyn that didn't |
Marking as auto-merge. Due to this impacting essentially any C++/CLI compilation this has to be merged so that C++/CLI is usable from .NET 6. We will be working with the C++/CLI team to get an appropriate fix in place. |
Hello @tannergooding! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
We maybe should have a test hello world C++/CLI project in dotnet/runtime tests. |
Do we currently have the infrastructure in place to build C++/CLI projects? I imagine that we'll need quite a bit of special infrastructure/msbuild logic for a vcxproj to reference the locally built System.Runtime dependencies and account for other target/props differences. |
@tannergooding, Is anything blocking execution of tests? tests are taking forever and i see some tests failed. |
Does hello world C++/CLI hit this problem? We have number of C++/CLI tests under https://github.com/dotnet/runtime/blob/main/src/tests/Interop/IJW/ . Is the problem that these tests are not getting compiled against current references? |
At the very least, it appears as though using any of the non-primitives that implement generic-math (including I'm working on getting a nightly SDK installed so I can do more analysis locally. |
The staging leg can take some time to complete. The last iteration timed out and so it was requeued and has been running for ~50m Edit Actually it hasn't properly started yet. It is 194 back in the queue. Presumably due to the CI issues that have occurred over the past few days causing a general "traffic jam" as everyone is requeuing jobs. |
@jkotas, use of any non-primitive type that implements an interface containing a The "simplest" repro for a failure is to install the latest .NET SDK nightly from dotnet/installer and then attempt to build the following in C++/CLI: using namespace System;
int main(array<System::String^>^ args)
{
return Int32::Parse(args[0]);
} Which results in the below. Ultimately it looks like the C++/CLI compiler attempts to validate every member of the type matches its expectations, even if the APIs in question are never used or consumed.
|
You can add "compiling WPF" to the test suit whenever C++ gets changed. |
@jkotas the IJW tests build as part of the native test build, so they don't build against the live ref pack. We'd have to do significant build refactoring to enable them to build against the live ref pack in CI. Local builds are easier, so we could enable it for local builds as an opt-in option since it's only needed for cross-cutting features that happen once a release. |
…debugger_custom_views * 'main' of github.com:thaystg/runtime: (125 commits) [wasm] [debugger] Support method calls (dotnet#55458) [debugger] Fix debugging after hot reloading (dotnet#55599) Inliner: Extend IL limit for profiled call-sites, allow inlining for switches. (dotnet#55478) DiagnosticSourceEventSource supports base class properties (dotnet#55613) [mono] Fix race during mono_image_storage_open (dotnet#55201) [mono] Add wrapper info for native func wrappers. (dotnet#55602) H/3 and Quic AppContext switch (dotnet#55332) Compression.ZipFile support for Unix Permissions (dotnet#55531) [mono] Fix skipping of static methods during IMT table construction. (dotnet#55610) Combine System.Private.Xml TrimmingTests projects (dotnet#55606) fix name conflict with Configuration class (dotnet#55597) Finish migrating RSAOpenSsl from RSA* to EVP_PKEY* Disable generic math (dotnet#55540) Obsolete CryptoConfig.EncodeOID (dotnet#55592) Address System.Net.Http.WinHttpHandler's nullable warnings targeting .NETCoreApp (dotnet#54995) Enable Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_ConcurrentRequestsSuccessfullyHandled (dotnet#55572) Fix Task.WhenAny failure mode when passed ICollection of zero tasks (dotnet#55580) Consume DistributedContextPropagator in DiagnosticsHandler (dotnet#55392) Add property ordering feature (dotnet#55586) Reduce subtest count in Reflection (dotnet#55537) ...
This disables generic math as its not currently supported by C++/CLI and may cause
error C2253
(with a message similar to'System::INumber::DivRem': pure specifier or abstract override specifier only allowed on virtual function
) for an imported type that implements an interface with static virtuals.This is somewhat similar to what happens for C++/CLI when encountering
Span<T>
(orref structs
in general),in
, and other "new" language or runtime features. However, since this directly impacts the "core" types (e.g.int32
,int64
,intptr
, etc) it is much more prevalent and will likely be encountered by all existing C++/CLI codebases.