-
Notifications
You must be signed in to change notification settings - Fork 857
[Infra] Match runtime packages to runtime major version #6327
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6327 +/- ##
=======================================
Coverage 86.63% 86.64%
=======================================
Files 258 258
Lines 11910 11910
=======================================
+ Hits 10318 10319 +1
+ Misses 1592 1591 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
Directory.Packages.props
Outdated
| However, for .NET 8 we need to use the .NET 9 package as the following APIs have been used to expose user-facing functionality: | ||
| - System.Diagnostics.Activity.ctor(string, string, IEnumerable<KeyValuePair<string, object>>) | ||
| - System.Diagnostics.Activity.AddException() | ||
| - System.Diagnostics.Activity.AddLink() |
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.
Maybe this could be phrased to indicate that we need to (and can) use the latest version.
We, most likely, can use 10.0.x for all targets, like we can use 9.0.x.
For that matter, I'd use a property specific for this package's version.
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.
Depends on the resolution to this comment:
Moving forward to preserve the intention of this PR we would need to accept that new functionality would be gated to upgrading to the matching version of .NET. For example, a new feature added in .NET 10 would require your application to net10.0 to use it.
Alternatively we could take an approach where we only expose new APIs to older runtimes when the version is itself an LTS version.
The PR as-is is working on the assumption new things need newer TFMs/versions, so the MSBuild as-written is correct as it would only have an exception for net8.0 and code would need to use #if NET10_0_OR_GREATER-like constructs as appropriate for future API additions.
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.
I've also written it with #6307 in mind, where if this was merged as-is it would just add these changes:
- <RuntimePackageVersions>9.0.0</RuntimePackageVersions>
+ <RuntimePackageVersions>10.0.0</RuntimePackageVersions>
+ <RuntimePackageVersions Condition="'$(TargetFramework)' == 'net10.0'">10.0.0</RuntimePackageVersions>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.
We should be prepared, but I'd reason about TFM specific stuff when we get there.
Polyfills are always an option. 😄
Try using |
pjanotti
left a comment
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.
This will help with conflict versions of Microsoft.Extensions.* when using opentelemetry-dotnet-auto
a505b06 to
1361467
Compare
67a3cef to
46bf852
Compare
d8c6162 to
9c25441
Compare
85c7f3d to
68c01ab
Compare
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
#5973 (comment)
Changes
Refactoring to match runtime packages to the major version of a target framework.
Unfortunately we can't do this complete for
net8.0without making breaking changes as we have exposed functionality that depends on new APIs added in theSystem.Diagnostics.DiagnosticSourcepackage for9.0.0.opentelemetry-dotnet/src/OpenTelemetry.Api/Trace/TracerProvider.cs
Line 80 in 3f86f47
opentelemetry-dotnet/src/OpenTelemetry.Api/Trace/TelemetrySpan.cs
Line 375 in 3f86f47
opentelemetry-dotnet/src/OpenTelemetry.Api/Trace/ActivityExtensions.cs
Line 125 in 3f86f47
As a compromise for
net8.0,8.0.xpackages are used for all dependencies exceptSystem.Diagnostics.DiagnosticSourcewhich uses9.0.0to preserve these use cases.The downside here is that users running
net8.0will technically be out of support for that package from May 2026, but that's still the case if we do nothing.We could mitigate this by moving the special case for
net8.0to depend on the10.0.0package in November with a new release for .NET 10 (if that works) or users can self-mitigate by adding an explicit reference to the10.0.0version of that package to their own application without upgrading to .NET 10 immediately.Moving forward to preserve the intention of this PR we would need to accept that new functionality would be gated to upgrading to the matching version of .NET. For example, a new feature added in .NET 10 would require your application to
net10.0to use it.Alternatively we could take an approach where we only expose new APIs to older runtimes when the version is itself an LTS version.
In that case, a new API added in .NET 10 would be supported in all previous versions as we know the package exposing it is LTS, but a new API added in .NET 11 would only be available to
net11.0and later as that is STS.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes