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

Fix framework pack NuGet package licenseUrl #3823

Closed
dagood opened this issue Oct 30, 2019 · 18 comments
Closed

Fix framework pack NuGet package licenseUrl #3823

dagood opened this issue Oct 30, 2019 · 18 comments
Assignees
Milestone

Comments

@dagood
Copy link
Member

dagood commented Oct 30, 2019

For example these packages link to the license via a "floating" Core-Setup GitHub repo URL:
Microsoft.NETCore.App 2.1.13
Microsoft.NETCore.App.Ref 3.0.0
Microsoft.NETCore.App.Ref 3.1.0-preview1.19506.1
They link to https://github.com/dotnet/core-setup/blob/master/LICENSE.TXT based on licenseUrl in the nuspec.

This is awkward for repo consolidation (we have to create a probably confusing master tag to avoid breaking the link, rather than only having the master-archive tag). It's also very bad practice. NuGet packages should contain their license.

Mitigation: the NuGet packages do contain LICENSE.TXT, but the NuGet Gallery (and probably Visual Studio?) show licenseUrl, so the user would have to dig in their NuGet cache or extract the nupkg to find LICENSE.TXT.

Note that the managed library packages like Microsoft.DotNet.PlatformAbstractions 3.0.0 aren't affected because they are packed using different packaging tooling.

The pkgproj packaging tooling should support what we need to do here, but something in Core-Setup is not right or interferes. (dotnet/arcade#2313)

I believe we should definitely fix this for 3.1, and consider porting to 3.0.

/cc @MichaelSimons @dleeapho @leecow @ericstj

@dleeapho
Copy link

We should fix for 5.0 and make 3.1 backport decision then.,

@dagood
Copy link
Member Author

dagood commented Oct 31, 2019

@ericstj, it looks like CoreFX packages still have this issue, e.g. https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/system.io.ports/5.0.0-alpha.1.19528.6/system.io.ports.5.0.0-alpha.1.19528.6.nupkg from https://dev.azure.com/dnceng/internal/_build/results?buildId=404850:

    <licenseUrl>https://github.com/dotnet/corefx/blob/master/LICENSE.TXT</licenseUrl>

The released Microsoft.CSharp/4.7.0-preview1.19504.10 does this too.

I got the impression from the arcade PRs that this was fixed, am I looking in the wrong place? I'd like to know what the expectation is with the CoreFX packaging tools before diving deeper myself.


For what it's worth, I don't know any milestone-linked driver behind this work, any info there would be useful. I do know that there's some (very understandable!) level of desire to have our packages more self-contained for the license and package icon file.

/cc @tmat

@ericstj
Copy link
Member

ericstj commented Oct 31, 2019

dotnet/corefx@1ff8e57 removed the FWLink :(

I thought we were using the License type, at least at some point we were. I can't find any packages with it. Let's get that fixed in 3.1 if we can.

@ericstj
Copy link
Member

ericstj commented Oct 31, 2019

@ericstj
Copy link
Member

ericstj commented Oct 31, 2019

Looks like the requirement is that the LicenseUrl property is not defined.

@dagood
Copy link
Member Author

dagood commented Oct 31, 2019

I tried removing the LicenseUrl override in Core-Setup and got packages with no LicenseUrl and no other license thing in the nuspec. They did contain LICENSE.TXT (as always) but my understanding is there should also be some <license type=" in the nuspec linking it up or referencing a license by name.

@ericstj
Copy link
Member

ericstj commented Oct 31, 2019

Is $(PackageLicenseExpression) set?

@dagood
Copy link
Member Author

dagood commented Oct 31, 2019

Oh--no, I expected an Arcade default. 😄 Set to MIT, and it works:

    <license type="expression">MIT</license>
    <licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>

@tmat
Copy link
Member

tmat commented Oct 31, 2019

License URL intentionally does not have a default - each repo must make a decision what license to use. See https://github.com/dotnet/arcade/blob/master/Documentation/ArcadeSdk.md#licensetxt

@dagood
Copy link
Member Author

dagood commented Oct 31, 2019

Yeah, I think I had wires crossed from when I assumed CoreFX was working properly and didn't see it defining one. Might be nice for Arcade to produce an error when there's no license, but that might either be up to the CoreFX tooling or interfere with it, so no big deal IMO.

@tmat
Copy link
Member

tmat commented Oct 31, 2019

We do validate licenses, but it turns out only if a license expression is specified:
https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryValidation.proj#L14

That might have been temporary while not all repos had it. Feel free to follow up and make it require the expression to be specified.

@tmat
Copy link
Member

tmat commented Oct 31, 2019

We might have also relied on NuGet pack validating that packages have licenses. Not sure if it actually does.

@ericstj
Copy link
Member

ericstj commented Oct 31, 2019

CoreFX was working properly and didn't see it defining one.

We had to turn it off because of a NuGet bug on pack, but never turned it back on after working around that bug.

@msftgits msftgits transferred this issue from dotnet/core-setup Jan 30, 2020
@msftgits msftgits added this to the 5.0 milestone Jan 30, 2020
@dagood dagood removed the Triaged label Jan 30, 2020
@KalleOlaviNiemitalo
Copy link

At System.Memory 4.5.4 (the latest version) in NuGet Gallery, the License Info link is dead because of repository consolidation. Is that covered by this issue or should I file a separate one? I'm not sure because the link points to the corefx repository rather than core-setup.

@dagood
Copy link
Member Author

dagood commented May 29, 2020

@KalleOlaviNiemitalo that's a separate issue, it looks like corefx has a master branch and master tag, but it should only have a master tag. The tag points to the right commit that still has LICENSE.TXT: https://github.com/dotnet/corefx/tree/e99ec129cfd594d53f4390bf97d1d736cff6f860. I've reached out internally to try to figure out why this happened and if we can simply delete the branch to fix it. Thanks for pointing this out.

@dagood
Copy link
Member Author

dagood commented Jun 2, 2020

We fixed the old license link just now. This works as of writing: https://github.com/dotnet/corefx/blob/master/LICENSE.TXT. Thanks again for pointing it out!

(Note for future viewers: the main core-setup issue tracked by this thread is still open--we should switch away from the old URLs where we can.)

@NikolaMilosavljevic NikolaMilosavljevic modified the milestones: 5.0.0, 6.0.0 Jun 25, 2020
@MichaelSimons MichaelSimons modified the milestones: 6.0.0, 7.0.0 Aug 12, 2021
@NikolaMilosavljevic NikolaMilosavljevic self-assigned this Aug 3, 2022
@NikolaMilosavljevic
Copy link
Member

[Triage] @NikolaMilosavljevic can you check if this still repros?

@NikolaMilosavljevic
Copy link
Member

Checked the latest Microsoft.NETCore.App.Ref package. License info is correct:

<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>

Closing.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants