-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 dotnet pack for other Microsoft.extensions* projects #52084
Conversation
src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj
Outdated
Show resolved
Hide resolved
...t.Extensions.HostFactoryResolver/src/Microsoft.Extensions.HostFactoryResolver.Sources.csproj
Show resolved
Hide resolved
@Anipik please add the nuspec diff for all the packages that you are touching as part of this PR. |
do u want me to attach all the diffs ? most of them are non-interseting and similar to each other |
They don't need to inlined as a comment on GH, uploading them in a zip would suffice as well. Usually for minor packaging changes we wouldn't be interested in the nuspec diff but for such a fundamental change a diff makes sense. See it as an additional safeguard to avoid an unexpected regression. It might also help people who come back to this PR in the future to better understand the change. |
https://gist.github.com/Anipik/712f51a231dd08899dc4def131933743 here is the diff for all the extensions nuspec. |
@ViktorHofer @safern @ericstj can you review this one ? |
Thanks for the diff. Here are the things that stand out:
I recommend that we do another review of the produced diff after these points are discussed / addressed. |
That's the default behavior of Pack. I agree it's a bit annoying. I'm OK if we remove it from our packages, or leave as is to be more "normal".
CC @safern @carlossanlop. I believe we need to have some form of state that drives this. If a library has done the work to move intellisense to triple-slash then that should be used (new model). If not, then the microsoft.private.intellisense package should be used (old model). So long as we aren't changing it with this PR it is OK.
Yes we want it. It's what causes .NETCore to write breadcrumbs for servicing of OOBs. |
dotnet pack add this to the symbols nuspec file and set it to true for the symbols package. sample one. <?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Microsoft.Extensions.Caching.Abstractions</id>
<version>6.0.0-dev</version>
<authors>Microsoft</authors>
<license type="expression">MIT</license>
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
<icon>Icon.png</icon>
<projectUrl>https://dot.net/</projectUrl>
<description>Caching abstractions for in-memory cache and distributed cache.
Commonly Used Types:
Microsoft.Extensions.Caching.Distributed.IDistributedCache
Microsoft.Extensions.Caching.Memory.IMemoryCache</description>
<releaseNotes>https://go.microsoft.com/fwlink/?LinkID=799421</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<serviceable>true</serviceable>
<repository type="git" url="https://github.com/dotnet/runtime" commit="0000000000000000000000000000000000000000" />
<dependencies>
<group targetFramework=".NETFramework4.6.1">
<dependency id="Microsoft.Extensions.Primitives" version="6.0.0-dev" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="Microsoft.Extensions.Primitives" version="6.0.0-dev" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
<files>
<file src="C:\git\runtime4\artifacts\bin\Microsoft.Extensions.Caching.Abstractions\net461-Debug\Microsoft.Extensions.Caching.Abstractions.pdb" target="lib\net461\Microsoft.Extensions.Caching.Abstractions.pdb" />
<file src="C:\git\runtime4\artifacts\bin\Microsoft.Extensions.Caching.Abstractions\netstandard2.0-Debug\Microsoft.Extensions.Caching.Abstractions.pdb" target="lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.pdb" />
<file src="C:\git\runtime4\artifacts\bin\Microsoft.Extensions.Caching.Abstractions\net461-Debug\Microsoft.Extensions.Caching.Abstractions.dll" target="lib\net461\Microsoft.Extensions.Caching.Abstractions.dll" />
<file src="C:\git\runtime4\artifacts\bin\Microsoft.Extensions.Caching.Abstractions\netstandard2.0-Debug\Microsoft.Extensions.Caching.Abstractions.dll" target="lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll" />
<file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\Microsoft.Extensions.Caching.Abstractions.xml" target="lib\net461\Microsoft.Extensions.Caching.Abstractions.xml" />
<file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\Microsoft.Extensions.Caching.Abstractions.xml" target="lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.xml" />
<file src="C:\Users\anagniho\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21222.1\tools\Assets\DotNetPackageIcon.png" target="Icon.png" />
<file src="C:\git\runtime4\LICENSE.TXT" target="LICENSE.TXT" />
<file src="C:\git\runtime4\THIRD-PARTY-NOTICES.TXT" target="THIRD-PARTY-NOTICES.TXT" />
</files>
</package> if we want it to set for non-symbols package we will probably have to ask the nuget team to do this. |
@Anipik can't you set
Understood. Whatever the default is, I'm ok with that. |
i checked with @safern and we are currently fine using the xml files from the nuget
pack task does this, it appends the
we are already setting that property to true |
@dotnet/nuget-team as we want to keep the serviceable attribute on our nuspecs, is there a way to do so via the PackTask? I see the |
I just tried this out in a sample app and I can't see a licenseurl being added to the nuspec. Am I missing something?
results in this nuspec:
|
I can see the license url
can you share the binlog ? |
Shared the binlog offline with Anirudh. |
This didn't repro for me. Dotnet pack on this gives me a serviceable element in the nuspec. <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Serviceable>true</Serviceable>
</PropertyGroup>
</Project> |
Talked with @nkolev92, he pointed out that this is a fallback for older clients (older than dev16) and should not affect anything if we have a license element as well |
it could probably linked to my machine because i checked the the package produced in the internal builds and it has servicable=true https://dev.azure.com/dnceng/public/_build/results?buildId=1116205&view=artifacts&pathAsName=false&type=publishedArtifacts package name = Microsoft.Extensions.Configuration.EnvironmentVariables. |
I gave it a try by pulling down your branch and building a couple packages and confirm that serviceable is in the nuspec. |
One thing that comes to mind with respect to this effort: a lot of this metadata is validated at publish time. It might be prudent to do an early dry run to catch anything that might block publishing. IIRC there is some async validation build that's supposed to catch this: we should look at it. |
@ericstj see https://github.com/dotnet/core-eng/pull/12993 which covers how validation issues will be communicated. |
@Anipik LGTM in general. Can you please add a fresh diff of the nuspecs with a recent NuGet client so that we can see that the licenseUrl element isn't present but the serviceable element is? Thanks |
Will that be active to catch an issue as soon as this is in main and before we ship preview5? If not, let's manually check the results once this is in. |
Nope, that will go live in June. I agree that we should review the produced packages from an official build post-merge. |
...ncyInjection/tests/TrimmingTests/Microsoft.Extensions.DependencyInjection.TrimmingTests.proj
Outdated
Show resolved
Hide resolved
Yes, this PR is actually making that easier for projects that no longer depend on a pkgproj. I would expect we will introduce a new property to specify |
Great to see this merged. Thanks for the great team work here! 🚀 🚀 🚀 |
@ericstj @ViktorHofer Notifications won't be live for preview5, likely, but you can monitor Validate-DotNet manually if you need to (Runtime runs: https://dev.azure.com/dnceng/internal/_build?definitionId=827&tagFilter=validation-runtime-.NET%206). We run nuget metadata validation in the NuGet Validation step in the Validation ring. See here for last night's run (it's green). |
Related to #51765