-
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
Enable ComWrappers API on all platforms #36582
Comments
I don't object to enabling COM on non-Windows platforms. As a slight counterpoint though the diagnostics interfaces are just plain old C++ interfaces with Add/Release mechanics. IE not requiring other COM goo like activation. For example, ClrMD solved this issue without needing COM interop enabled by using well-defined vtable layout and calling addref/release. The COMInterop part of the library defines our own CallableComWrapper which handles addref/release. To use this, we define the vtable layout for an interface, then simply use delegates to call them. It's a lot of typing to build the VTable layout, but it's fairly painless to use once they are defined. I would ask this question in the opposite direction (not specifically to you Steve but to the diagnostics team/@tommcdon): It's 2020, why is the CLR diagnostics layer still built on COM? Why don't we invest into converting the DBI/ICorDebug into a C# based NuGet package? The benefits are:
Just a few thoughts here. As I said, I don't object if folks really want/need COM turned on for other platforms. |
As far as I was concerned the new COM wrapper API was basically that + IUnknown identity semantics. We tried to leverage the ClrMD wrappers, but I am told the lack of compliant identity &
/cc @dotnet/dotnet-diag |
@leculver The ComWrappers API might imply all of COM, but that isn't accurate. The ComWrappers is designed to support the
That's not quite accurate. There is nothing "plain old" about C++ type layout. The implementation is really the I don't think anyone wants to support COM as it is on Windows, but the |
Ahh yeah, that would cause issues. Good to know! |
Speaking of |
There are also native C++ consumers of the COM API (VS is a big one, SOS is another, and then we've got 3rd party tools). If we rewrote all of mscordbi in C# either we have to implement COM-interop (CCW this time) to preserve our public native COM interfaces for existing tools OR we force all tools to rewrite against a new interface. FWIW we have made slow movements towards C# over the years and I expect we'll keep doing it, but the engineering costs to shift 20 years of investment in C++ are quite sizable. |
(@sdmaclea I apologize for derailing this issue, I'd be happy to take further replies offline or move them into a new issue.)
That proposal is interesting! Most of the COM wrappers in ClrMD are meant for internal use, they are only exposed as public for a "last resort" when you need to do something directly with ISOSDac or similar interfaces. (Usually it's just me trying to build direct repros for dac issues and not having to special compile ClrMD...) If something like that
Yep, I understand. I've worked in the DBI codebase and I've dug through VS's debugger implementation several times, so I know how big of a project it would be. =) I won't wade too deeply into design, here but you are right that we'd have to come up with a migration path for existing tools, but we've have built bigger projects before. I think my more concrete feedback here is that I find it interesting that we haven't moved forward If I could summarize my thoughts a bit differently: Steve filing this issue made me start thinking about how much value we get out of ICorDebug versus how much effort it is to maintain it and the inertia the com-based codebase generates. My feedback here is "let's dream a bit bigger here instead of just turning the crank and limping along". Moving ICorDebug or some subset of it to C# would be one way to approach that...it's not the end goal. |
I don't view the lack of progress around ICorDebug as a lack of dreaming big (admitedly I am surely biased - alternate opinions are welcome). I think it is the opposite. The diagnostics team has been continually broadening our ownership and investments so that it includes a wide set of diagnostic APIs, instrumentation, infrastructure and tools of which ICorDebug is just one small part. ICorDebug hasn't changed much because we looked at all the different options where we could deploy our limited time/efforts and decided that we had many opportunities more valuable and more urgent than ICorDebug investments. |
How much of COM would this allow other platforms to use through .NET? Consuming COM APIs? Creating them? |
@Serentty The name of the API and issue implies a bit more than what the support would actually enable. The |
Unfortunately time has run out for this work. The scope here should ideally add support in Mono as well and although CoreCLR may be a minor change the work in Mono would be substantial. Moving this to .NET 6 so we can add support in unison. |
Good morning everyone, I'd like to announce that my team and I have been engaged to work on Linux support for the ComWrappers feature. We're working towards enabling this on Linux for x86_64 as part of the dotnet 6.0.0 release or shortly thereafter. Of course, ComWrappers doesn't live in a vacuum, so we might have to work on some related features, like comInterop, but we'd like to keep it to the bare minimum if possible. Please expect us to open new tickets and issues as we run into obstacles along this path. Of course, we'd greatly appreciate any help or guidance we can receive. Thank you! |
Good to hear that @b-iotti. Could you please introduce yourself and your team please? |
Sure, just a quick introduction with the relevant bits: I'm a solution architect for a large IT consulting firm. One of our customers has a pressing need for this feature, and has commissioned us to contribute it back to the project. The team is composed of myself and several engineers with proven skills in C++, C# and other applicable technologies, and past experience with COM programming. |
Thank you @b-iotti |
@kant2002 has also expressed interest in a cross-platform solution for the |
@AaronRobinsonMSFT good to hear that. |
The spec is really around making this build and separating the
The biggest do here is |
PR #53503 is the first part of our contribution to this. We're getting familiar with the PR process and will then contribute more code. |
Our debug interfaces uses COM interfaces.
To properly support these on all platforms it would be ideal to have the underlying wrappers supported.
/cc @AaronRobinsonMSFT @jkoritzinsky
The text was updated successfully, but these errors were encountered: