Skip to content

Release pipeline: route vcpkg through Terrapin asset cache#1990

Merged
tyrielv merged 1 commit into
masterfrom
tyrielv/release-pipeline-vcpkg-fix
May 27, 2026
Merged

Release pipeline: route vcpkg through Terrapin asset cache#1990
tyrielv merged 1 commit into
masterfrom
tyrielv/release-pipeline-vcpkg-fix

Conversation

@tyrielv
Copy link
Copy Markdown
Contributor

@tyrielv tyrielv commented May 27, 2026

Problem

The official release pipeline has been failing since libgit2 was
statically linked via vcpkg, because the pool's build agents do not have
direct public-internet access. vcpkg was reaching out to sourceforge.net
for libgit2 transitive dependencies (pcre, zlib, http_parser, ...) which
the network layer blocked, causing WinHttpSendRequest 12029 errors.

Solution

Route vcpkg asset downloads through the internal Terrapin cache (the
canonical CI asset-caching service). This is opt-in — external
contributors and the public GitHub Actions PR-validation workflow
(.github/workflows/build.yaml) continue to use the standard vcpkg flow
with direct downloads from public origins. No internal feed
authentication is required to build VFS for Git from a fresh clone, and
the repo source code intentionally contains no msbuild SDK references
that would pull internal packages into a default restore.

Changes

  • Directory.Build.props: add IsLocalBuild and
    UseTerrapinAssetCache properties, both defaulted to false.
    IsLocalBuild controls Terrapin upload-on-fetch (allowed on dev boxes
    only); UseTerrapinAssetCache opts the build into the Terrapin
    asset-cache machinery (release pipeline only).

  • Directory.Build.targets: build a --x-asset-sources string that
    combines the Terrapin retrieval script with x-block-origin, gated on
    UseTerrapinAssetCache=true, and append it to both vcpkg install
    invocations. Add a guard <Error> that requires the pipeline to
    supply TerrapinRetrievalToolPath up front when asset caching is
    enabled. Also validate static git2.lib (was only checking dynamic
    git2.dll).

  • .azure-pipelines/official-release-nuget.config (new):
    pipeline-only NuGet config that points at an internal feed. Used
    solely by a one-off nuget install of Microsoft.Build.Vcpkg, not by
    any csproj restore. Not consulted by external contributors or by
    GitHub Actions.

  • .azure-pipelines/release.yml:

    • Add NuGetAuthenticate@1 task.
    • Add a NuGetCommand@2 task that out-of-band installs the internal
      Microsoft.Build.Vcpkg package (which ships
      TerrapinRetrievalTool.exe) into $(Agent.TempDirectory).
    • Add an explicit Restore vcpkg native libraries (Terrapin cache)
      step that invokes _RestoreVcpkgDependencies on
      GVFS.Common.csproj with -p:UseTerrapinAssetCache=true and
      TerrapinRetrievalToolPath pointing at the extracted tool. The
      existing Build.bat invocation downstream then skips the vcpkg
      install because the libs are already present.

Verification

Verified with a successful run of the build stage in the official
release pipeline. End-to-end green: Restore vcpkg native libraries,
Build (Release), unit tests, installer build, and all 4 pipeline
artifacts (Installer, FastFetch, Symbols, FunctionalTests). The
Terrapin cache had every libgit2 transitive dep already seeded, so no
follow-up cache-seeding request is needed.

The official release pipeline has been failing since libgit2 was
statically linked via vcpkg, because the pool's build agents do not have
direct public-internet access. vcpkg was reaching out to sourceforge.net
(and other origins) for libgit2 transitive dependencies (pcre, zlib,
http_parser, ...) which the network layer blocked, causing
WinHttpSendRequest 12029 errors.

Route vcpkg asset downloads through the internal Terrapin cache (the
canonical CI asset-caching service).

This is opt-in. External contributors and the public GitHub Actions
PR-validation workflow (.github/workflows/build.yaml) continue to use
the standard vcpkg flow with direct downloads from public origins. No
internal feed authentication is required to build VFS for Git from a
fresh clone, and the repo source code intentionally contains no msbuild
SDK references that would pull internal packages into a default restore.

Changes:

  Directory.Build.props
    Add IsLocalBuild and UseTerrapinAssetCache properties, both
    defaulted to false. IsLocalBuild controls Terrapin upload-on-fetch
    (allowed on dev boxes only); UseTerrapinAssetCache opts the build
    into the Terrapin asset-cache machinery (release pipeline only).

  Directory.Build.targets
    Build a --x-asset-sources string that combines the Terrapin
    retrieval script with x-block-origin, gated on
    UseTerrapinAssetCache=true, and append it to both vcpkg install
    invocations. Add a guard <Error> that requires the pipeline to
    supply TerrapinRetrievalToolPath up front when asset caching is
    enabled. Also validate static git2.lib (was only checking dynamic
    git2.dll).

  .azure-pipelines/official-release-nuget.config (new)
    Pipeline-only NuGet config that points at an internal feed. Used
    solely by a one-off `nuget install` of Microsoft.Build.Vcpkg, not by
    any csproj restore. Not consulted by external contributors or by
    GitHub Actions.

  .azure-pipelines/release.yml
    Add NuGetAuthenticate@1 task. Add a NuGetCommand@2 task that
    out-of-band installs the internal Microsoft.Build.Vcpkg package
    (which ships TerrapinRetrievalTool.exe) into $(Agent.TempDirectory).
    Add an explicit "Restore vcpkg native libraries (Terrapin cache)"
    step that invokes _RestoreVcpkgDependencies on GVFS.Common.csproj
    with -p:UseTerrapinAssetCache=true and TerrapinRetrievalToolPath
    pointing at the extracted tool. Build.bat's own vcpkg install step
    then skips because the libs are already present.

Assisted-by: Claude Opus 4.7
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
@tyrielv tyrielv force-pushed the tyrielv/release-pipeline-vcpkg-fix branch from 5014157 to 452e2fb Compare May 27, 2026 21:51
@tyrielv tyrielv requested a review from mjcheetham May 27, 2026 21:52
@tyrielv tyrielv marked this pull request as ready for review May 27, 2026 21:53
@tyrielv tyrielv enabled auto-merge May 27, 2026 21:53
@tyrielv tyrielv merged commit b65af3a into master May 27, 2026
55 checks passed
@dscho dscho deleted the tyrielv/release-pipeline-vcpkg-fix branch May 27, 2026 22:19
@tyrielv tyrielv mentioned this pull request May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants