-
Notifications
You must be signed in to change notification settings - Fork 458
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
Migration to netstandard1.3 is *tough bananas* #177
Comments
Here was my earlier failed attempt at this: https://github.com/fir3pho3nixx/Windsor/commits/netstandard-1-6-port as an "adaptive change". Quite scary if you think about it. |
This was applying 'grepWin' to get rid of SILVERLIGHT in compile directives. Still scary ... |
Any idea's guys? |
I've tried to provide some pointers for each comment:
|
Ok, Using your approach I have managed to get the entire code base to compile in dotnetstandard 1.6. Entire branch is here: https://github.com/fir3pho3nixx/Windsor/tree/dotnet-standard-1-6-compatibility
This is just a discovery branch and wont be submitting any PR's from here! |
I had a quick skim read through I have no idea the status of #160, seems stalled, however a PR of that size is likely never going to get merged because so much is happening and it all falls on one person. I'd love for you to get involved in #145, liven up the discussion and get things moving. I'm not wetted to any one specific person's playtime branches, heaps of people have attempted the low hanging fruit, and glossed over the tougher areas, and then you don't hear back from them. This comment still applies:
|
Hi, I agree. Had more time to think about this. I was not clear but this was mainly #160 is a monster! I would not do it. Just close the PR explaining why. Doing it in one hit simply too much work in one go. You were clear on this, I think it might have been accidental miscommunication issue. Before we jump over to #145. Shall we distill some of our thoughts down until we get a tidy list of Some initial thoughts in no particular order
// Class that lives outside compatibility folder
public class MeDoThing {
public void ManyThingsOnDifferentPlatformsWithBuildFlags(){
#if PLATFORM_A
// ... Do This
#elif PLATFORM_B
// ... Do That
#endif
}
}
namespace Castle.Windsor.Compatibility {
public interface IThingWhatDoesStuff {
void ManyThingsOnDifferentPlatformsWithBuildFlags();
}
}
// Class that lives outside compatibility folder
public partial class MeDoThing : IThingWhatDoesStuff {
/*public void ManyThingsOnDifferentPlatformsWithBuildFlags(){
}*/
}
// Class that lives inside compatibility folder
namespace Castle.Windsor {
#if PLATFORM_A
public partial class MeDoThing : IThingWhatDoesStuff {
public void ManyThingsOnDifferentPlatformsWithBuildFlags(){
// ... Do This
}
}
#elif PLATFORM_B
public partial class MeDoThing : IThingWhatDoesStuff {
public void ManyThingsOnDifferentPlatformsWithBuildFlags(){
// ... Do That
}
}
#endif
}
|
I agree that conditional compilation is ugly, however abstracting heaps of APIs behind more custom APIs also come at a maintenance cost. I'm not yet convinced of the Just as I did with Castle Core I want to see the reduction in use of platform conditional compilation (e.g. NET40, NET35), and instead based on features available on the platform which will allow us to much more easily remove the conditional compilation as existing .NET Framework features are lit up in .NET Core. Because the .NET Core surface area is much smaller we'll still have .NET Framework builds and a .NET Core/Standard build. We have supported Mono to some degree in the past, however with the latest work on Castle Core I removed all usage of Yes please, definitely submit a pull request for GetTypeInfo early. I did two sort of big PRs in the beginning with Castle Core to reduce the amount of churn in PRs for ports, one was reflection and the other remoting/binary serialization. There are other smallish changes like replacing usages of Looking forward to seeing what you can do with the Compatibility shims/adapters, it'll be much easier to discuss smaller diffs where we are focused on making a decision for one thing. I'd close this, jump into #145, write down a brief plan, create some issues and begin. We've already got a v4.0 milestone. 🎉 |
Nah, I've listed a few PRs to start with which are obvious, further from that I'd prefer if you or others just opened an issue describing what you plan to do, or just send a PR and we can discuss it on the code. |
Ok! ;) |
What I have learned from this:
AppDomain.CurrentDomain.GetAssemblies(No AppDomain in general kills) bites hard. We need a clean way of doing this. Any learnings from Castle.Core we can apply? The only way forward I can see right now is to make a leap to netstandard1.6(https://github.com/dotnet/coreclr/issues/919).
[ Type.IsGenericType | Type.IsClass | Type.IsAbstract | Type.IsEnum | Type.IsInterface | Type.IsPrimitive | Type.ReflectedType | Type.IsGenericTypeDefinition | ... ad infinitum ... ] also bites pretty hard. Alot of these in netstandard1.3 have been moved out to Type.GetTypeInfo().[Insert Name Here]. Can we abstract this behaviour in the Desktop CLR version, so we can migrate it easier?
Attribute.GetCustomAttribute is not a thing. We need a tidy way of dealing with this.
Type.IsInstanceOfType has a substitution. System.Reflection.TypeExtensions has a replacement. Not sure if it works.
Type.Assembly has a substitution. System.Reflection.TypeExtensions has a replacement. Not sure if it works.
Type.GetInterfaces has a substitution(but Type.GetInterface does not). System.Reflection.TypeExtensions has a replacement. Not sure if it works.
We need a Array.ForEach extension. This also cause drama but should be easy to do.
BindingFlags.IgnoreReturn is not a thing. We need to understand what this means.
There is heaps of stuff here! My conclusion after a couple of goes at this, is that we need a design for dealing with the abstraction of "typing" and "attribute" mechanisms across the entire Desktop CLR version to make the migration easier.
What do you guys think?
The text was updated successfully, but these errors were encountered: