Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/microsoft/vcpkg into Dev/…
Browse files Browse the repository at this point in the history
…Cheney/26538

# Conflicts:
#	ports/ffmpeg/portfile.cmake
#	ports/ffmpeg/vcpkg.json
#	versions/baseline.json
#	versions/f-/ffmpeg.json
  • Loading branch information
Cheney-W committed Oct 20, 2022
2 parents 53ab6fd + 94ce0da commit febddb1
Show file tree
Hide file tree
Showing 1,545 changed files with 21,946 additions and 7,001 deletions.
16 changes: 13 additions & 3 deletions .github/ISSUE_TEMPLATE/report-package-build-failure.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,32 @@
name: Report package build failure
about: Let us know about build failures in ports.
title: "[<port name>] build failure"
labels: port bug
labels: category:port-bug
assignees: ''

---

<!-- ⚠ Please use the generated issue template instead to report a port build failure. ⚠ -->
<!-- ⁉ You can find its location at the end of the console output. ⁉ -->

**Host Environment**

- OS: [e.g. Windows/Linux etc...]
- Compiler: revision

**To Reproduce**

Steps to reproduce the behavior:

`./vcpkg install xxxx`

**Failure logs**
-Cut and paste the appropriate build messages from the console output.
-Please attach any additional failure logs mentioned in the console output.

- Cut and paste the appropriate build messages from the console output.
- Attach ***every failure log file*** mentioned in the console output.

<!-- ‼ **The console output by itself is not enough to investigate a build failure.** ‼ -->

**Additional context**

Add any other context about the problem here, such as what you have already tried to resolve the issue.
7 changes: 6 additions & 1 deletion .github/workflows/trustedPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ on:
types:
- completed

permissions:
contents: read

jobs:
comment:
runs-on: ubuntu-latest
permissions:
pull-requests: write
runs-on: ubuntu-22.04
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/untrustedPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,15 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
with:
# fetch-depth 50 tries to ensure we capture the whole history of the branch
fetch-depth: 50

- uses: actions/cache@v2
id: cache
with:
path: |
./vcpkg
key: ${{ runner.os }}-${{ hashFiles('scripts/bootstrap*') }}

- name: bootstrap
if: steps.cache.outputs.cache-hit != 'true'
run: ./bootstrap-vcpkg.sh

- name: Save PR number
Expand All @@ -38,6 +30,10 @@ jobs:
git config user.email github-actions
git config user.name [email protected]
git --version
unset VCPKG_ROOT
git diff --name-status --merge-base HEAD^ HEAD --diff-filter=MAR -- '*portfile.cmake' | sed 's/[MAR]\t*//' | while read filename; do grep -q -E '(vcpkg_install_cmake|vcpkg_build_cmake|vcpkg_configure_cmake|vcpkg_fixup_cmake_targets)' "$filename" && echo " - \`$filename\`" || true; done > .github-pr.deprecated-cmake
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validateDocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
validate:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ you can run `vcpkg help`, or `vcpkg help [command]` for command-specific help.
- [Vcpkg with Visual Studio CMake Projects](#vcpkg-with-visual-studio-cmake-projects)
- [Vcpkg with CLion](#vcpkg-with-clion)
- [Vcpkg as a Submodule](#vcpkg-as-a-submodule)
- [Vcpkg via FetchContent](#vcpkg-via-FetchContent)
- [Tab-Completion/Auto-Completion](#tab-completionauto-completion)
- [Examples](#examples)
- [Contributing](#contributing)
Expand Down Expand Up @@ -262,6 +263,28 @@ This will still allow people to not use vcpkg,
by passing the `CMAKE_TOOLCHAIN_FILE` directly,
but it will make the configure-build step slightly easier.

### Vcpkg via FetchContent

You can also grab vcpkg with CMake's built-in [FetchContent](https://cmake.org/cmake/help/v3.24/module/FetchContent.html) module.

Don't worry about the bootstrap scripts, since `vcpkg.cmake` will run them for you!

```
cmake_minimum_required(VERSION 3.14)
include(FetchContent)
FetchContent_Declare(vcpkg
GIT_REPOSITORY https://github.com/microsoft/vcpkg/
GIT_TAG 2022.09.27
)
FetchContent_MakeAvailable(vcpkg)
# NOTE: This must be defined before the first project call
set(CMAKE_TOOLCHAIN_FILE "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH "")
project(FOOBAR LANGUAGES "CXX")
```

[getting-started:using-a-package]: docs/examples/installing-and-using-packages.md
[getting-started:integration]: docs/users/buildsystems/integration.md
[getting-started:git]: https://git-scm.com/downloads
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/common-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Specifies the path to lay out installed packages.

In Classic Mode, defaults to `installed/` under the vcpkg root folder.

In [Manifest Mode][../users/manifests.md], defaults to `vcpkg_installed/` under the manifest folder.
In [Manifest Mode](../users/manifests.md), defaults to `vcpkg_installed/` under the manifest folder.

<a name="manifest-root"></a>

Expand Down
14 changes: 8 additions & 6 deletions docs/commands/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ All vcpkg commands support a set of [common options](common-options.md).

Instead of stopping on an unsupported port, continue with a warning.

By default, vcpkg refuses to execute an install plan containing a port installation for a triplet outside its [`"supports"`][] clause. The [`"supports"`][] clause of a package describes the full set of platforms a package is expected to be buildable on. This flag instructs vcpkg to warn that the build is expected to fail instead of stopping.
By default, vcpkg refuses to execute an install plan containing a port installation for a triplet outside its [`"supports"`][supports] clause. The [`"supports"`][supports] clause of a package describes the full set of platforms a package is expected to be buildable on. This flag instructs vcpkg to warn that the build is expected to fail instead of stopping.

### `--clean-after-build`

Expand Down Expand Up @@ -103,6 +103,8 @@ Fail install if a port has detected problems or attempts to use a deprecated fea

By default, vcpkg will run several checks on built packages and emit warnings if any issues are detected. This flag upgrades those warnings to an error.

<a name="feature"></a>

### `--x-feature=<feature>`

**Experimental and may change or be removed at any time**
Expand All @@ -111,7 +113,7 @@ By default, vcpkg will run several checks on built packages and emit warnings if

Specify an additional [feature](../users/manifests.md#features) from the `vcpkg.json` to install dependencies for.

By default, only [`"dependencies"`](../users/manifests.md#dependencies) and the dependencies of the [`"default-features"`](../users/manifests.md#default-features) will be installed.
By default, only [`"dependencies"`][dependencies] and the dependencies of the [`"default-features"`][default-features] will be installed.

### `--head`

Expand All @@ -135,7 +137,7 @@ By default, vcpkg will stop at the first package build failure. This flag instru

Don't install the default features from the top-level manifest.

When using `install` in Manifest Mode, by default all dependencies of the features listed in [`"default-features"`][] will be installed. This flag disables that behavior so (without any `TODO` flags) only the dependencies listed in [`"dependencies"`][] will be installed.
When using `install` in Manifest Mode, by default all dependencies of the features listed in [`"default-features"`][default-features] will be installed. This flag disables that behavior so only features explicitly enabled by [`--x-feature`](#feature) will be installed.

### `--no-downloads`

Expand Down Expand Up @@ -186,6 +188,6 @@ Suppress generation of usage text printed at the end of installation.
[Asset Caching]: ../users/assetcaching.md
[Binary Caching]: ../users/binarycaching.md
[Manifest Mode]: ../users/manifests.md
[`"supports"`]: ../users/manifests.md#supports
[`"default-features"`]: ../users/manifests.md#default-features
[`"dependencies"`]: ../users/manifests.md#dependencies
[supports]: ../users/manifests.md#supports
[default-features]: ../users/manifests.md#default-features
[dependencies]: ../users/manifests.md#dependencies
2 changes: 1 addition & 1 deletion docs/commands/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ vcpkg remove --outdated [options]

Remove port packages from Classic Mode.

`remove` removes listed packages and any packages that require them from the Classic Mode [installed directory][common-options.md#install-root]. See the [install command documentation](install.md#package-syntax) for detailed syntax of the `<package>` parameter.
`remove` removes listed packages and any packages that require them from the Classic Mode [installed directory](common-options.md#install-root). See the [install command documentation](install.md#package-syntax) for detailed syntax of the `<package>` parameter.

This command is not currently supported in [Manifest Mode][].

Expand Down
8 changes: 4 additions & 4 deletions docs/commands/update-baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ vcpkg x-update-baseline [options] [--add-initial-baseline] [--dry-run]

Update baselines for all configured [registries][].

In [Manifest Mode][], this command operates on all [registries][] in the `vcpkg.json` and the [`vcpkg-configuration.json`][]. In Classic Mode, this command operates on the [`vcpkg-configuration.json`][] in the vcpkg instance (`$VCPKG_ROOT`).
In [Manifest Mode][], this command operates on all [registries][] in the `vcpkg.json` and the [`vcpkg-configuration.json`][vcj]. In Classic Mode, this command operates on the [`vcpkg-configuration.json`][vcj] in the vcpkg instance (`$VCPKG_ROOT`).

See the [versioning documentation](../users/versioning.md#baselines) for more information about baselines.

Expand All @@ -32,11 +32,11 @@ Print the planned baseline upgrades, but do not modify the files on disk.

**[Manifest Mode][] Only**

Add a [`"builtin-baseline"`][] field to the `vcpkg.json` if it does not already have one.
Add a [`"builtin-baseline"`][builtin-baseline] field to the `vcpkg.json` if it does not already have one.

Without this flag, it is an error to run this command on a manifest that does not have any [registries][] configured.

[Manifest Mode]: ../users/manifests.md
[`"builtin-baseline"`]: ../users/manifests.md#builtin-baseline
[`vcpkg-configuration.json`]: ../users/registries.md#vcpkg-configurationjson
[builtin-baseline]: ../users/manifests.md#builtin-baseline
[vcj]: ../users/registries.md#vcpkg-configurationjson
[registries]: ../users/registries.md
19 changes: 15 additions & 4 deletions docs/maintainers/internal/vcpkg_tool_release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,27 @@ such as https://github.com/microsoft/vcpkg/pull/23757
the "auto generate release notes" button. Manually remove any entries created by the automated
localization tools which will start with `* LEGO: Pull request from juno/`.
9. Publish that draft release as "pre-release".
10. Smoke test the 'one liner' installer: (Where 2022-06-15 is replaced with the right release name)
10. Clean up a machine for the following tests:
* Delete `VCPKG_DOWNLOADS/artifacts` (which forces artifacts to be reacquired)
* Delete `LOCALAPPDATA/vcpkg` (which forces registries to be reacquired)
11. Smoke test the 'one liner' installer: (Where 2022-06-15 is replaced with the right release name)
* Powershell:
`iex (iwr https://github.com/microsoft/vcpkg-tool/releases/download/2022-06-15/vcpkg-init.ps1)`
* Batch:
`curl -L -o vcpkg-init.cmd https://github.com/microsoft/vcpkg-tool/releases/download/2022-06-15/vcpkg-init.ps1 && .\vcpkg-init.cmd`
* Bash:
`. <(curl https://github.com/microsoft/vcpkg-tool/releases/download/2022-06-15/vcpkg-init -L)`
11. In the vcpkg repo, draft a PR which updates `bootstrap-vcpkg.sh` and `boostrap-vcpkg.ps1`
12. Test that embedded scenarios work for vcpkg-artifacts:
Ensure that none of the following report errors:
1. git clone https://github.com/some-example/blink/
2. cd blink
3. vcpkg activate
4. idf.py set-target ESP32
5. cd build
6. ninja
13. In the vcpkg repo, draft a PR which updates `bootstrap-vcpkg.sh` and `boostrap-vcpkg.ps1`
with the new release date, and update SHAs as appropriate in the .sh script. (For example, see
https://github.com/microsoft/vcpkg/pull/23757)
12. Merge the tool update PR.
13. Change the github release in vcpkg-tool from "prerelease" to "release". (This automatically
15. Merge the tool update PR.
16. Change the github release in vcpkg-tool from "prerelease" to "release". (This automatically
updates the aka.ms links)
4 changes: 3 additions & 1 deletion docs/maintainers/vcpkg_common_definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ The latest version of this document lives in the [vcpkg repo](https://github.com
This file defines the following variables which are commonly needed or used in portfiles:

```cmake
VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, MINGW, LINUX, OSX, ANDROID, FREEBSD, OPENBSD. only defined if <target>
PORT The name of the port that is currently being built
VERSION The version of the port that is currently being built
VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, MINGW, LINUX, OSX, ANDROID, FREEBSD, OPENBSD, EMSCRIPTEN. only defined if <target>
VCPKG_HOST_IS_<host> with <host> being one of the following: WINDOWS, LINUX, OSX, FREEBSD, OPENBSD. only defined if <host>
VCPKG_HOST_PATH_SEPARATOR Host specific path separator (USAGE: "<something>${VCPKG_HOST_PATH_SEPARATOR}<something>"; only use and pass variables with VCPKG_HOST_PATH_SEPARATOR within "")
VCPKG_HOST_EXECUTABLE_SUFFIX executable suffix of the host
Expand Down
2 changes: 1 addition & 1 deletion docs/maintainers/vcpkg_from_gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ At least one of `REF` and `HEAD_REF` must be specified, however it is preferable
This exports the `VCPKG_HEAD_VERSION` variable during head builds.

## Examples:
* [curl][https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75]
* [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75)
* [folly](https://github.com/Microsoft/vcpkg/blob/master/ports/folly/portfile.cmake#L15)
* [z3](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13)

Expand Down
8 changes: 6 additions & 2 deletions docs/users/config-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This environment variable can be set to the full path of an executable to be use

#### VCPKG_ROOT

This environment variable can be set to a directory to use as the root of the vcpkg instance. Note that mixing vcpkg
repo versions and executable versions can cause issues.
This environment variable can be set to a directory to use as the root of the vcpkg instance. This will only be used if
the vcpkg executable is not located within a valid root and the command line switch `--vcpkg-root` is unused.

#### VCPKG_VISUAL_STUDIO_PATH

Expand Down Expand Up @@ -99,3 +99,7 @@ This environment variable allows using NuGet's cache for every nuget-based binar
> Note: This is an experimental feature and may change or be removed at any time
This environment variable allows using a private mirror for all SHA512-tagged assets. See [Asset Caching](assetcaching.md) for more details.

#### VCPKG_NO_CI

Setting `VCPKG_NO_CI` disables vcpkg's CI environment detection heuristics.
20 changes: 14 additions & 6 deletions docs/users/manifests.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ manifest mode.
- [`"name"`](#dependencies-name)
- [`"default-features"`](#dependencies-default-features)
- [`"features"`](#dependencies-features)
- [`"host"`](#host)
- [`"platform"`](#platform)
- [`"version>="`](#version-gt)
- [`"overrides"`](#overrides)
- [`"supports"`](#supports)
- [`"features"`](#features)
- [`"default-features"`](#default-features)

See also [the original specification](../specifications/manifests.md) for more low-level details.

## Simple Example Manifest

```json
Expand Down Expand Up @@ -69,8 +68,9 @@ Manifests follow strict JSON: they can't contain C++-style comments (`//`) nor t
you can use field names that start with `$` to write your comments in any object that has a well-defined set of keys.
These comment fields are not allowed in any objects which permit user-defined keys (such as `"features"`).

Each manifest contains a top level object with the fields documented below; the most important ones are
[`"name"`](#name), the [version fields](#version-fields), and [`"dependencies"`](#dependencies):
The latest JSON Schema is available at https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json. IDEs with JSON Schema support such as Visual Studio and Visual Studio Code can use this file to provide IntelliSense and syntax checking. For most IDEs, you should set `"$schema"` in your `vcpkg.json` to this URL (like the above example).

Each manifest contains a top level object with the following fields:

<a id="name"></a>

Expand All @@ -80,8 +80,6 @@ This is the name of your project! It must be formatted in a way that vcpkg under
it must be lowercase alphabetic characters, digits, and hyphens, and it must not start nor end with a hyphen.
For example, `Boost.Asio` might be given the name `boost-asio`.

This is a required field.

### Version Fields

There are four version field options, depending on how the port orders its
Expand Down Expand Up @@ -190,6 +188,16 @@ Then, you might just ask for:
}
```

<a id="host"></a>

#### `"host"` Field

A boolean indicating that the dependency must be built for the [host triplet](host-dependencies.md) instead of the current port's triplet. Defaults to `false`.

Any dependency that provides tools or scripts which should be "executed" during a build (such as buildsystems, code generators, or helpers) should be marked as `"host": true`. This enables correct cross-compilation in cases that the target is not executable -- such as when compiling for `arm64-android`.

See [Host Dependencies](host-dependencies.md) for more information.

<a id="platform"></a>

#### `"platform"` Field
Expand Down
5 changes: 5 additions & 0 deletions docs/users/triplets.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ This field is optional.

Also available as build-type specific `VCPKG_MESON_CONFIGURE_OPTIONS_DEBUG` and `VCPKG_MESON_CONFIGURE_OPTIONS_RELEASE` variables.

### VCPKG_MESON_(CROSS|NATIVE)_FILE(_RELEASE|_DEBUG)
Provide an additional (configuration dependent) file as a meson cross/native file. Can be used to override settings provided by vcpkg since it will be passed after vcpkg's generated cross/native files are passed.

Especially usefull to provide your own build_machine and host_machine entries.

### VCPKG_CMAKE_CONFIGURE_OPTIONS
Set additional CMake configure options that are appended to the configure command (in [`vcpkg_cmake_configure`](../maintainers/vcpkg_cmake_configure.md)).

Expand Down
Loading

0 comments on commit febddb1

Please sign in to comment.