-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[mdoc] Extension method crash fix, removes -multiassembly #2377
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
[mdoc] Extension method crash fix, removes -multiassembly #2377
Conversation
|
@joelmartinez given that PR #2333 has been accepted (...mostly...), could we rebase this PR w/o the #2333 changes included? |
|
@jonpryor ok, I've made the two small changes, that was a really good point. I did realize though why I had that other change in there. There was a very small change that affected how the |
|
@jonpryor alrighty, this one has been rebased to include the other change, and I've verified that |
What was the crash? Was this an
...which doesn't answer where the crash lay. My concern is that you're fixing the crash in the wrong spot. For example, having two separate extension methods with the same name in different namespaces is perfectly valid: We have two different This is fine; the one that gets used is based on the Except in What should happen is that both of the If Question: Why does |
it was an mdoc update crash ... when it went to add the extension methods to the index, it would find duplicates and crash hard.
The issue is when there are literally in the same namespace (but in different assemblies).
Yes, the same type, but in a different namespace is/was certainly allowed and supported, because as you suggested, the signature would be different ... but in this case, |
Then it sounds like this is what should be fixed. This is a perfectly valid (if confusing) thing to do. Perhaps
So why not do that for everything? :-) Glib answer: because it bloats the XML. That's not a great excuse; glib response: use a more compact representation to reduce bloat. :-) Which likely dovetails nicely with your intention of redoing the
How does this differ from the years-old behavior of processing the same assembly with different version numbers, e.g. System.dll v1.0 vs. v2.0? It's still conceptually two assemblies, i.e. "multiple" assemblies: That doesn't entirely make sense anymore, as we no longer build net_2_0/etc., but we used to, and that's why there's a I'm sorry I didn't notice |
Actually, on that point, where is that man page documentation located? I'd be happy to update it as features are added changed, along with deploying new versions when appropriate to the doc sites. ok ... so I have some stuff to think about. I suppose you're right, that it would be better for an extra parameter to be avoided, and the functionality simply supported. Some notes/questions
|
|
They could have been specified on the same run; Cecil don't care. Same assembly, two different versions, Just Works™. (Or so I hope... No errors reported, anyway.)
That sounds reasonable. (At least, I can't think of any immediate problems with that...) |
|
is there still interest to merge this or should it be closed? |
|
Hi @lewurm ... yes, although this particular task has taken a temporary back seat to some other items. I am still working on it and plan on making additional changes based on the feedback in the PR thread :) |
|
Hi @jonpryor ... returning to this, finally :) So if you'll remember, originally we said the changes would be:
I've implemented In the future, the ios assemblies will eventually deprecate the "classic" APIs, and when that happens, it will be a lot easier to support this without having to add I've updated the PR description to reflect these new changes ... please let me know if you have any questions :) |
|
@jonpryor ping :) |
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.
No need to set to = false, as that's the default value.
The tests added during the initial development of the -multiassembly argument failed to test the presence of extension methods; the result was a crash that occurred when there were extension methods present in multiple assemblies. This patch addresses the issue by putting a guard clause around the code that adds the extension method to the index. Tests have been modified accordingly to verify this bug and include extension methods Additionally, the -multiassembly parameter was removed entirely. This behavior is now triggered by the presence of -apistyle, which is where support for "multiple assemblies" was meant to work anyways. To review, this is to support cross-platform development, where you have multiple -- *different* -- assemblies for each platform. These assemblies will share a certain cross-section of APIs that will be *exactly* the same in each assembly (as opposed to multiple versions of literally the same assembly). As a result, every member will now contain an individual `AssemblyInfo` tag that also contains the name of the assembly.
|
@jonpryor alright, I've converted the field to a property. You're right, that does make it a bit clearer as you can see exactly the triggering condition is when you view source. |
…y-extension-fix [mdoc] Extension method crash fix, removes -multiassembly Commit migrated from mono/mono@8c32f9c
The tests added during the initial development of the -multiassembly argument failed to test the presence of extension methods;
the result was a crash that occurred when there were extension methods present in multiple assemblies.
This patch addresses the issue by putting a guard clause around the code that adds the extension method to the index.
Tests have been modified accordingly to verify this bug and include extension methods
Additionally, the -multiassembly parameter was removed entirely. This behavior is now triggered by the presence of -apistyle, which is where support for "multiple assemblies" was meant to work anyways. To review, this is to support cross-platform development, where you have multiple -- different -- assemblies for each platform. These assemblies will share a certain cross-section of APIs that will be exactly the same in each assembly (as opposed to multiple versions of literally the same assembly).
As a result, every member (when run with
apistyle) will now contain an individualAssemblyInfotag that also contains the name of the assembly.