|
32 | 32 | <_VcpkgManifestFile>$(RepoSrcPath)vcpkg.json</_VcpkgManifestFile> |
33 | 33 | <_VcpkgConfigFile>$(RepoSrcPath)vcpkg-configuration.json</_VcpkgConfigFile> |
34 | 34 | <_VcpkgStampFile>$(RepoOutPath)vcpkg_installed\.msbuildstamp</_VcpkgStampFile> |
| 35 | + |
| 36 | + <!-- |
| 37 | + Terrapin asset caching for vcpkg downloads (only when explicitly |
| 38 | + enabled by the release pipeline). -a $(IsLocalBuild) controls whether |
| 39 | + the retrieval script may upload missing assets back to the Terrapin |
| 40 | + cache: true on dev boxes (write permission available), false on CI |
| 41 | + agents (read-only; x-block-origin causes immediate failure rather |
| 42 | + than attempting public-internet downloads). |
| 43 | +
|
| 44 | + $(TerrapinRetrievalToolPath) is supplied by the release pipeline |
| 45 | + after it downloads the internal Microsoft.Build.Vcpkg NuGet package |
| 46 | + that ships the retrieval tool. The repo intentionally does not |
| 47 | + reference that internal package directly; the pipeline is the only |
| 48 | + bridge between this repo and the internal feed. |
| 49 | + --> |
| 50 | + <_VcpkgAssetSources Condition="'$(UseTerrapinAssetCache)' == 'true'">"--x-asset-sources=x-script,$(TerrapinRetrievalToolPath) -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a $(IsLocalBuild) -p {url} -s {sha512} -d {dst};x-block-origin"</_VcpkgAssetSources> |
35 | 51 | </PropertyGroup> |
36 | 52 |
|
37 | 53 | <ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'"> |
|
70 | 86 | <Message Importance="high" Text="[vcpkg] Installing native dependencies to $(RepoOutPath)vcpkg_installed\" /> |
71 | 87 |
|
72 | 88 | <MakeDir Directories="$(RepoOutPath)vcpkg_installed\" /> |
73 | | - <Exec Command=""$(_VcpkgExe)" install --x-wait-for-lock --triplet x64-windows-static-aot --x-install-root="$(RepoOutPath)vcpkg_installed\static" $(_VcpkgManifestArg)" |
| 89 | + |
| 90 | + <!-- |
| 91 | + Guard: if asset caching was requested but the tool path was not |
| 92 | + supplied, the asset-source string would be malformed and vcpkg |
| 93 | + would fail with a confusing error. Surface the misconfiguration up |
| 94 | + front. |
| 95 | + --> |
| 96 | + <Error Condition="'$(UseTerrapinAssetCache)' == 'true' and ('$(TerrapinRetrievalToolPath)' == '' or !Exists('$(TerrapinRetrievalToolPath)'))" |
| 97 | + Text="UseTerrapinAssetCache=true but TerrapinRetrievalToolPath is empty or does not exist. The release pipeline must pre-download the Microsoft.Build.Vcpkg NuGet package and pass -p:TerrapinRetrievalToolPath=<path-to-TerrapinRetrievalTool.exe>." /> |
| 98 | + |
| 99 | + <Exec Command=""$(_VcpkgExe)" install --x-wait-for-lock --triplet x64-windows-static-aot --x-install-root="$(RepoOutPath)vcpkg_installed\static" $(_VcpkgManifestArg) $(_VcpkgAssetSources)" |
74 | 100 | StandardOutputImportance="High" StandardErrorImportance="High" /> |
75 | | - <Exec Command=""$(_VcpkgExe)" install --x-wait-for-lock --triplet x64-windows-dynamic --x-install-root="$(RepoOutPath)vcpkg_installed\dynamic" $(_VcpkgManifestArg)" |
| 101 | + <Exec Command=""$(_VcpkgExe)" install --x-wait-for-lock --triplet x64-windows-dynamic --x-install-root="$(RepoOutPath)vcpkg_installed\dynamic" $(_VcpkgManifestArg) $(_VcpkgAssetSources)" |
76 | 102 | StandardOutputImportance="High" StandardErrorImportance="High" /> |
77 | 103 |
|
78 | 104 | <Error Condition="!Exists('$(RepoOutPath)vcpkg_installed\dynamic\x64-windows-dynamic\bin\git2.dll')" |
79 | | - Text="vcpkg install completed but expected output files are missing. Check vcpkg output above for errors." /> |
| 105 | + Text="vcpkg install completed but git2.dll (dynamic) is missing. Check vcpkg output above for errors." /> |
| 106 | + <Error Condition="!Exists('$(RepoOutPath)vcpkg_installed\static\x64-windows-static-aot\lib\git2.lib')" |
| 107 | + Text="vcpkg install completed but git2.lib (static) is missing. Check vcpkg output above for errors." /> |
80 | 108 |
|
81 | 109 | <Touch Files="$(_VcpkgStampFile)" AlwaysCreate="true" /> |
82 | 110 | </Target> |
|
0 commit comments