Skip to content

Pin the System.Memory package reference version in Microsoft.Extensions.DependencyModel #114173

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

Closed
wants to merge 3 commits into from

Conversation

carlossanlop
Copy link
Contributor

Needed to address the failure found in the runtime deps flow dotnet/sdk#48034

This will be done alongside the proper update in S.R.CS.Unsfae: dotnet/maintenance-packages#221

I will generate a patch for the deps flow as well.

@carlossanlop carlossanlop self-assigned this Apr 2, 2025
@Copilot Copilot AI review requested due to automatic review settings April 2, 2025 20:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj: Language not supported

@carlossanlop
Copy link
Contributor Author

I need to address the detected package downgrade error:

C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.DependencyModel\src\Microsoft.Extensions.DependencyModel.csproj : error NU1605: Warning As Error: Detected package downgrade: System.
Memory from 4.6.2 to 4.6.1. Reference the package directly from the project to select a different version.  [C:\Users\calope\source\repos\runtime\Build.proj]

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

@carlossanlop carlossanlop marked this pull request as draft April 2, 2025 22:57
@carlossanlop carlossanlop marked this pull request as ready for review April 3, 2025 16:58
@ericstj
Copy link
Member

ericstj commented Apr 3, 2025

We can consider this as an option - on the pro side it stands to help reduce the dependencies redistributed in the SDK. For this to actually eliminate those we would need every assembly in the SDK tasks to follow this. I'm not sure how tractable this is - today the set of assemblies used by SDK tasks from latest runtime are:

  • Microsoft.NET.HostModel
  • Microsoft.Extensions.DependencyModel
  • System.Text.Json
  • System.IO.Hashing
  • System.IO.Pipelines
  • System.Text.Encodings.Web
  • Microsoft.Bcl.AsyncInterfaces

So for all System.Text.Json, System.Text.Encodings.Web, and Microsoft.Bcl.AsyncInterfaces -- we could use the toolset versions in all these components. That would mean no new features - but it might be OK for SDK tasks.
HostModel and DependencyModel are design time focused assemblies - so we could make the case for those staying on toolset version packages.
System.IO.Pipelines is brought in by STJ so that can be ignored.
IO.Hashing is used by SDK tasks directly - it also depends on Memory and Unsafe - so it might still be a problem even if we fix the others.

@dsplaisted

@ericstj
Copy link
Member

ericstj commented Apr 3, 2025

Source build is failing due to downgrades. Probably every toolset package version would need to be overidden like this

<SystemReflectionMetadataLoadContextToolsetVersion Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(SystemReflectionMetadataLoadContextVersion)</SystemReflectionMetadataLoadContextToolsetVersion>
<SystemTextJsonToolsetVersion Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(SystemTextJsonVersion)</SystemTextJsonToolsetVersion>

That said, I'm not sure if we can pursue this approach right now because of #114173 (comment).

We might just want to drive the new System.Memory package in.

Comment on lines +141 to +142
<!-- The framework targeted by and package release band for the minimum toolset version our tasks must support -->
<ToolsetTargetFramework>net8.0</ToolsetTargetFramework>
Copy link
Member

@ViktorHofer ViktorHofer Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@ericstj ericstj Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered if we already had it somewhere. Let's hold off on changing this PR and burning more build resources until we understand what direction we want to take. I'm not sure if this one is going to pan out.

@carlossanlop
Copy link
Contributor Author

I'll close it for the time being. My understanding is that we're not going to take this at the moment. We can always reopen if we change our minds.

@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants