microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.83k stars 6.3k forks source link

Unknown license identifier warning printed twice #24084

Open Thomas1664 opened 2 years ago

Thomas1664 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

Environment

To Reproduce Steps to reproduce the behavior:

  1. Have a port with invalid license expresion, e.g. "BSD-new"
  2. Install that port
  3. See error

Expected behavior Only print warning once

Failure logs

<manifest>:1:1: warning: Unknown license identifier 'BSD-new'. Known values are listed at https://spdx.org/licenses/
    on expression: BSD-new
                   ^
<manifest>:1:1: warning: Unknown license identifier 'BSD-new'. Known values are listed at https://spdx.org/licenses/
    on expression: BSD-new
                   ^
JackBoosY commented 2 years ago

Confirmed.

JackBoosY commented 2 years ago

The first warning happens on read_manifest, of course, it will print the warning: https://github.com/microsoft/vcpkg-tool/blob/30d6ab6a12b2954becc29f598660c67ec9344cd4/src/vcpkg/commands.format-manifest.cpp#L235

And the second warning happens on open_for_write. When vcpkg write the formated json file, it also will print the warning message: https://github.com/microsoft/vcpkg-tool/blob/30d6ab6a12b2954becc29f598660c67ec9344cd4/src/vcpkg/commands.format-manifest.cpp#L266

cc @BillyONeal

BillyONeal commented 2 years ago

This seems unfortunate but I probably do not have time to fix it. (Contributions welcome!)

github-actions[bot] commented 7 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Thomas1664 commented 7 months ago

no stale

github-actions[bot] commented 1 month ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Thomas1664 commented 1 month ago

No stale

BillyONeal commented 1 month ago

I don't know exactly what fixed this but it looks like it WAS fixed:

PS D:\vcpkg> .\vcpkg.exe version
vcpkg package management program version 2024-07-10-d2dfc73769081bdd9b782d08d27794780b7a99b9

See LICENSE.txt for license information.
PS D:\vcpkg> type D:\vcpkg\ports\zlib\vcpkg.json
{
  "name": "zlib",
  "version": "1.3.1",
  "description": "A compression library",
  "homepage": "https://www.zlib.net/",
  "license": "BSD-new",
  "dependencies": [
    {
      "name": "vcpkg-cmake",
      "host": true
    }
  ]
}
PS D:\vcpkg> .\vcpkg.exe format-manifest D:\vcpkg\ports\zlib\vcpkg.json
D:\vcpkg\ports\zlib\vcpkg.json: warning: $.license (an SPDX license expression): warning: Unknown license identifier 'BSD-new'. Known values are listed at https://spdx.org/licenses/
  on expression: BSD-new
                 ^
Succeeded in formatting the manifest files.
PS D:\vcpkg>
BillyONeal commented 1 month ago

2. Install that port

I see, I misread this; I read @JackBoosY 's note above which was all inside format-manifest and took that as what was going on