Skip to content

Don't combine PackageLicenseExpression and PackageLicenseFile (only use PackageLicenseExpression for MIT licensed packages) #4816

Closed

Description

@szimmer-dap

Description

We are currently adapting a package approval workflow, where packages are approved or blocked based on certain criteria. One very important criterion is the package's license. There is a list of approved licenses (like MIT, Apache, BSD, ...) and a list of licenses that can not be used (like GPL).

Although the Microsoft.Testplatform Nuget packages are under MIT license, it's hard to auto-approve them, because they use an embedded license file instead of an SPDX tag (https://spdx.github.io/spdx-spec/v2-draft/SPDX-license-list/). As a result, the license does not show up in the package's metadata.

The reason for this might be that Directory.Build.props has both a <PackageLicenseExpression> and a <PackageLicenseFile> property (and an additional <PackageLicenseFullPath> property):

<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageLicenseFile>LICENSE_MIT.txt</PackageLicenseFile>
<PackageLicenseFullPath>$(SrcPackageFolder)licenses/LICENSE_MIT.txt</PackageLicenseFullPath>

However, nuspec supports only one or the other, but not both at the same time. It seems that the <PackageLicenseExpression> property is omitted during the build process.

Steps to reproduce

Compare the "About" page of Microsoft.TestPlatform with Microsoft.Data.SqlClient, where the latter clearly states the package's license, while Microsoft.TestPlatform does not. Another example would be Microsoft.NET.Test.Sdk

Expected behavior

I would expect the corresponding nuspec files within the Nuget packages to contain a line like <license type="expression">MIT</license> and tools to be able to display "MIT" as the license of those packages.

Actual behavior

The nuspec file contains the line <license type="file">LICENSE_MIT.txt</license> and tools (including nuget.org) are not able to determine the license from that.

Activity

  1. nohwnd commented on Jan 18, 2024

    @nohwnd
    Member

    This is probably because until recently this package was not under MIT, would you consider creating a PR to fix this?

  2. szimmer-dap commented on Jan 18, 2024

    @szimmer-dap
    Author

    Unfortunately, I don't have any experience with the Arcade SDK at all. I can't say for sure that the lines I pointed at in my post are ultimately responsible for the effect or what the effect of removing line 73 (and potentially line 74) would be. I also can't build this repository and verify the effect of any changes without getting into the Acrcade build infrastructure first, and I don't feel comfortable submitting a PR that I haven't tested myself.

    Thus, I think someone with some actual experience with this repo should create a PR for this.

  3. nohwnd commented on Jan 18, 2024

    @nohwnd
    Member

    I also can't build this repository and verify the effect of any changes without getting into the Acrcade build infrastructure first,

    You can run .\build.cmd -pack in the main folder, and you will find the packages in artifacts\packages folder. You don't need to install anything special to get into "arcade" mode.

  4. Evangelink commented on Jan 19, 2024

    @Evangelink
    Member

    Self-assigning, I will have a look next week.

  5. lahma commented on Feb 7, 2024

    @lahma
    Contributor

    Created #4890 to fix the issue.

  6. Evangelink commented on Feb 7, 2024

    @Evangelink
    Member

    Thanks Marko Lahma (@lahma)! And sorry, it's alread been 3 weeks and I didn't handle it... I have been really busy with many other requests and releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions