Skip to content

Avoid package dependencies on inbox libraries #8669

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

Merged

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Apr 15, 2023

  • System.Security.Principal.Windows is inbox since net6.0
  • System.Net.Http is inbox since netcoreapp2.0
  • System.Reflection.Metadata is inbox since netcoreapp2.0
  • System.Threading.Tasks.Dataflow is inbox since netcoreapp2.0
  • Remove System.Net.Http package references which aren't needed as they underlying assembly is inbox on both .NETFramework and .NETCoreApp.

By avoiding the dependencies, we minimize the dependency graph and with that the attack surface.

cc @MichaelSimons (removes netstandard1.x dependencies)

@ViktorHofer ViktorHofer self-assigned this Apr 15, 2023
- System.Security.Principal.Windows is inbox since net6.0
- System.Net.Http is inbox since netcoreapp2.0
- System.Resources.Extensions is inbox since netcoreapp2.0
- System.Reflection.Metadata is inbox since netcoreapp2.0
- System.Threading.Tasks.Dataflow is inbox since netcoreapp2.0

By avoiding the dependencies, we minimize the dependency graph and with
that the attack surface.
@ViktorHofer ViktorHofer force-pushed the MSBuildDontReferenceInboxLibsOnNetCoreApp branch from 78c302d to 515fd70 Compare April 15, 2023 09:13
Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Thanks!

@ViktorHofer
Copy link
Member Author

I don't have permissions to hit the merge button.

@rainersigwald
Copy link
Member

@dotnet/kitten will merge when appropriate.

@ViktorHofer
Copy link
Member Author

Just curious as I haven't stumbled upon such a policy in our stack yet. Does that mean that only dotnet/kitten (which I assume is a rotational assignment) is allowed to merge PRs into dotnet/msbuild?

@rainersigwald
Copy link
Member

Yes, that's the general policy--the idea is to minimize the likelihood of causing regressions in Visual Studio, since we can't run their test suite inline with ours in PRs.

@rainersigwald rainersigwald added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Apr 17, 2023
@JaynieBai JaynieBai merged commit 8326396 into dotnet:main Apr 19, 2023
@ViktorHofer ViktorHofer deleted the MSBuildDontReferenceInboxLibsOnNetCoreApp branch April 19, 2023 07:35
rainersigwald added a commit that referenced this pull request Apr 19, 2023
rainersigwald added a commit that referenced this pull request Apr 19, 2023
This reverts commit 8326396 because it causes component governance alerts.
@rainersigwald
Copy link
Member

I tried to bring this back but leave <PackageVersion Include="System.Net.Http" Version="$(SystemNetHttpVersion)" /> so NuGet transitive pinning would pull only that version, but it doesn't appear to have worked--my packages folder after restore has both 4.3.0.

@jeffkl do you know of anything that might have caused that? I tried to repro on a trivial new project referencing Shouldly 3.0.0 (which I think is the source of the problem for us) but it seemed fine there, so something more subtle might be going on in the MSBuild repo.

rainersigwald added a commit to rainersigwald/msbuild that referenced this pull request Apr 28, 2023
System.Security.Principal.Windows is inbox since net6.0
System.Net.Http is inbox since netcoreapp2.0
System.Reflection.Metadata is inbox since netcoreapp2.0
System.Threading.Tasks.Dataflow is inbox since netcoreapp2.0
Leave System.Net.Http package references which aren't needed as they underlying assembly is inbox on both .NETFramework and .NETCoreApp, to avoid component governance alerts about downloading (but not using) an old version.

By avoiding the dependencies, we minimize the dependency graph and with that the attack surface.

cc @MichaelSimons (removes netstandard1.x dependencies)
@ViktorHofer
Copy link
Member Author

I was going to open an issue for upgrading Shouldly/3.0.0 to 4.2.1 in the msbuild repo. Unfortunately there are >100 errors that would need to be resolved, presumably because of API changes.

@jeffkl
Copy link
Contributor

jeffkl commented May 3, 2023

@jeffkl do you know of anything that might have caused that? I tried to repro on a trivial new project referencing Shouldly 3.0.0 (which I think is the source of the problem for us) but it seemed fine there, so something more subtle might be going on in the MSBuild repo.

Not off the top of my head, the assets file should explain it.

JaynieBai pushed a commit that referenced this pull request May 5, 2023
System.Security.Principal.Windows is inbox since net6.0
System.Net.Http is inbox since netcoreapp2.0
System.Reflection.Metadata is inbox since netcoreapp2.0
System.Threading.Tasks.Dataflow is inbox since netcoreapp2.0
Leave System.Net.Http package references which aren't needed as they underlying assembly is inbox on both .NETFramework and .NETCoreApp, to avoid component governance alerts about downloading (but not using) an old version.

By avoiding the dependencies, we minimize the dependency graph and with that the attack surface.

cc @MichaelSimons (removes netstandard1.x dependencies)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants