aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/.github
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/.github')
-rw-r--r--vcpkg/.github/ISSUE_TEMPLATE/00-report-package-build-failure.yml47
-rw-r--r--vcpkg/.github/ISSUE_TEMPLATE/01-request-a-new-port.yml36
-rw-r--r--vcpkg/.github/ISSUE_TEMPLATE/02-request-an-update-to-an-existing-port.yml23
-rw-r--r--vcpkg/.github/ISSUE_TEMPLATE/03-request-a-feature-or-improvement-to-a-port.yml29
-rw-r--r--vcpkg/.github/ISSUE_TEMPLATE/04-request-a-feature-or-improvement.yml29
-rw-r--r--vcpkg/.github/ISSUE_TEMPLATE/05-other-type-of-bug-report.md31
-rw-r--r--vcpkg/.github/ISSUE_TEMPLATE/config.yml5
-rw-r--r--vcpkg/.github/pull_request_template.md31
-rw-r--r--vcpkg/.github/workflows/check_issues.yml97
-rw-r--r--vcpkg/.github/workflows/check_tools_sha.yml23
-rw-r--r--vcpkg/.github/workflows/codeql.yml51
-rw-r--r--vcpkg/.github/workflows/stale.yml35
-rw-r--r--vcpkg/.github/workflows/untrustedPR.yml194
13 files changed, 631 insertions, 0 deletions
diff --git a/vcpkg/.github/ISSUE_TEMPLATE/00-report-package-build-failure.yml b/vcpkg/.github/ISSUE_TEMPLATE/00-report-package-build-failure.yml
new file mode 100644
index 0000000..5925267
--- /dev/null
+++ b/vcpkg/.github/ISSUE_TEMPLATE/00-report-package-build-failure.yml
@@ -0,0 +1,47 @@
+name: Report package build failure
+description: Let us know about build failures in ports.
+title: "[<port name>] build failure"
+labels: ["category:port-bug"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ ⚠ Please use the generated issue template instead to report a port build failure. ⚠ <br>
+ See [here](https://github.com/microsoft/vcpkg/issues/30604) how to properly report an issue with the latest vcpkg version:
+ <video width="800" controls="controls" muted="muted" src="https://user-images.githubusercontent.com/41973254/229313721-b82c2d3d-b0f9-4e31-98df-08d75831f695.mp4"></video>
+ - type: input
+ id: os
+ attributes:
+ label: Operating system
+ placeholder: "e.g. Windows/Linux etc..."
+ validations:
+ required: true
+ - type: input
+ id: compiler
+ attributes:
+ label: Compiler
+ placeholder: "GCC, Clang, MSVC, MinGW, ..."
+ validations:
+ required: false
+ - type: textarea
+ id: reproduce
+ attributes:
+ label: Steps to reproduce the behavior
+ placeholder: "`./vcpkg install xxxx`"
+ render: "Shell"
+ validations:
+ required: true
+ - type: textarea
+ id: logs
+ attributes:
+ label: Failure logs
+ description: The console output and all the logs mentioned in the output.
+ validations:
+ required: true
+ - type: textarea
+ id: context
+ attributes:
+ label: Additional context
+ description: Add any other context about the problem here, such as what you have already tried to resolve the issue.
+ validations:
+ required: false
diff --git a/vcpkg/.github/ISSUE_TEMPLATE/01-request-a-new-port.yml b/vcpkg/.github/ISSUE_TEMPLATE/01-request-a-new-port.yml
new file mode 100644
index 0000000..ff9d6f0
--- /dev/null
+++ b/vcpkg/.github/ISSUE_TEMPLATE/01-request-a-new-port.yml
@@ -0,0 +1,36 @@
+name: Request a new port
+description: Request a new port/library that vcpkg should support.
+title: "[New Port Request] <library name here>"
+labels: ["category:new-port", "info:good-first-issue"]
+
+body:
+ - type: input
+ id: name
+ attributes:
+ label: Library name
+ validations:
+ required: true
+ - type: input
+ id: description
+ attributes:
+ label: Library description
+ validations:
+ required: false
+ - type: input
+ id: url
+ attributes:
+ label: Source repository URL
+ validations:
+ required: true
+ - type: input
+ id: homepage
+ attributes:
+ label: Project homepage (if different from the source repository)
+ validations:
+ required: false
+ - type: textarea
+ id: additional-info
+ attributes:
+ label: Anything else that is useful to know when adding (such as optional features the library may have that should be included)
+ validations:
+ required: false
diff --git a/vcpkg/.github/ISSUE_TEMPLATE/02-request-an-update-to-an-existing-port.yml b/vcpkg/.github/ISSUE_TEMPLATE/02-request-an-update-to-an-existing-port.yml
new file mode 100644
index 0000000..06ef6ee
--- /dev/null
+++ b/vcpkg/.github/ISSUE_TEMPLATE/02-request-an-update-to-an-existing-port.yml
@@ -0,0 +1,23 @@
+name: Request an update to an existing port
+description: Let us know about a new version of a library we should pick up.
+title: "[<port name>] update to <version>"
+labels: ['category:port-update']
+body:
+ - type: input
+ id: name
+ attributes:
+ label: Library name
+ validations:
+ required: true
+ - type: input
+ id: version
+ attributes:
+ label: New version number
+ validations:
+ required: true
+ - type: textarea
+ id: information
+ attributes:
+ label: Other information that may be useful (release notes, etc...)
+ validations:
+ required: false
diff --git a/vcpkg/.github/ISSUE_TEMPLATE/03-request-a-feature-or-improvement-to-a-port.yml b/vcpkg/.github/ISSUE_TEMPLATE/03-request-a-feature-or-improvement-to-a-port.yml
new file mode 100644
index 0000000..231c34a
--- /dev/null
+++ b/vcpkg/.github/ISSUE_TEMPLATE/03-request-a-feature-or-improvement-to-a-port.yml
@@ -0,0 +1,29 @@
+name: Request a feature or improvement to a port
+description: Suggest an improvement to one the the ports/libraries in vcpkg.
+title: "[<portname>] <short description of feature>"
+labels: ["category:port-feature"]
+body:
+ - type: textarea
+ attributes:
+ label: Is your feature request related to a problem? Please describe.
+ placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Proposed solution
+ placeholder: A clear and concise description of what you want to happen.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Describe alternatives you've considered
+ placeholder: A clear and concise description of any alternative solutions or features you've considered if applicable.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Additional context
+ placeholder: Add any other context or screenshots about the feature request here.
+ validations:
+ required: false
diff --git a/vcpkg/.github/ISSUE_TEMPLATE/04-request-a-feature-or-improvement.yml b/vcpkg/.github/ISSUE_TEMPLATE/04-request-a-feature-or-improvement.yml
new file mode 100644
index 0000000..c27fbc5
--- /dev/null
+++ b/vcpkg/.github/ISSUE_TEMPLATE/04-request-a-feature-or-improvement.yml
@@ -0,0 +1,29 @@
+name: Request a feature or improvement
+description: Suggest an improvement to vcpkg.
+title: ''
+labels: ["category:vcpkg-feature"]
+body:
+ - type: textarea
+ attributes:
+ label: Is your feature request related to a problem? Please describe.
+ placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Proposed solution
+ placeholder: A clear and concise description of what you want to happen.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Describe alternatives you've considered
+ placeholder: A clear and concise description of any alternative solutions or features you've considered.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Additional context
+ placeholder: Add any other context or screenshots about the feature request here.
+ validations:
+ required: false
diff --git a/vcpkg/.github/ISSUE_TEMPLATE/05-other-type-of-bug-report.md b/vcpkg/.github/ISSUE_TEMPLATE/05-other-type-of-bug-report.md
new file mode 100644
index 0000000..1774b23
--- /dev/null
+++ b/vcpkg/.github/ISSUE_TEMPLATE/05-other-type-of-bug-report.md
@@ -0,0 +1,31 @@
+---
+name: Other type of bug report
+about: Let us know about an issues that does not fit into any of the other issues.
+ types
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**Environment**
+- OS: [e.g. Windows/Linux etc...]
+- Compiler: revision
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. ./vcpkg install xxxx
+2. See error
+Repro code when
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Failure logs**
+-(please attached failure logs)
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/vcpkg/.github/ISSUE_TEMPLATE/config.yml b/vcpkg/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..9ca38f8
--- /dev/null
+++ b/vcpkg/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: true
+contact_links:
+ - name: I have a question
+ url: https://github.com/microsoft/vcpkg/discussions
+ about: Please ask and answer questions here.
diff --git a/vcpkg/.github/pull_request_template.md b/vcpkg/.github/pull_request_template.md
new file mode 100644
index 0000000..618be2c
--- /dev/null
+++ b/vcpkg/.github/pull_request_template.md
@@ -0,0 +1,31 @@
+<!-- If your PR fixes issues, please note that here by adding "Fixes #NNNNNN." for each fixed issue on separate lines. -->
+
+<!-- If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/. -->
+
+<!-- If this PR updates an existing port, please uncomment and fill out this checklist:
+
+- [ ] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
+- [ ] SHA512s are updated for each updated download.
+- [ ] The "supports" clause reflects platforms that may be fixed by this new version.
+- [ ] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.
+- [ ] Any patches that are no longer applied are deleted from the port's directory.
+- [ ] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result.
+- [ ] Only one version is added to each modified port's versions file.
+
+END OF PORT UPDATE CHECKLIST (delete this line) -->
+
+<!-- If this PR adds a new port, please uncomment and fill out this checklist:
+
+- [ ] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
+- [ ] The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
+- [ ] Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all `find_package` calls are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or disabled with [CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html).
+- [ ] The versioning scheme in `vcpkg.json` matches what upstream says.
+- [ ] The license declaration in `vcpkg.json` matches what upstream says.
+- [ ] The installed as the "copyright" file matches what upstream says.
+- [ ] The source code of the component installed comes from an authoritative source.
+- [ ] The generated "usage text" is accurate. See [adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md) for context.
+- [ ] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result.
+- [ ] Only one version is in the new port's versions file.
+- [ ] Only one version is added to each modified port's versions file.
+
+END OF NEW PORT CHECKLIST (delete this line) -->
diff --git a/vcpkg/.github/workflows/check_issues.yml b/vcpkg/.github/workflows/check_issues.yml
new file mode 100644
index 0000000..02485b1
--- /dev/null
+++ b/vcpkg/.github/workflows/check_issues.yml
@@ -0,0 +1,97 @@
+name: Check For Common Issues
+
+on:
+ issues:
+ types:
+ - opened
+
+jobs:
+ check-for-common-issues:
+ runs-on: ubuntu-latest
+ permissions:
+ issues: write
+ steps:
+ - uses: actions/github-script@v7
+ with:
+ script: |
+ let issue_query = {
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo
+ };
+ let issue = await github.rest.issues.get(issue_query)
+ let commentLabelClose = async (comment, label) => {
+ await github.rest.issues.removeAllLabels(issue_query);
+ await github.rest.issues.setLabels({...issue_query, labels: [label]});
+ await github.rest.issues.createComment({...issue_query, body: comment});
+ await github.rest.issues.update({...issue_query, state: "closed"});
+ }
+
+ if (issue.data.body === null || issue.data.body.trim() === "") {
+ let body = "Please provide a description of the issue you are experiencing. If you are reporting a build failure, please see #30604 for how to properly report it.";
+ return await commentLabelClose(body, "requires:more-information");
+ }
+
+ let issue_body = issue.data.body.replaceAll("\r\n", "\n");
+
+ // missing-windows-sdk-issue
+ let reg = /RC Pass 1: command "rc .*" failed \(exit code 0\) with the following output:/;
+ if (reg.test(issue_body)){
+ let body = "Thanks for posting this issue. Please make sure you have the following installed.\n" +
+ "- Visual Studio Desktop development with C++.\n" +
+ "- Windows 10 SDK or Windows 11 SDK.";
+ return await commentLabelClose(body, "category:question");
+ }
+
+ // msys2 download fails => old vcpkg version
+ reg = /error: https:\/\/repo\.msys2\.org\/.*: failed: status code 404/;
+ if (reg.test(issue_body)){
+ let body = "Try updating your vcpkg version via `git pull` to resolve this issue. MSYS2 downloads are removed from the upstream servers from time to time, so using an up-to-date vcpkg version is necessary."
+ return await commentLabelClose(body, "category:question");
+ }
+
+ // https://gitlab.freedesktop.org maintenance
+ reg = /error: https:\/\/gitlab\.freedesktop\.org\/.*: failed: status code 503/;
+ if (reg.test(issue_body)){
+ let body = "gitlab.freedesktop.org is undergoing maintenance until 2025-03-22. Tracking issue https://github.com/microsoft/vcpkg/issues/44429"
+ return await commentLabelClose(body, "category:question");
+ }
+
+ regs = []
+ // Issue text is: Copy issue body from .../issue_body.md
+ regs.push( /^Copy issue body from .*issue_body.md$/ );
+ // Issue to short like #36592 or #36668
+ regs.push( /^error: building.* BUILD_FAILED\r\nElapsed time.*\r\nPlease ensure.*(\r\nThen check .*\r\n.*)?$/ );
+ // Issues with only the default error message like #41813
+ regs.push( /^error: building.* BUILD_FAILED\r\n[\s\S]*issue_body.md$/ );
+ if (regs.some(reg => reg.test(issue_body))) {
+ let body = "Please see #30604 for how to report a build failure."
+ return await commentLabelClose(body, "requires:more-information");
+ }
+
+ // pkg-config/ not found issues like #36011
+ reg = /CMake Error at scripts\/cmake\/vcpkg_find_acquire_program.*\n(.*Please install it via your package manager:[\s\S]+)Call Stack/;
+ match = issue_body.match(reg)
+ if (match){
+ let body = "From the log:\n```\n" + match[1] + "```\n"
+ return await commentLabelClose(body, "category:question");
+ }
+
+ // MSVC internal compiler error like #36628
+ if (issue_body.indexOf("fatal error C1001: Internal compiler error") !== -1){
+ let body = "The build failed due to an internal compiler error. Please update your compiler or revert to an old version."
+ return await commentLabelClose(body, "category:question");
+ }
+
+ // configure: error: 'autoconf-archive' is missing like #37013
+ if (issue_body.indexOf("configure: error: 'autoconf-archive' is missing") !== -1){
+ let body = "Please install `autoconf-archive` via `brew install autoconf-archive` (macos) or `sudo apt-get install autoconf-archive` (linux)"
+ return await commentLabelClose(body, "category:question");
+ }
+
+ // Wrong formatted issues like #36086
+ const containsCopyHint = issue_body.indexOf("Copy issue body from") !== -1 || issue_body.indexOf("%2Fissue_body.md") !== -1;
+ if (containsCopyHint && issue_body.indexOf("```") === -1){
+ let body = "Please see #30604 for how to properly report a build failure."
+ return await github.rest.issues.createComment({...issue_query, body: body});
+ }
diff --git a/vcpkg/.github/workflows/check_tools_sha.yml b/vcpkg/.github/workflows/check_tools_sha.yml
new file mode 100644
index 0000000..123c52c
--- /dev/null
+++ b/vcpkg/.github/workflows/check_tools_sha.yml
@@ -0,0 +1,23 @@
+name: Check vcpkg Tools SHA
+
+on:
+ pull_request:
+ paths:
+ - "scripts/vcpkg-tools.json"
+
+permissions:
+ contents: read
+
+jobs:
+ check-tools-sha:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Bootstrap vcpkg
+ run: ./bootstrap-vcpkg.sh
+
+ - name: Run vcpkg x-check-tools-sha
+ run: vcpkg z-check-tools-sha scripts/vcpkg-tools.json || echo "Run 'vcpkg z-check-tools-sha scripts/vcpkg-tools.json --fix' to update the SHA values"
diff --git a/vcpkg/.github/workflows/codeql.yml b/vcpkg/.github/workflows/codeql.yml
new file mode 100644
index 0000000..3e9fc95
--- /dev/null
+++ b/vcpkg/.github/workflows/codeql.yml
@@ -0,0 +1,51 @@
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ "master" ]
+ schedule:
+ - cron: '26 0 * * 0'
+ workflow_dispatch:
+
+jobs:
+ analyze:
+ name: Analyze (${{ matrix.language }})
+ runs-on: 'ubuntu-latest'
+ permissions:
+ # required for all workflows
+ security-events: write
+
+ # required to fetch internal or private CodeQL packs
+ packages: read
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - language: actions
+ build-mode: none
+ - language: c-cpp
+ build-mode: manual
+ - language: python
+ build-mode: none
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ build-mode: ${{ matrix.build-mode }}
+ - if: matrix.build-mode == 'manual'
+ shell: bash
+ run: |
+ ./bootstrap-vcpkg.sh
+ # This list of ports which are meaningful for CodeQL to analyze because they have actual code in vcpkg's repo
+ # See https://github.com/search?q=repo%3Amicrosoft%2Fvcpkg++language%3AC+&type=code
+ # See https://github.com/search?q=repo%3Amicrosoft%2Fvcpkg++language%3AC%2B%2B&type=code
+ ./vcpkg install alac-decoder breakpad[tools] gettimeofday modp-base64
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/vcpkg/.github/workflows/stale.yml b/vcpkg/.github/workflows/stale.yml
new file mode 100644
index 0000000..7bd6e84
--- /dev/null
+++ b/vcpkg/.github/workflows/stale.yml
@@ -0,0 +1,35 @@
+name: 'Close stale issues and PRs'
+on:
+ schedule:
+ - cron: '30 1 * * *'
+
+permissions:
+ issues: write
+
+jobs:
+ stale:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/stale@v8
+ with:
+ stale-issue-message: 'This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.'
+ any-of-labels: 'category:question,requires:repro,requires:more-information'
+ days-before-issue-stale: 28
+ days-before-pr-stale: -1
+ days-before-close: 14
+ - uses: actions/stale@v8
+ with:
+ stale-issue-message: "This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 60 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment."
+ any-of-labels: 'category:new-port'
+ close-issue-label: 'info:new-port-unresolved'
+ days-before-issue-stale: 60
+ days-before-pr-stale: -1
+ days-before-close: 14
+ - uses: actions/stale@v8
+ with:
+ stale-issue-message: "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."
+ exempt-issue-labels: 'no-stale,category:new-port,category:question,requires:repro,requires:more-information'
+ days-before-issue-stale: 180
+ days-before-pr-stale: -1
+ days-before-close: 14
+ operations-per-run: 50
diff --git a/vcpkg/.github/workflows/untrustedPR.yml b/vcpkg/.github/workflows/untrustedPR.yml
new file mode 100644
index 0000000..2510a34
--- /dev/null
+++ b/vcpkg/.github/workflows/untrustedPR.yml
@@ -0,0 +1,194 @@
+name: Check For Common Mistakes
+
+permissions:
+ contents: read
+
+on:
+ pull_request:
+
+jobs:
+ Check:
+ runs-on: ubuntu-22.04
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ # fetch-depth 50 tries to ensure we capture the whole history of the branch
+ fetch-depth: 50
+
+ - name: Bootstrap
+ run: ./bootstrap-vcpkg.sh
+
+ - name: Formatting
+ run: |
+ git config user.email github-actions
+ git config user.name github-actions@github.com
+
+ git --version
+
+ unset VCPKG_ROOT
+
+ git diff --name-status --merge-base HEAD^ HEAD --diff-filter=MAR -- '*portfile.cmake' | sed 's/[MAR]\t*//' > .github-pr.changed-portfiles
+ if [ -s .github-pr.changed-portfiles ]; then (grep -n -H -E '(vcpkg_apply_patches|vcpkg_build_msbuild|vcpkg_extract_source_archive_ex)' $(cat .github-pr.changed-portfiles) || true) > .github-pr.deprecated-function; else touch .github-pr.deprecated-function; fi
+ if [ -s .github-pr.changed-portfiles ]; then (grep -n -H -E '(vcpkg_install_cmake|vcpkg_build_cmake|vcpkg_configure_cmake|vcpkg_fixup_cmake_targets)' $(cat .github-pr.changed-portfiles) || true) > .github-pr.deprecated-cmake; else touch .github-pr.deprecated-cmake; fi
+ git diff --name-status --merge-base HEAD^ HEAD --diff-filter=MAR -- '*vcpkg.json' | sed 's/[MAR]\t*//' > .github-pr.changed-manifest-files
+ cat .github-pr.changed-manifest-files | while read filename; do grep -q -E '"license": ' "$filename" || echo "$filename" || true; done > .github-pr.missing-license
+ cat .github-pr.changed-manifest-files | while read filename; do grep -n -H '"license": "' "$filename" || true; done > .github-pr.all-licenses
+ cat .github-pr.all-licenses | while read license; do \
+ location=$(echo $license | grep -oP '^.*?:[0-9]+:'); \
+ echo $license | \
+ grep -oiP '(AGPL-1\.0|AGPL-3\.0|BSD-2-Clause-FreeBSD|BSD-2-Clause-NetBSD|bzip2-1\.0\.5|eCos-2\.0|GFDL-1\.1|GFDL-1\.2|GFDL-1\.3|GPL-1\.0|GPL-1\.0\+|GPL-2\.0|GPL-2\.0\+|GPL-2\.0-with-autoconf-exception|GPL-2\.0-with-bison-exception|GPL-2\.0-with-classpath-exception|GPL-2\.0-with-font-exception|GPL-2\.0-with-GCC-exception|GPL-3\.0|GPL-3\.0\+|GPL-3\.0-with-autoconf-exception|GPL-3\.0-with-GCC-exception|LGPL-2\.0|LGPL-2\.0\+|LGPL-2\.1|LGPL-2\.1\+|LGPL-3\.0|LGPL-3\.0\+|Nunit|StandardML-NJ|wxWindows)(?=[ ")&|,])' | \
+ while read id; do \
+ echo "$location$id"; \
+ done || true; \
+ done > .github-pr.deprecated-license
+ ./vcpkg format-manifest --all --convert-control
+ ./vcpkg format-feature-baseline scripts/ci.baseline.txt
+ ./vcpkg format-feature-baseline scripts/ci.feature.baseline.txt
+ git diff > .github-pr.format-manifest
+ git add -u
+ git commit -m "tmp" --allow-empty
+ # HEAD^^ refers to the "main" commit that was merged into
+ git checkout HEAD^^ -- versions
+ git restore --staged versions
+ ./vcpkg x-add-version --all --skip-formatting-check | grep 'instead of "version-string"' | tee .github-pr.version-string.out || true
+ git checkout -- versions
+ ./vcpkg x-add-version --all --skip-formatting-check --skip-version-format-check | tee .github-pr.x-add-version.out || true
+ git diff > .github-pr.x-add-version.diff
+ git reset HEAD~ --mixed
+
+ - name: Generate Reply
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const { promises: fs } = require('fs')
+ const add_version = (await fs.readFile('.github-pr.x-add-version.diff', 'utf8')).trim()
+ const add_version_out = (await fs.readFile('.github-pr.x-add-version.out', 'utf8')).trim()
+ const version_string_out = (await fs.readFile('.github-pr.version-string.out', 'utf8')).trim()
+ const format = (await fs.readFile('.github-pr.format-manifest', 'utf8')).trim()
+ const deprecated_function = (await fs.readFile('.github-pr.deprecated-function', 'utf8')).split('\n').filter(s => s.length > 0)
+ const deprecated_cmake = (await fs.readFile('.github-pr.deprecated-cmake', 'utf8')).split('\n').filter(s => s.length > 0)
+ const missing_license = (await fs.readFile('.github-pr.missing-license', 'utf8')).trim()
+ const deprecated_license = (await fs.readFile('.github-pr.deprecated-license', 'utf8')).split('\n').filter(s => s.length > 0)
+
+ let approve = true;
+ if (format !== "") {
+ var format_output = '';
+ format_output += "All vcpkg.json files and baselines must be formatted. To fix this problem, run:\n";
+ format_output += "./vcpkg format-manifest ports/*/vcpkg.json\n";
+ format_output += "./vcpkg format-feature-baseline scripts/ci.baseline.txt\n";
+ format_output += "./vcpkg format-feature-baseline scripts/ci.feature.baseline.txt\n";
+ format_output += "\n";
+ format_output += "It should make the following changes:";
+ format_output += "```diff\n" + format + "\n```";
+ core.error(format_output);
+ approve = false;
+ }
+ if (add_version_out !== "") {
+ var add_version_output = '';
+ add_version_output += "PRs must add only one version, and must not modify any published versions.\n";
+ add_version_output += "When making any changes to a library, the version or port-version in vcpkg.json must be modified, and the version database updated.\n";
+ add_version_output += "Making the following changes will fix this problem:";
+ add_version_output += "```diff\n" + add_version_out + "\n```";
+ core.error(add_version_output);
+ approve = false;
+ }
+ if (version_string_out !== "") {
+ core.warning(version_string_out);
+ }
+ if (add_version !== "") {
+ var update_version_db_output = '';
+ update_version_db_output += "After committing all other changes, the version database must be updated.\n";
+ update_version_db_output += "This can be done by running the following commands after committing your changes:\n"
+ update_version_db_output += "\n"
+ update_version_db_output += "git add -u && git commit\n"
+ update_version_db_output += "git checkout ${{ github.event.pull_request.base.sha }} -- versions\n"
+ update_version_db_output += "./vcpkg x-add-version --all"
+ core.error(update_version_db_output);
+ approve = false;
+ }
+
+ if (deprecated_function.length > 0) {
+ var deprecated_output = '';
+ deprecated_output += "**You have modified or added at least one portfile where deprecated functions are used**\n"
+ deprecated_output += "If you feel able to do so, please consider migrating them to the new functions.\n";
+ core.warning(deprecated_output);
+
+ let deprecated_functions = {
+ vcpkg_extract_source_archive_ex: 'vcpkg_extract_source_archive https://learn.microsoft.com/en-us/vcpkg/maintainers/functions/vcpkg_extract_source_archive',
+ vcpkg_build_msbuild: 'vcpkg_install_msbuild https://learn.microsoft.com/en-us/vcpkg/maintainers/functions/vcpkg_install_msbuild',
+ vcpkg_apply_patches: 'the PATCHES arguments to the \"extract\" helpers (for example, vcpkg_from_github() (https://learn.microsoft.com/en-us/vcpkg/maintainers/functions/vcpkg_from_github))',
+ };
+ for (let line of deprecated_function) {
+ // line has the format: <path>:<line_number>:<matched_string
+ // For example: ports/rtlsdr/portfile.cmake:42: vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
+ [file, line_number, match] = line.split(':');
+ for (deprecated_func in deprecated_functions) {
+ if (match.indexOf(deprecated_func) !== -1) {
+ core.warning(`The function ${deprecated_func} is deprecated. Please use ${deprecated_functions[deprecated_func]}`, {file, startLine: line_number});
+ break;
+ }
+ }
+ }
+ }
+
+ if (deprecated_cmake.length > 0) {
+ var deprecated_output = '';
+ deprecated_output += "You have modified or added at least one portfile where deprecated functions are used.\n"
+ deprecated_output += "These functions have been forbidden in vcpkg, please migrating them to the new functions.\n";
+ deprecated_output += "In the ports that use the new function vcpkg_cmake_configure, vcpkg_cmake_install, vcpkg_cmake_build or vcpkg_cmake_config_fixup, you have to add the corresponding dependencies:\n";
+ deprecated_output += "```json\n";
+ deprecated_output += '{\n "name": "vcpkg-cmake",\n "host": true\n},\n'
+ deprecated_output += '{\n "name": "vcpkg-cmake-config",\n "host": true\n}\n';
+ deprecated_output += "```\n";
+ core.error(deprecated_output);
+
+ let deprecated_functions = {
+ vcpkg_install_cmake: 'vcpkg_cmake_install (from port vcpkg-cmake)',
+ vcpkg_install_cmake: 'vcpkg_cmake_install (from port vcpkg-cmake)',
+ vcpkg_build_cmake: 'vcpkg_cmake_build (from port vcpkg-cmake)',
+ vcpkg_configure_cmake: 'vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)',
+ vcpkg_fixup_cmake_targets: 'vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)',
+ };
+ for (let line of deprecated_cmake) {
+ // line has the format: <path>:<line_number>:<matched_string
+ // For example: ports/rtlsdr/portfile.cmake:42: vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
+ [file, line_number, match] = line.split(':');
+ for (deprecated_cmake_function in deprecated_functions) {
+ if (match.indexOf(deprecated_cmake_function) !== -1) {
+ core.warning(`The function ${deprecated_cmake_function} is deprecated. Please use ${deprecated_functions[deprecated_cmake_function]}`, {file, startLine: line_number});
+ break;
+ }
+ }
+ }
+ }
+
+ if (missing_license !== "" || deprecated_license.length > 0) {
+ core.summary.addRaw('You have modified or added at least one vcpkg.json where you should check the \"license\" field.');
+ core.summary.addEOL();
+ }
+
+ if (missing_license !== "") {
+ license_output = 'If you feel able to do so, please consider adding a "license" field to the following files:\n'
+ license_output += missing_license
+ license_output += "\n\nValid values for the license field can be found at https://learn.microsoft.com/vcpkg/reference/vcpkg-json#license\n\n"
+
+ core.warning(license_output);
+ }
+
+ for (let line of deprecated_license) {
+ [file, line_number, match] = line.split(':');
+ var license_output = `SPDX deprecated license identifier ${match}.`;
+ license_output += "\nIf you feel able to do so, please consider replacing it."
+ license_output += "\nUpdated license identifiers can be found at https://spdx.org/licenses/."
+
+
+ core.notice(license_output, {file, startLine: line_number});
+ }
+
+ core.summary.write();
+
+ if (!approve) {
+ process.exitCode = 1;
+ }