Skip to content
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

NuGet should report lifting from runtime-band to latest servicing for .NET packages #14085

Open
richlander opened this issue Feb 5, 2025 · 7 comments
Assignees
Labels

Comments

@richlander
Copy link

We've been releasing libraries under two different models for many years. We recently documented our practices. The differences between the two models is user-observable and can (and will) affect key performance and compliance metrics that users (and we) care about. We need to provide users with diagnostic information so that they understand the impact of their actions (when they add/update a PackageRef). In many cases, it is difficult and impractical for the user to determine the impact on their own. It's logically similar in difficulty to getting a user to realize that there is a CVE in a package w/o the E2E audit experience we recently provided.

We also need to write new guidance. What should a library provider (for example, OpenTelemetry) do if they update/add a PackageRef and see this diagnostic? Let's assume they have a net8.0 library and the new PackageRef lifts them to 9.0-era libraries.

Options:

  1. Back out the change
  2. Keep that (singular) 9.0 reference since the functionality is needed (AKA, ignore the warning)
  3. Adopt the runtime-band policy
  4. Go all in and update all libraries to 9.0

At present, we don't have any guidance on this. We don't need to wait for the diagnostic to write the guidance. It's not entirely obvious what the guidance (in terms of offering a preferred option) should be. However, we know that the last option should be generally avoided since it is likely to have unintended negative consequences on users. Each lifted reference will result in apps growing in size, CVE exposure, and (as a result) additional servicing responsibility for both the library and app owners.

The primary issue with being able to define good guidance is that we need to decide what our own behavior will be, since some of our own packages lift references. I'm assuming we'll choose option 2 above. We'll see.

Related:

@eerhardt
Copy link

eerhardt commented Feb 6, 2025

Examples of packages that lift shared framework dependencies out of the LTS runtime:

@richlander
Copy link
Author

Thanks @eerhardt. That's great context. I see those as examples of option 2 above. The next step is to start to write some guidance based on our practices.

@eerhardt
Copy link

eerhardt commented Feb 6, 2025

One thing I'd like the guidance to say is that for library authors to only depend on new version of packages that have new features that you need. For example, consider a library that targets net8.0 and it needs System.Text.Json v9.0.0 because of a new feature in 9. It also references Microsoft.Extensions.Logging.Abstractions. It shouldn't lift Microsoft.Extensions.Logging.Abstractions to 9.0.0 just because it needed System.Text.Json 9.0.0. Keep using the matching "runtime-band" version for the TFM you target, if possible.

This will lesson the impact of lifting assemblies out of the shared framework, because there will be less assemblies lifted.

cc @DamianEdwards

@richlander
Copy link
Author

Yes. That's my plan. That's what I meant by option 2 above. It's a bit poorly worded. Where do you think we should put this guidance?

@eerhardt
Copy link

eerhardt commented Feb 6, 2025

Where do you think we should put this guidance?

My thinking was on

https://learn.microsoft.com/dotnet/standard/library-guidance/

@jeffkl
Copy link
Contributor

jeffkl commented Feb 10, 2025

Team Triage: We'll need a design spec for this feature.

@richlander
Copy link
Author

We discussed this more. The realization was that this boils down to reporting the set of "prune packages" (from the platform) that were not pruned.

The primary need is how we expose this information. It should not be restore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants