Repository navigation
ApiCompat - Add CAS Stubs - #10049
ioanacrant wants to merge 3 commits into
Conversation
| @@ -0,0 +1,6 @@ | |||
| namespace System | |||
There was a problem hiding this comment.
These are types we expect to live in a lower contract but aren't there yet? If so, I think it'd be worth adding a TODO comment, ideally that includes the relevant GitHub issue number.
There was a problem hiding this comment.
+1. FWIW @Lixire is working on adding this API back as we type.
|
Thanks, @ioanacrant. Nice job getting through all of this. |
| ] | ||
| }, | ||
| { | ||
| "Name": "System.Security.Permissions", |
There was a problem hiding this comment.
There's more than CAS in this package, so this description is overly specific to the point of being misleading.
There was a problem hiding this comment.
I wrote this, happy if domain experts have better word-smiting.
There was a problem hiding this comment.
Do we have a standard way of discouraging use of a package? People really shouldn't use this for anything other than making old code compile/run given that it doesn't implement anything.
There was a problem hiding this comment.
@terrajobst Can you craft a better description for us here?
|
Ioana and I spent some time looking at the comment out members to understand what would need to be done to uncomment them. I think there's a good amount of work to do it. First off, I noticed that ZoneIdentityPermission.Union was commented out but it should be able to be added back now (Ioana, I expect this was just some fat fingering on my part when I first generated the contract). The remaining APIs are blocked because of the following types:
For SecurityElement, AsyncFlowControl and ApplicationIdentity we first need to understand how we are going to bring back these types. Are we going to add dummy implementations in .NET Core or are we going to try to expose them from mscorlib and facade over them? For ApplicationIdentity, I believe that we'll need to expose it from mscorlib (since AppDomain exposes it and we don't want to run into type identity issues) but there's a question about what it should actually do. The current implementation is related to click once (and in fact is not even present in the untrimmed System.Private.Corelib.dll in CoreCLR, as it's guarding by FEATURE_CLICKONCE which is not defined), so there needs to be work done in CoreCLR to provide an implementation (e.g we can't just edit model.xml and expose it "for free"). A quick glance at AsyncFlowControl and SecurityElement lead me to believe that we could provide dummy implementations in CoreFX. AsyncFlowControl's implementation in the CLR is conditional on FEATURE_CORECLR not being defined, so it's not straightforward to just expose that. SecurityElement is in a similar bucket. Note that for both of the types the proposed factoring we have has them in different assemblies, so we would be blocked on adding them back until we get contract updates for dev/API going. Serialization is another ball of mud that needs to be untangled. I expect that we need to expose SeralizationInfo, StreamingContext, ISerializable and friends from mscorlib for type identity reasons, but the current implementations in dotnet/coreclr are guarded by FEATURE_SERIALIZATION so we again need to decide how to bring them back. It's not a simple edit to model.xml to do so. I think we really need to consider filing follow up bugs for the types I've identified and have the work items that bring them back pay down the small amount of debt here in CAS. That work should be parallelizable. If we really want to hold this, we'll need to land a work across multiple contracts before we can uncomment these members, or decide to do throw away work here providing dummy implementations in this contract which would have to be cleaned up later. I really don't think we should be spinning our wheels on that. @stephentoub I'm interested in what you think about this. |
I expect they'd need to be provided in CoreCLR, as ExecutionContext.SuppressFlow returns an AsyncFlowControl, and we'd need the type identities to match (assuming ExecutionContext.SuppressFlow is coming back as well). That's also one where we may want/need to do something more that a dummy/nop implementation, as there is currently state that gets flown that this could suppress, e.g. AsyncLocal. cc: @ericeil, @kouvel
Yes, we're going to need to do that anyway. In #10144 I added BinaryFormatter to corefx, but it's using corefx implementations of those types, which means that it can't properly serialize types defined in mscorlib with custom serialization, as those types end up using different identities of these types. I disabled serialization for the offending types in mscorlib with dotnet/coreclr#6263, but that was just a temporary bandaid until we actually split apart FEATURE_SERIALIZATION and get this infrastructure exposed.
I'm fine with that. |
|
I agree that this has value as it is (with other feedback addressed) and Ioana should commit it and open issues for the loose ends. |
Resolves #9482
@danmosemsft @ellismg