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

Use csproj as pack input instead of nuspec #1119

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Oct 27, 2023

Now that sourcelink is a native part of the .NET SDK, Arcade doesn't bring sourcelink packages in anymore. Now that the cyclic package dependency is avoided, these projects don't need to use nuspecs anymore.

This removes custom infrastructure and hacks, and allows better source build controls.

I diffed the produced packages and the content in the .NETCoreApp folder is identical (a deps.json file is added but that's recommended by msbuild for build tasks these days). The .NET Framework output is significantly different as it now includes all dependencies that aren't supplied by the MSBuild inside Visual Studio.

@KalleOlaviNiemitalo
Copy link

Does the team intend to keep publishing sourcelink NuGet packages for use with older SDKs?

@ViktorHofer
Copy link
Member Author

ViktorHofer commented Oct 27, 2023

Does the team intend to keep publishing sourcelink NuGet packages for use with older SDKs?

I'm not the owner of sourcelink but AFAIK yes and this PR doesn't change that. The .NET 9 source link packages will work on all the officially supported MSBuild flavours and supported runtimes.

@ViktorHofer
Copy link
Member Author

Unfortunately I can't reproduce the failures locally: Microsoft.SourceLink.Git.IntegrationTests.

ViktorHofer added a commit to dotnet/arcade that referenced this pull request Oct 31, 2023
@ViktorHofer ViktorHofer force-pushed the UsePackTaskInsteadOfNuspec branch 2 times, most recently from c575a10 to 42c31c5 Compare November 2, 2023 09:10
@ViktorHofer
Copy link
Member Author

cc @tmat

@jaredpar
Copy link
Member

jaredpar commented Nov 2, 2023

@davidwengier can you take a look at this?

Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

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

We should avoid including the TFM in the tools package path. It makes things unnecessarily complicated.

@ViktorHofer ViktorHofer force-pushed the UsePackTaskInsteadOfNuspec branch 12 times, most recently from a8489fb to 481ba16 Compare February 1, 2024 15:09
@ViktorHofer ViktorHofer requested a review from tmat February 1, 2024 15:19
@ViktorHofer
Copy link
Member Author

I finally found time to continue to work on this. @tmat, please take a look. I used the same approach that we came up with in arcade for build task projects. Btw, it would be good to switch this repository to Central Package Management with a future change.

Now that sourcelink is a native part of the .NET SDK, Arcade doesn't
bring sourcelink packages in anymore. Now that the cyclic package
dependency is avoided, these projects don't need to use nuspecs
anymore.

This removes custom infrastructure and allows better source build
controls.

I diffed the produced packages and the content in the .NETCoreApp
folder is identical (a deps.json file is added but that's
recommended by msbuild for build tasks these days). The .NET Framework
output is significantly different as it now includes all dependencies
that aren't supplied by the MSBuild inside Visual Studio.
@tmat
Copy link
Member

tmat commented Feb 2, 2024

The .NET Framework output is significantly different as it now includes all dependencies that aren't supplied by the MSBuild inside Visual Studio.

Would you mind listing the differences?

eng/BuildTask.targets Outdated Show resolved Hide resolved
@@ -0,0 +1,4 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>
<Import Project="..\build\$(MSBuildThisFileName).props"/>
Copy link
Member

Choose a reason for hiding this comment

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

Import

Why do we need buildTransitive? Seems like a project that depends on a project that has Source Link may or may not opt-into having Source Link. Either way it should work as there is no cross-project dependency on source link.

Copy link
Member Author

Choose a reason for hiding this comment

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

buildTransitive is necessary so when a package references Microsoft.Build.Tasks.Git.nupkg, the end consumer then receives the msbuild props and targets files from it transitively. That's necessary when using NuGet's Pack task as it emits a slightly different nuspec in regards to IncludeAssets as the current ones.

NuGet/Home#6091 has all the details.

@ViktorHofer
Copy link
Member Author

Would you mind listing the differences?

Sure. I will post the nuspec diffs next week.

Comment on lines -225 to +223
- The consumer of the package also needs Visual Studio 2017 Update 9 debugger.
- The consumer of the package also needs Visual Studio 2022 or newer.

Choose a reason for hiding this comment

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

IIRC, neither NuGet restore nor the Visual Studio debugger is able to read symbols from snupkg, but NuGet.org indexes the symbols from uploaded snupkg files and provides them to debuggers via the symbol server protocol. Did nupkg.org change its symbol server so that it no longer works with VS2017? If not, what's the reason of this doc change?

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.

None yet

4 participants