Skip to content

Conversation

ViktorHofer
Copy link
Member

  1. Upgrade netcoreapp3.1 to net6.0 as the former is out-of-support and not supported by MSBuild/17.3.2
  2. Remove unused package versions
  3. Upgrade System.Text.Json to the latest available version (in SBRP and nuget.org) 7.0.2.
  4. Directly reference NETStandard.Library/2.0.3 in test projects to upgrade the transitive NETStandard.Library/1.6.1 version (which comes from xunit) as 1.6.1 is vulnerable and raises CG warnings.

Contributes to #933

cc @MichaelSimons (removes netstandard1.x dependencies), @oleksandr-didyk

1. Upgrade netcoreapp3.1 to net6.0 as the former is out-of-support and
   not supported by MSBuild/17.3.2
2. Remove unused package versions
3. Upgrade System.Text.Json to the latest available version (in SBRP and
   nuget.org) 7.0.2.
4. Directly reference NETStandard.Library/2.0.3 in test projects to
   upgrade the transitive NETStandard.Library/1.6.1 version (which comes
   from xunit) as 1.6.1 is vulnerable and raises CG warnings.
<SystemReflectionMetadataVersion>1.8.1</SystemReflectionMetadataVersion>
<SystemValueTupleVersion>4.5.0</SystemValueTupleVersion>
<SystemTextJsonVersion>4.7.2</SystemTextJsonVersion>
<SystemTextJsonVersion>7.0.2</SystemTextJsonVersion>
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't sourcelink consume the latest (net8) version of System.Text.Json?

Copy link
Member Author

Choose a reason for hiding this comment

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

Potentially yes. I picked the latest available version from SBRP. Feel free to update to the "live" version in #933

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean the live version? I don't think that's possible as System.Text.Json builds in dotnet/runtime which builds after dotnet/sourcelink.

Copy link
Member Author

@ViktorHofer ViktorHofer Apr 17, 2023

Choose a reason for hiding this comment

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

cc @mmitche & @MichaelSimons to double check my assumption

Copy link
Member

Choose a reason for hiding this comment

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

It can use the "live" version but it technically would be the n-1 version from the previously source-built artifacts because of @ViktorHofer notes, sourcelink builds before runtime. In this case it feels like an SBRP version feels like the better choice.

Copy link
Member

Choose a reason for hiding this comment

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

I think SBRP is the right choice here.

Copy link
Member

Choose a reason for hiding this comment

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

It's also not going to depend on new surface area, so building against 7.0.x and deploying/running previously source built is simpler.

Copy link
Contributor

@oleksandr-didyk oleksandr-didyk Apr 17, 2023

Choose a reason for hiding this comment

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

I see, thanks for the comments!

Could you please then have this reasoning as a comment on top of the pinned version in Versions.props? Someone without knowledge of product build order might try to bump this version + it helps understand why something is pinned / requires SBRP

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you please then have this reasoning as a comment on top of the pinned version in Versions.props? Someone without knowledge of product build might try to bump this version + it helps understand why something is pinned / requires SBRP

We have a meeting on Thursday about about this exact problem and will establish guidance and share more broadly. I agree that it's currently quite confusing when to use which version and dependency flow mechanism.

@mmitche mmitche requested a review from tmat April 17, 2023 17:40
@@ -3,10 +3,15 @@
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<!-- Upgrade the NETStandard.Library transitive xunit dependency to avoid transitive 1.x NS dependencies. -->
Copy link
Member

Choose a reason for hiding this comment

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

[](http://example.com/codeflow?start=4&length=109)

Is this just a temporary workaround?

Copy link
Member Author

Choose a reason for hiding this comment

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

We discussed adding this infrastructure to the SDK as it minimizes the dependency graph. Back then we decided not add it into the SDK just for the sake of risk but this has been in runtime and other repositories for years: https://github.com/dotnet/runtime/blob/048467b13160399d493b97a90b2117f58f01ac51/eng/testing/xunit/xunit.targets#L3-L6

It minimizes the dependency graph by not bringing in the NETSTandard.Library/1.6.1 transitive dependeny. We can remove this when xunit decides to publish a new version with a netstandard2.0 or modern .NETCoreApp asset.

Copy link
Member

Choose a reason for hiding this comment

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

OK, seems like this should really be in Arcade SDK. I don't see why there would be any significant risk.

@tmat
Copy link
Member

tmat commented Apr 17, 2023

Licensing header removed?


Refers to: src/Microsoft.Build.Tasks.Git.UnitTests/Microsoft.Build.Tasks.Git.UnitTests.csproj:1 in e70957e. [](commit_id = e70957e, deletion_comment = True)

@ViktorHofer
Copy link
Member Author

Licensing header removed?

Licensing headers are only required in shipping artifacts like source code or msbuild props and targets files. Project files aren't shipping assets and hence don't need these licensing headers. @jkotas let me know that some years ago. That's why we don't have in the project files in dotnet/runtime. Most other repositories don't have them either.

@tmat tmat merged commit 87da2ff into dotnet:main Apr 17, 2023
@ViktorHofer ViktorHofer deleted the RemoveNetStandard1XDependencies branch April 17, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants