Skip to content

Commit 44d94c2

Browse files
autoantwortras0219
andauthored
[docs] binarycaching.md: Move Configuration section to the top. Add table of… (#17060)
* binarycaching.md: Move Configuration section to the top. Add table of contents. Make clear that file location must be absolute. Add that read is the default mode. * Apply suggestions from code review Co-authored-by: ras0219 <[email protected]> Co-authored-by: ras0219 <[email protected]>
1 parent 8badb23 commit 44d94c2

File tree

1 file changed

+47
-34
lines changed

1 file changed

+47
-34
lines changed

Diff for: docs/users/binarycaching.md

+47-34
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,51 @@ Binary caching is vcpkg's method for reusing package builds between projects and
66

77
If your CI provider offers a native "caching" function, we recommend using both methods for the most performant results.
88

9-
In-tool help is available via `vcpkg help binarycaching` and a [detailed configuration reference is provided below](#Configuration).
9+
In-tool help is available via `vcpkg help binarycaching`.
10+
11+
Table of Contents
12+
- [Configuration](#configuration)
13+
- [CI Examples](#ci-examples)
14+
- [GitHub Packages](#github-packages)
15+
- [Azure DevOps Artifacts](#azure-devops-artifacts)
16+
- [Azure Blob Storage](#azure-blob-storage-experimental)
17+
- [Google Cloud Storage](#google-cloud-storage-experimental)
18+
- [NuGet Provider Configuration](#nuget-provider-configuration)
19+
- [Implementation Notes](#implementation-notes-internal-details-subject-to-change-without-notice)
20+
21+
22+
## Configuration
23+
24+
Binary caching is configured via a combination of defaults, the environment variable `VCPKG_BINARY_SOURCES` (set to `<source>;<source>;...`), and the command line option `--binarysource=<source>`. Source options are evaluated in order of defaults, then environment, then command line. Binary caching can be completely disabled by passing `--binarysource=clear` as the last command line option.
25+
26+
By default, zip-based archives will be cached at the first valid location of:
27+
28+
**Windows**
29+
1. `%VCPKG_DEFAULT_BINARY_CACHE%`
30+
2. `%LOCALAPPDATA%\vcpkg\archives`
31+
3. `%APPDATA%\vcpkg\archives`
32+
33+
**Non-Windows**
34+
1. `$VCPKG_DEFAULT_BINARY_CACHE`
35+
2. `$XDG_CACHE_HOME/vcpkg/archives`
36+
3. `$HOME/.cache/vcpkg/archives`
37+
38+
### Valid source strings (`<source>`)
39+
40+
| form | description
41+
|-----------------------------|---------------
42+
| `clear` | Removes all previous sources (including the default)
43+
| `default[,<rw>]` | Adds the default file-based location
44+
| `files,<absolute path>[,<rw>]` | Adds a custom file-based location
45+
| `nuget,<uri>[,<rw>]` | Adds a NuGet-based source; equivalent to the `-Source` parameter of the NuGet CLI
46+
| `nugetconfig,<path>[,<rw>]` | Adds a NuGet-config-file-based source; equivalent to the `-Config` parameter of the NuGet CLI. This config should specify `defaultPushSource` for uploads.
47+
| `x-azblob,<baseuri>,<sas>[,<rw>]` | **Experimental: will change or be removed without warning**<br> Adds an Azure Blob Storage source. Uses Shared Access Signature validation. URL should include the container path.
48+
| `interactive` | Enables interactive credential management for NuGet (for debugging; requires `--debug` on the command line)
49+
50+
The `<rw>` optional parameter for certain sources controls whether they will be consulted for
51+
downloading binaries (`read`)(default), whether on-demand builds will be uploaded to that remote (`write`), or both (`readwrite`).
52+
53+
Additional configuration details for NuGet-based providers can be found below in [NuGet Provider Configuration](#nuget-provider-configuration).
1054

1155
## CI Examples
1256

@@ -146,40 +190,9 @@ Commas (`,`) are valid as part of a object prefix in GCS, just remember to escap
146190
shown in the previous example. Note that GCS does not have folders (some of the GCS tools simulate folders), it is not
147191
necessary to create or otherwise manipulate the prefix used by your vcpkg cache.
148192
149-
## Configuration
150-
151-
Binary caching is configured via a combination of defaults, the environment variable `VCPKG_BINARY_SOURCES` (set to `<source>;<source>;...`), and the command line option `--binarysource=<source>`. Source options are evaluated in order of defaults, then environment, then command line. Binary caching can be completely disabled by passing `--binarysource=clear` as the last command line option.
152-
153-
By default, zip-based archives will be cached at the first valid location of:
154-
155-
**Windows**
156-
1. `%VCPKG_DEFAULT_BINARY_CACHE%`
157-
2. `%LOCALAPPDATA%\vcpkg\archives`
158-
3. `%APPDATA%\vcpkg\archives`
159-
160-
**Non-Windows**
161-
1. `$VCPKG_DEFAULT_BINARY_CACHE`
162-
2. `$XDG_CACHE_HOME/vcpkg/archives`
163-
3. `$HOME/.cache/vcpkg/archives`
164-
165-
### Valid source strings (`<source>`)
166-
167-
| form | description
168-
|-----------------------------|---------------
169-
| `clear` | Removes all previous sources (including the default)
170-
| `default[,<rw>]` | Adds the default file-based location
171-
| `files,<path>[,<rw>]` | Adds a custom file-based location
172-
| `nuget,<uri>[,<rw>]` | Adds a NuGet-based source; equivalent to the `-Source` parameter of the NuGet CLI
173-
| `nugetconfig,<path>[,<rw>]` | Adds a NuGet-config-file-based source; equivalent to the `-Config` parameter of the NuGet CLI. This config should specify `defaultPushSource` for uploads.
174-
| `x-azblob,<baseuri>,<sas>[,<rw>]` | **Experimental: will change or be removed without warning**<br> Adds an Azure Blob Storage source. Uses Shared Access Signature validation. URL should include the container path.
175-
| `interactive` | Enables interactive credential management for NuGet (for debugging; requires `--debug` on the command line)
176-
177-
The `<rw>` optional parameter for certain sources controls whether they will be consulted for
178-
downloading binaries (`read`), whether on-demand builds will be uploaded to that remote (`write`), or both (`readwrite`).
179-
180-
### Nuget Provider Configuration
193+
## NuGet Provider Configuration
181194
182-
#### Credentials
195+
### Credentials
183196
184197
Many NuGet servers require additional credentials to access. The most flexible way to supply credentials is via the `nugetconfig` provider with a custom `nuget.config` file. See https://docs.microsoft.com/en-us/nuget/consume-packages/consuming-packages-authenticated-feeds for more information on authenticating via `nuget.config`.
185198

0 commit comments

Comments
 (0)