-
Notifications
You must be signed in to change notification settings - Fork 183
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
Stop merging Castle.Core #1258
Comments
An interesting question is: if ILMerge or ILRepack started to support netstandard, would FIE start merging in the Castle.Core netstandard assembly? Effectively, the IL merge means a bug in Castle.Core is a bug in FIE. If a new Castle.Core is released which fixes a bug, then that bug gets fixed in FIE by a new release which upgrades to that version. Similarly, if a new version is buggy and the bug fix is delayed, FIE can also go back to the older version in a newer release. Going back a version doesn't necessarily mean losing anything. The lack of IL merge for netstandard is effectively bringing back DLL-hell where it was originally vanquished by the use of IL merge. Originally I was strongly opposed to IL merging, but the reality of DLL-hell made me realise that it's a better thing to do. There is a case when you should obviously not IL merge, and that is when your public API is expressed using types defined in that third party package. These would typically be integration packages, sitting between two other packages. DLL-hell is something that those packages are explicitly buying into, and their maintenance and usage is necessarily under contract with that particular devil. However, in the case of a package which uses a third party package purely as an internal dependency, there is no reason for the consumer to even know that the third party package is being used. A package with no dependencies is the best behaved citizen wrt to versioning. |
I'm exhuming this old issue, because the problem is getting worse, and I really think ILMerge is holding us back and preventing us from making improvements to FakeItEasy.
It is an interesting question. Maybe we would, if they implemented all the necessary features that are currently missing, and were well-maintained, and enabled all the scenarios that are currently blocked. But the fact is that both ILMerge and ILRepack are as good as dead (actually, it looks like someone has taken over the maintenance of ILRepack and started publishing new releases, but it still doesn't support portable PDBs). As far as I know there's no alternative to these tools.
I hear your arguments, @adamralph, and they're sound. But we've started releasing non-merged assemblies for .NET Core in v3.0.0, almost 3 years ago, and we never received any report of DLL-hell problems caused by Castle.Core. Neither Moq nor NSubstitute merge Castle.Core, they just declare it as a package dependency for all TFMs. @stakx, @zvirja, have you ever received issues due to conflicting Castle.Core versions? If not, it's unlikely that we will, since we don't have nearly as many users. So, while having no dependencies is a worthy goal, I don't think it outweighs the benefits that dropping ILMerge would bring. @blairconrad thoughts? |
@thomaslevesque, I agree. While @adamralph is correct that a package with no dependencies is the best-behaved package, we are currently in a situation where we are releasing versions of FakeItEasy that do have an external dependency on Castle.Core, and it's unlikely to stop. (Unless ILMerge or an equivalent tool springs up for .NETStandard. And that point, maybe supporting tooling would be improved and we'd like to merge. We can revisit at that point.) I think your points against ILMerging are strong enough to outweigh potential downsides. I am for the change. Perhaps in a major release? I doubt it will break anyone, but there's the potential and it's worth drawing attention to the change. |
Yes, such reports pop up from time to time. For example, we got devlooped/moq#935 just recently. (We used to get tonnes of NuGet versioning problem reports in the earlier days of .NET Core, when BUT: That kind of report doesn't just pop up for Castle.Core. We've seen similar reports caused by any and all NuGet dependencies, direct and indirect; among them, System.ValueTuple, System.Threading.Tasks.Extensions, and System.Net.Http. The .NET BCL guys sometimes get their versioning wrong, too. So these kinds of reports perhaps shouldn't stop you from referencing Castle.Core via NuGet instead of ILMerge-ing it. (At this point, I could start ranting about NuGet picking the lowest compatible version of a package instead of the highest one, provoking problems needlessly, and how the average .NET user doesn't understand NuGet & MSBuild package version resolution well enough to help themselves when version conflicts occur... but that's perhaps just how things are. And truth be told, the situation has subjectively improved a lot in the past 1 year or so.) For Moq, I am roughly doing the following to minimize version conflict issues:
Also, I usually publish a new Moq version very soon after Castle.Core publishes a new version... that seems to help, too. Despite (1), I've resisted the occasional temptation to go back to ILMerge-ing Castle.Core (which Moq also used to do years ago) because ILMerge seems like it's potentially an out-of-date tool, and slowly becoming arcane: It seems safer in the long run to just go along with the "obvious" way of doing things, i.e. NuGet references. Finally, I think things will get even better once Castle.Core targets |
Thanks for your feedback, @stakx! |
I believe that proves that merging Castle.Core into the .NET Framework assembly is rather pointless. |
Ha! I didn't think I'd convince you, @adamralph 😉 |
Upgrading from "discussion". Labelling as "breaking" just in case it'll break someone's use case, but I'd be surprised. I think we should do this in the next major release. |
Hi guys! I could speak for NSubstitute and AutoFixture projects (which are both testing tools; latter doesn't use I read also your concerns about dependency hell and could say that never saw issues about conflicting versions of dependencies. It could happen though that I just joined the project late 😅 Could also advocate the idea to extract dependency, as one or a few times we even asked our NSubstitute clients to update |
Thanks for chiming in, @zvirja. That's very helpful information, and has served to strengthen my pro-decoupling stance. |
Thanks, @thomaslevesque. It's official: we're on the road to Majorreleasetown. |
This change has been released as part of FakeItEasy 6.0.0-beta.1. |
Recently we found a bug that users could've worked around by using a newer version of Castle.Core than we bundle in the .NET Framework flavour of our package.
@thomaslevesque commented (#1257 (comment)):
I responded:
@thomaslevesque reresponded:
And now we're here!
The text was updated successfully, but these errors were encountered: