-
Notifications
You must be signed in to change notification settings - Fork 798
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
Medium term strategy for Target Framework Monikers #1970
Comments
Not sure how much it effects sinks as you might usually only include the ones you're actually using, but - The .NET 8 docs at https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/trimming-unsupported-targetframework document some changes in behavior when trimming apps that contain libs targetting .NET Framework or .NET Standard which suggest that it's benefficial for trimming purposes to have .NET 6.0 TFMs for the libraries even if they aren't using any .NET 6 specific functionality? |
👍 interesting; the rules do specify having a That |
Just wanted to clarify (warn?), that by adding a reference to System.Diagnostics.DiagnosticSource, which references System.Runtime.CompilerServices.Unsafe, you have effectively dropped support for .NET Core 2.x, due to the way Microsoft started adding This is an example from our CI I'm really only flagging it because this dropping of TFMs was added in a minor version bump AFAICT, so I would argue is very non-semver 🙈 If you're not aware of the issue, I wrote about it last year: https://andrewlock.net/stop-lying-about-netstandard-2-support/. The onus is firmly on MS on this one IMO, but library authors don't seem to realise the implications of adding some of these libraries.
Just to be clear, I'm not at-all saying you should support .NET Core 2.1 just that "Support" for .NET Standard 2.0 doesn't really get you much IMO. Basically Xamarin and that's it. And it's misleading in NuGet because it looks like you should be able to use it without issues on .NET Core 2.x without issue. So just consider this a heads up 😄 |
Firstly, thanks for taking the time to note this.
No, this is about trimming of specific TFMs when a major bump happens; no such trims have taken place. On the pending trim list, there's:
One minor wart is that @andrewlock Perhaps you might be aware of a good reason not to avoid dropping I guess the next question is what someone in your position should be expected to do... The driving assumption is that given 2.x, 3.x and 5.x are out of support, consumers can either a) use older versions that supported them or b) update to a supported STS/LTS. Is that viable in your case, or do you see another way to resolve the forces? |
Sorry, my comment is a bit of a side-point really, I'll move to a separate issue, I just thought it might be pertinent 😄
I mean, you can use
My case is a special one, because on the Datadog .NET tracer team I'm just testing libraries against a bunch of TFMs. Both of your options are viable and reasonable IMO. The problem IMO is that the "dropping of support for TFMs" (which already happened when you added System.Diagnostics.DiagnosticSource) should only happen in a major version bump! |
Not talking about the specific APIs that are only available in a given (newer) TFM. I'm wondering if there's a benefit to offering a TFM-specific build independent of whether one would make use of APIs from it, i.e.
Thankfully I've never had to think about that, and there's no chance of
Yes; I can appreciate that this is the effect. I'm pretty sure this impact was not something that people were conscious of. The general philosophy is that the current release (and It would seem that a possible resolution is:
Nick (who added the otel integration) will be along in due course and will likely have more complete answers in due course... |
👋 I've replied RE the breaking change in #1983 so that we can keep this ticket focused on what our TFM list for vNext will be like. I didn't note the (2) |
To my knowledge, there's absolutely no benefit to
I agree on both of those, and I think option 1 is the way to go for the sake of everyone's sanity and the longer-term health of the project 😄 |
We had some discussion in another thread that might cause us to tweak this strategy slightly; quoting @bartelink:
I'm just whipping up an initial tiny PR to set dev to 4.0; this ticket could be the next one to follow. |
Q. about TFMs in other bits of the infrastructure - I started a PR at serilog/serilog-enrichers-environment#55 a while back with the idea that we could agree on the TFMs for one of the enrichers and then change the others (part of the idea being that having them target things like .NET Standard 1.x seems a waste of time in the main lib doesn't support them any more). |
In general, the same principles apply
The above sort of factors are my reasoning for applying the KISS principle as mentioned in my review comment on core: #2016 (comment) TL;DR the simplest and most reasonable thing is for core to have netstandard2.0, net6.0 only, and only add anything else when it actually provides a significant benefit. For enrichers and other things, starting off with For test assemblies, that's entirely different, you want the min .NET FW, the latest .NET FW, and all supported LTS and STS releases to be covered. For instance, that validates that net14.0, net15.0, net16.0 all function well despite the core assembly only having e.g. netstandard2.0 and net6.0 specific builds. |
* Update TFMs for #1970 * 'Policy' wording - review feedback * Update src/Serilog/Serilog.csproj Co-authored-by: Ruben Bartelink <ruben@bartelink.com> --------- Co-authored-by: Ruben Bartelink <ruben@bartelink.com>
Atm Serilog 3.X targets
net462;net471;netstandard2.1;netstandard2.0;net5.0;net6.0;net7.0
and will continue to do so.This was arrived at organically. Going forward, the TL;DR of the policy of what to target is:
net462
,net471
andnetstandard2.0
where possible.net6.0
.netstandard2.1
andnet5.0
included).This implies that Serilog 4.X will likely target the following TFMs:
net462;net471;netstandard2.0;net6.0
.Reasoning
This issue replaces #1966 and comment threads such as serilog/serilog-sinks-console#145 (comment).
There's been requests to support
net8.0
etc, inferring based on the above broad range. If we have a clear strategy in the core package and repo, the other sinks can follow. [Longer version]Production assemblies
For production assemblies, the following rules apply for picking TFMs, the following rules should apply:
netstandard2.0
is insufficient, we target the lowest even numberednetX.0
TFM that will work. i.e. a light sink would targetnet6.0
(as opposed to targetingnet12.0
just because it's there)net10.0
is out, we removenet7.0
and/ornet9.0
targetingnetstandard2.1
andnet5.0
will be considered as non-LTS (so will be replaced withnet6.0
on next major)For this repo, that means V4 should:
netstandard2.1
,net5.0
(ideally they would have been removed in V3 but the ship has sailed)3.10
had added anet9.0
target (because it needed a new API that was not innet8.0
), V4 would remove that and replace it withnet10.0
For the Console sink, the above rules would imply:
netstandard2.0
.netstandard2.1
,netcoreapp3.1
,net5.0
net6.0
if and only if there is something that can not be achieved vianetstandard2.0
.net6.0
does not imply supportingnet7.0
ornet8.0
or any other later one.net9.0
added API that's the only way to deliver a compelling new feature and/or significant perf increase, it could be added as part of the feature PR for thatTest assemblies
net5.0
any time)net9.0
is available, we can add it to the list, but there is no SLA demanding it)The text was updated successfully, but these errors were encountered: