Rename 'gitregistry' bundle to 'standalone' bundle, and install-vcpkg to vcpkg-init.
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -152,13 +152,13 @@ target_compile_definitions(vcpkglib PUBLIC
VCPKG_BASE_VERSION=${VCPKG_BASE_VERSION}
)
-if(NOT DEFINED VCPKG_READONLY_BUNDLE_SHA OR VCPKG_READONLY_BUNDLE_SHA STREQUAL "")
+if(NOT DEFINED VCPKG_STANDALONE_BUNDLE_SHA OR VCPKG_STANDALONE_BUNDLE_SHA STREQUAL "")
if(VCPKG_OFFICIAL_BUILD)
- message(FATAL_ERROR "VCPKG_READONLY_BUNDLE_SHA is required for official builds.")
+ message(FATAL_ERROR "VCPKG_STANDALONE_BUNDLE_SHA is required for official builds.")
endif()
else()
target_compile_definitions(vcpkglib PUBLIC
- VCPKG_READONLY_BUNDLE_SHA=${VCPKG_READONLY_BUNDLE_SHA}
+ VCPKG_STANDALONE_BUNDLE_SHA=${VCPKG_STANDALONE_BUNDLE_SHA}
)
endif()

MODIFY
azure-pipelines/arch-independent-signing.signproj
azure-pipelines/arch-independent-signing.signproj
<FilesToSign Include="$(IntermediateOutputPath)\vcpkg-ce\**\node_modules\**\*.js">
<Authenticode>3PartyScriptsSHA2</Authenticode>
</FilesToSign>
- <FilesToSign Include="$(IntermediateOutputPath)\install-vcpkg.ps1">
+ <FilesToSign Include="$(IntermediateOutputPath)\vcpkg-init.ps1">
<Authenticode>Microsoft400</Authenticode>
</FilesToSign>
</ItemGroup>

MODIFY
azure-pipelines/pipelines.yml
azure-pipelines/pipelines.yml
@@ -9,7 +9,7 @@ jobs:
steps:
- bash: |
git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" -n
- git -C "$VCPKG_ROOT" checkout `cat install-vcpkg/vcpkg-scripts-sha.txt`
+ git -C "$VCPKG_ROOT" checkout `cat vcpkg-init/vcpkg-scripts-sha.txt`
displayName: "Clone vcpkg repo to serve as root"
- bash: |
export CXXFLAGS="-fprofile-arcs -ftest-coverage -fPIC -O0"
@@ -57,7 +57,7 @@ jobs:
steps:
- bash: |
git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" -n
- git -C "$VCPKG_ROOT" checkout `cat install-vcpkg/vcpkg-scripts-sha.txt`
+ git -C "$VCPKG_ROOT" checkout `cat vcpkg-init/vcpkg-scripts-sha.txt`
displayName: "Clone vcpkg repo to serve as root"
- bash: |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -B build.amd64.debug
@@ -106,7 +106,7 @@ jobs:
pwsh: true
targetType: inline
script: |
- $sha = (Get-Content install-vcpkg/vcpkg-scripts-sha.txt -Raw).Trim()
+ $sha = (Get-Content vcpkg-init/vcpkg-scripts-sha.txt -Raw).Trim()
git clone https://github.com/microsoft/vcpkg $env:VCPKG_ROOT -n
git -C "$env:VCPKG_ROOT" checkout $sha
- task: CmdLine@2

MODIFY
azure-pipelines/signing.yml
azure-pipelines/signing.yml
@@ -53,7 +53,7 @@ jobs:
displayName: 'Lock Installer Scripts Versions'
inputs:
pwsh: true
- filePath: install-vcpkg/lock-versions.ps1
+ filePath: vcpkg-init/lock-versions.ps1
arguments: '-Destination "$(Build.BinariesDirectory)" -VcpkgBaseVersion $(VCPKG_BASE_VERSION)'
# Build and test vcpkg-ce
- task: PowerShell@2
@@ -128,27 +128,23 @@ jobs:
msbuildArguments: '/p:OutDir=$(Build.BinariesDirectory)\ /p:IntermediateOutputPath=$(Build.BinariesDirectory)\'
# Note that signing must happen before packing step because the packs contain files that are themselves signed.
- script: |
- copy "$(Build.BinariesDirectory)\install-vcpkg.ps1" "$(Build.BinariesDirectory)\install-vcpkg.cmd"
- copy "$(Build.BinariesDirectory)\install-vcpkg.ps1" "$(Build.BinariesDirectory)\vcpkg.ps1"
- copy "$(Build.BinariesDirectory)\install-vcpkg.ps1" "$(Build.BinariesDirectory)\vcpkg.cmd"
+ copy "$(Build.BinariesDirectory)\vcpkg-init.ps1" "$(Build.BinariesDirectory)\vcpkg-init.cmd"
displayName: 'Duplicate Install Scripts'
- task: Powershell@2
- displayName: 'Build vcpkg-gitregistry-bundle.tar.gz'
+ displayName: 'Build vcpkg-standalone-bundle.tar.gz'
inputs:
pwsh: true
- filePath: install-vcpkg/mint-gitregistry-bundle.ps1
- arguments: '-DestinationTarballName "$(Build.BinariesDirectory)\vcpkg-gitregistry-bundle.tar.gz" -TempPath gitregistry-temp "$(Build.BinariesDirectory)\vcpkg.cmd" "$(Build.BinariesDirectory)\vcpkg.ps1"'
+ filePath: vcpkg-init/mint-standalone-bundle.ps1
+ arguments: '-DestinationTarballName "$(Build.BinariesDirectory)\vcpkg-standalone-bundle.tar.gz" -TempPath standalone-temp "$(Build.BinariesDirectory)\vcpkg-init.cmd" "$(Build.BinariesDirectory)\vcpkg-init.ps1"'
- script: npm pack
displayName: Create vcpkg-ce Pack
workingDirectory: $(Build.BinariesDirectory)/vcpkg-ce
- script: |
mkdir "$(Build.ArtifactStagingDirectory)\staging"
move "$(Build.BinariesDirectory)\vcpkg-ce\vcpkg-ce-*.tgz" "$(Build.ArtifactStagingDirectory)\staging\vcpkg-ce.tgz"
- move "$(Build.BinariesDirectory)\vcpkg-gitregistry-bundle.tar.gz" "$(Build.ArtifactStagingDirectory)\staging\vcpkg-gitregistry-bundle.tar.gz"
- move "$(Build.BinariesDirectory)\install-vcpkg.ps1" "$(Build.ArtifactStagingDirectory)\staging\install-vcpkg.ps1"
- move "$(Build.BinariesDirectory)\install-vcpkg.cmd" "$(Build.ArtifactStagingDirectory)\staging\install-vcpkg.cmd"
- move "$(Build.BinariesDirectory)\vcpkg.ps1" "$(Build.ArtifactStagingDirectory)\staging\vcpkg.ps1"
- move "$(Build.BinariesDirectory)\vcpkg.cmd" "$(Build.ArtifactStagingDirectory)\staging\vcpkg.cmd"
+ move "$(Build.BinariesDirectory)\vcpkg-standalone-bundle.tar.gz" "$(Build.ArtifactStagingDirectory)\staging\vcpkg-standalone-bundle.tar.gz"
+ move "$(Build.BinariesDirectory)\vcpkg-init.ps1" "$(Build.ArtifactStagingDirectory)\staging\vcpkg-init.ps1"
+ move "$(Build.BinariesDirectory)\vcpkg-init.cmd" "$(Build.ArtifactStagingDirectory)\staging\vcpkg-init.cmd"
displayName: 'Arrange Architecture-independent Files for Staging'
- task: Powershell@2
displayName: Generate Arch-independent SHA512s
@@ -157,8 +153,8 @@ jobs:
pwsh: true
targetType: 'inline'
script: |
- $gitregistryBundleSha = (Get-FileHash "$(Build.ArtifactStagingDirectory)\staging\vcpkg-gitregistry-bundle.tar.gz" -Algorithm SHA512).Hash.ToLowerInvariant()
- Write-Host "##vso[task.setvariable variable=VCPKG_GITREGISTRY_BUNDLE_SHA;isOutput=true]$gitregistryBundleSha"
+ $standaloneBundleSha = (Get-FileHash "$(Build.ArtifactStagingDirectory)\staging\vcpkg-standalone-bundle.tar.gz" -Algorithm SHA512).Hash.ToLowerInvariant()
+ Write-Host "##vso[task.setvariable variable=VCPKG_STANDALONE_BUNDLE_SHA;isOutput=true]$standaloneBundleSha"
$ceSha = (Get-FileHash "$(Build.ArtifactStagingDirectory)\staging\vcpkg-ce.tgz" -Algorithm SHA512).Hash.ToLowerInvariant()
Write-Host "##vso[task.setvariable variable=VCPKG_CE_SHA;isOutput=true]$ceSha"
- task: PublishBuildArtifacts@1
@@ -174,7 +170,7 @@ jobs:
pool:
vmImage: macOS-11
variables:
- VCPKG_GITREGISTRY_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_GITREGISTRY_BUNDLE_SHA'] ]
+ VCPKG_STANDALONE_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_STANDALONE_BUNDLE_SHA'] ]
VCPKG_CE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_CE_SHA'] ]
steps:
- task: CmdLine@2
@@ -192,7 +188,7 @@ jobs:
inputs:
failOnStderr: true
script: |
- cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)/$FMT_TARBALL_DIRNAME" -DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION -DVCPKG_GITREGISTRY_BUNDLE_SHA=$VCPKG_GITREGISTRY_BUNDLE_SHA -DVCPKG_CE_SHA=$VCPKG_CE_SHA -B "$(Build.BinariesDirectory)/build"
+ cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)/$FMT_TARBALL_DIRNAME" -DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION -DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA -DVCPKG_CE_SHA=$VCPKG_CE_SHA -B "$(Build.BinariesDirectory)/build"
make -j 8 -C "$(Build.BinariesDirectory)/build"
zip -j "$(Build.ArtifactStagingDirectory)/vcpkg-macos.zip" "$(Build.BinariesDirectory)/build/vcpkg"
- task: PublishBuildArtifacts@1
@@ -207,7 +203,7 @@ jobs:
pool:
name: 'vcpkg-rhel-7-5'
variables:
- VCPKG_GITREGISTRY_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_GITREGISTRY_BUNDLE_SHA'] ]
+ VCPKG_STANDALONE_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_STANDALONE_BUNDLE_SHA'] ]
VCPKG_CE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_CE_SHA'] ]
steps:
- task: CmdLine@2
@@ -226,7 +222,7 @@ jobs:
inputs:
failOnStderr: true
script: |
- scl enable devtoolset-9 'cmake3 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)/$FMT_TARBALL_DIRNAME" -DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION -DVCPKG_GITREGISTRY_BUNDLE_SHA=$VCPKG_GITREGISTRY_BUNDLE_SHA -DVCPKG_CE_SHA=$VCPKG_CE_SHA -B "$(Build.BinariesDirectory)/build"'
+ scl enable devtoolset-9 'cmake3 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)/$FMT_TARBALL_DIRNAME" -DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION -DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA -DVCPKG_CE_SHA=$VCPKG_CE_SHA -B "$(Build.BinariesDirectory)/build"'
make -j 4 -C "$(Build.BinariesDirectory)/build"
mv "$(Build.BinariesDirectory)/build/vcpkg" "$(Build.ArtifactStagingDirectory)/vcpkg-glibc"
- task: PublishBuildArtifacts@1
@@ -241,7 +237,7 @@ jobs:
dependsOn:
- arch_independent
variables:
- VCPKG_GITREGISTRY_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_GITREGISTRY_BUNDLE_SHA'] ]
+ VCPKG_STANDALONE_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_STANDALONE_BUNDLE_SHA'] ]
VCPKG_CE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_CE_SHA'] ]
steps:
- task: CmdLine@2
@@ -280,7 +276,7 @@ jobs:
pool:
name: 'VSEngSS-MicroBuild2022-1ES'
variables:
- VCPKG_GITREGISTRY_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_GITREGISTRY_BUNDLE_SHA'] ]
+ VCPKG_STANDALONE_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_STANDALONE_BUNDLE_SHA'] ]
VCPKG_CE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_CE_SHA'] ]
steps:
- task: PowerShell@2
@@ -306,7 +302,7 @@ jobs:
script: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86
cmake.exe --version
- cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)\%FMT_TARBALL_DIRNAME%" -DVCPKG_BASE_VERSION=%VCPKG_BASE_VERSION% -DVCPKG_GITREGISTRY_BUNDLE_SHA=%VCPKG_GITREGISTRY_BUNDLE_SHA% -DVCPKG_CE_SHA=%VCPKG_CE_SHA% -B "$(Build.BinariesDirectory)\x86"
+ cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)\%FMT_TARBALL_DIRNAME%" -DVCPKG_BASE_VERSION=%VCPKG_BASE_VERSION% -DVCPKG_STANDALONE_BUNDLE_SHA=%VCPKG_STANDALONE_BUNDLE_SHA% -DVCPKG_CE_SHA=%VCPKG_CE_SHA% -B "$(Build.BinariesDirectory)\x86"
ninja.exe -C "$(Build.BinariesDirectory)\x86"
- task: CmdLine@2
displayName: "Build vcpkg arm64 with CMake"
@@ -315,7 +311,7 @@ jobs:
script: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=x86
cmake.exe --version
- cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DVCPKG_PDB_SUFFIX="-arm64" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)\%FMT_TARBALL_DIRNAME%" -DVCPKG_BASE_VERSION=%VCPKG_BASE_VERSION% -DVCPKG_GITREGISTRY_BUNDLE_SHA=%VCPKG_GITREGISTRY_BUNDLE_SHA% -DVCPKG_CE_SHA=%VCPKG_CE_SHA% -B "$(Build.BinariesDirectory)\arm64"
+ cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DVCPKG_PDB_SUFFIX="-arm64" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)\%FMT_TARBALL_DIRNAME%" -DVCPKG_BASE_VERSION=%VCPKG_BASE_VERSION% -DVCPKG_STANDALONE_BUNDLE_SHA=%VCPKG_STANDALONE_BUNDLE_SHA% -DVCPKG_CE_SHA=%VCPKG_CE_SHA% -B "$(Build.BinariesDirectory)\arm64"
ninja.exe -C "$(Build.BinariesDirectory)\arm64"
- task: MicroBuildSigningPlugin@3
displayName: Install MicroBuild Signing
@@ -376,12 +372,12 @@ jobs:
script: |
mkdir "$(Build.ArtifactStagingDirectory)\drop"
- move "$(Build.ArtifactStagingDirectory)\staging\install-vcpkg.cmd" "$(Build.ArtifactStagingDirectory)\drop\install-vcpkg.cmd"
- move "$(Build.ArtifactStagingDirectory)\staging\install-vcpkg.ps1" "$(Build.ArtifactStagingDirectory)\drop\install-vcpkg.ps1"
+ move "$(Build.ArtifactStagingDirectory)\staging\vcpkg-init.cmd" "$(Build.ArtifactStagingDirectory)\drop\vcpkg-init.cmd"
+ move "$(Build.ArtifactStagingDirectory)\staging\vcpkg-init.ps1" "$(Build.ArtifactStagingDirectory)\drop\vcpkg-init.ps1"
move "$(Build.ArtifactStagingDirectory)\staging\vcpkg-ce.tgz" "$(Build.ArtifactStagingDirectory)\drop\vcpkg-ce.tgz"
move "$(Build.ArtifactStagingDirectory)\staging\vcpkg-glibc" "$(Build.ArtifactStagingDirectory)\drop\vcpkg-glibc"
move "$(Build.ArtifactStagingDirectory)\staging\vcpkg-muslc" "$(Build.ArtifactStagingDirectory)\drop\vcpkg-muslc"
- move "$(Build.ArtifactStagingDirectory)\staging\vcpkg-gitregistry-bundle.tar.gz" "$(Build.ArtifactStagingDirectory)\drop\vcpkg-gitregistry-bundle.tar.gz"
+ move "$(Build.ArtifactStagingDirectory)\staging\vcpkg-standalone-bundle.tar.gz" "$(Build.ArtifactStagingDirectory)\drop\vcpkg-standalone-bundle.tar.gz"
move "$(Build.BinariesDirectory)\x86\vcpkg.exe" "$(Build.ArtifactStagingDirectory)\drop\vcpkg.exe"
move "$(Build.BinariesDirectory)\x86\vcpkg.pdb" "$(Build.ArtifactStagingDirectory)\drop\vcpkg.pdb"

RENAME
include/vcpkg/commands.zbootstrap-readonly.h
include/vcpkg/commands.zbootstrap-standalone.h
namespace vcpkg::Commands
{
- struct BootstrapReadonlyCommand : BasicCommand
+ struct BootstrapStandaloneCommand : BasicCommand
{
virtual void perform_and_exit(const VcpkgCmdArguments& args, Filesystem& fs) const override;
};

MODIFY
src/vcpkg-test/commands.cpp
src/vcpkg-test/commands.cpp
@@ -80,7 +80,7 @@ TEST_CASE ("list of commands is correct", "[commands]")
"z-ce",
"x-check-support",
"z-print-config",
- "z-bootstrap-readonly",
+ "z-bootstrap-standalone",
#if defined(_WIN32)
"x-upload-metrics",
#endif // defined(_WIN32)

MODIFY
src/vcpkg/commands.cpp
src/vcpkg/commands.cpp
#include <vcpkg/commands.version.h>
#include <vcpkg/commands.xdownload.h>
#include <vcpkg/commands.xvsinstances.h>
-#include <vcpkg/commands.zbootstrap-readonly.h>
+#include <vcpkg/commands.zbootstrap-standalone.h>
#include <vcpkg/commands.zce.h>
#include <vcpkg/commands.zprintconfig.h>
#include <vcpkg/export.h>
@@ -57,7 +57,7 @@ namespace vcpkg::Commands
static const X_Download::XDownloadCommand xdownload{};
static const GenerateDefaultMessageMapCommand generate_message_map{};
static const Hash::HashCommand hash{};
- static const BootstrapReadonlyCommand zboostrap_readonly{};
+ static const BootstrapStandaloneCommand zboostrap_standalone{};
#if defined(_WIN32)
static const UploadMetrics::UploadMetricsCommand upload_metrics{};
#endif // defined(_WIN32)
@@ -69,7 +69,7 @@ namespace vcpkg::Commands
{"x-init-registry", &init_registry},
{"x-download", &xdownload},
{"x-generate-default-message-map", &generate_message_map},
- {"z-bootstrap-readonly", &zboostrap_readonly},
+ {"z-bootstrap-standalone", &zboostrap_standalone},
#if defined(_WIN32)
{"x-upload-metrics", &upload_metrics},
#endif // defined(_WIN32)

RENAME
src/vcpkg/commands.zbootstrap-readonly.cpp
src/vcpkg/commands.zbootstrap-standalone.cpp
#include <vcpkg/archives.h>
#include <vcpkg/commands.version.h>
-#include <vcpkg/commands.zbootstrap-readonly.h>
+#include <vcpkg/commands.zbootstrap-standalone.h>
#include <vcpkg/tools.h>
#include <vcpkg/vcpkgcmdarguments.h>
namespace vcpkg::Commands
{
static const CommandStructure COMMAND_STRUCTURE = {
- create_example_string("z-bootstrap-readonly"),
+ create_example_string("z-bootstrap-standalone"),
0,
0,
{{}, {}},
nullptr,
};
- void BootstrapReadonlyCommand::perform_and_exit(const VcpkgCmdArguments& args, Filesystem& fs) const
+ void BootstrapStandaloneCommand::perform_and_exit(const VcpkgCmdArguments& args, Filesystem& fs) const
{
DownloadManager download_manager{{}};
const auto& vcpkg_root_arg = args.vcpkg_root_dir;
if (!vcpkg_root_arg)
{
- Checks::exit_with_message(VCPKG_LINE_INFO, "Setting VCPKG_ROOT is required for readonly bootstrap.\n");
+ Checks::exit_with_message(VCPKG_LINE_INFO, "Setting VCPKG_ROOT is required for standalone bootstrap.\n");
}
const auto& vcpkg_root = fs.almost_canonical(*vcpkg_root_arg, VCPKG_LINE_INFO);
fs.create_directories(vcpkg_root, VCPKG_LINE_INFO);
- const auto bundle_tarball = vcpkg_root / "vcpkg-gitregistry-bundle.tar.gz";
-#if defined(VCPKG_READONLY_BUNDLE_SHA)
- print2("Downloading vcpkg readonly root bundle " VCPKG_BASE_VERSION_AS_STRING "\n");
+ const auto bundle_tarball = vcpkg_root / "vcpkg-standalone-bundle.tar.gz";
+#if defined(VCPKG_STANDALONE_BUNDLE_SHA)
+ print2("Downloading vcpkg standlone bundle " VCPKG_BASE_VERSION_AS_STRING "\n");
const auto bundle_uri =
"https://github.com/microsoft/vcpkg-tool/releases/download/" VCPKG_BASE_VERSION_AS_STRING
- "/vcpkg-gitregistry-bundle.tar.gz";
+ "/vcpkg-standalone-bundle.tar.gz";
download_manager.download_file(
- fs, bundle_uri, bundle_tarball, std::string(MACRO_TO_STRING(VCPKG_READONLY_BUNDLE_SHA)));
-#else // ^^^ VCPKG_READONLY_BUNDLE_SHA / !VCPKG_READONLY_BUNDLE_SHA vvv
- print2(Color::warning, "Downloading latest readonly bundle\n");
+ fs, bundle_uri, bundle_tarball, std::string(MACRO_TO_STRING(VCPKG_STANDALONE_BUNDLE_SHA)));
+#else // ^^^ VCPKG_STANDALONE_BUNDLE_SHA / !VCPKG_STANDALONE_BUNDLE_SHA vvv
+ print2(Color::warning, "Downloading latest standalone bundle\n");
const auto bundle_uri =
- "https://github.com/microsoft/vcpkg-tool/releases/latest/download/vcpkg-gitregistry-bundle.tar.gz";
+ "https://github.com/microsoft/vcpkg-tool/releases/latest/download/vcpkg-standalone-bundle.tar.gz";
download_manager.download_file(fs, bundle_uri, bundle_tarball, nullopt);
-#endif // ^^^ !VCPKG_READONLY_BUNDLE_SHA
+#endif // ^^^ !VCPKG_STANDALONE_BUNDLE_SHA
auto tool_cache = get_tool_cache(RequireExactVersions::NO);
const auto tar = tool_cache->get_tool_path_from_system(fs, Tools::TAR);

RENAME
install-vcpkg/lock-versions.ps1
vcpkg-init/lock-versions.ps1
@@ -8,6 +8,6 @@ Param(
$versionUnlockedUri = "https://github.com/microsoft/vcpkg-tool/releases/latest/download/"
$versionLockedUri = "https://github.com/microsoft/vcpkg-tool/releases/download/$VcpkgBaseVersion/"
-$pwshInstaller = Get-Content "$PSScriptRoot\install-vcpkg.ps1" -Raw
+$pwshInstaller = Get-Content "$PSScriptRoot\vcpkg-init.ps1" -Raw
$pwshInstaller = $pwshInstaller.Replace($versionUnlockedUri, $versionLockedUri)
-Set-Content -Path "$Destination\install-vcpkg.ps1" -Value $pwshInstaller
+Set-Content -Path "$Destination\vcpkg-init.ps1" -Value $pwshInstaller

RENAME
install-vcpkg/mint-gitregistry-bundle.ps1
vcpkg-init/mint-standalone-bundle.ps1
RENAME
install-vcpkg/install-vcpkg.ps1
vcpkg-init/vcpkg-init.ps1
@@ -20,7 +20,7 @@ $args=[System.Collections.ArrayList][System.Array]$args
# GLOBALS
$VCPKG_START_TIME=get-date
-function resolve([string]$name) {
+function z-vcpkg-resolve([string]$name) {
$name = Resolve-Path $name -ErrorAction 0 -ErrorVariable _err
if (-not($name)) { return $_err[0].TargetObject }
$Error.clear()
@@ -29,7 +29,7 @@ function resolve([string]$name) {
$SCRIPT:DEBUG=( $args.indexOf('--debug') -gt -1 )
-function vcpkg-debug() {
+function z-vcpkg-debug() {
$t = [int32]((get-date).Subtract(($VCPKG_START_TIME)).ticks/10000)
if($SCRIPT:DEBUG) {
write-host -fore green "[$t msec] " -nonewline
@@ -48,31 +48,31 @@ function download($url, $path) {
$s.Dispose()
if( (get-item $path).Length -eq $len ){
$wc.Dispose();
- vcpkg-debug "skipping download of '$url' - '$path' is ok."
+ z-vcpkg-debug "skipping download of '$url' - '$path' is ok."
return $path;
}
}
- vcpkg-debug "Downloading '$url' -> '$path'"
+ z-vcpkg-debug "Downloading '$url' -> '$path'"
$wc.DownloadFile($url, $path);
$wc.Dispose();
if( (get-item $path).Length -ne $wc.ResponseHeaders['Content-Length'] ) {
throw "Download of '$url' failed. Check your internet connection."
}
- vcpkg-debug "Completed Download of $url"
+ z-vcpkg-debug "Completed Download of $url"
return $path
}
# set the home path.
if( $ENV:VCPKG_ROOT ) {
- $SCRIPT:VCPKG_ROOT=(resolve $ENV:VCPKG_ROOT)
+ $SCRIPT:VCPKG_ROOT=(z-vcpkg-resolve $ENV:VCPKG_ROOT)
$ENV:VCPKG_ROOT=$VCPKG_ROOT
} else {
- $SCRIPT:VCPKG_ROOT=(resolve "$HOME/.vcpkg")
+ $SCRIPT:VCPKG_ROOT=(z-vcpkg-resolve "$HOME/.vcpkg")
$ENV:VCPKG_ROOT=$VCPKG_ROOT
}
$VCPKG = "${VCPKG_ROOT}/vcpkg.exe"
-$SCRIPT:VCPKG_SCRIPT = "${VCPKG_ROOT}/vcpkg.ps1"
+$SCRIPT:VCPKG_SCRIPT = "${VCPKG_ROOT}/vcpkg-init.ps1"
$reset = $args.IndexOf('--reset-vcpkg') -gt -1
$remove = $args.IndexOf('--remove-vcpkg') -gt -1
@@ -105,12 +105,12 @@ function bootstrap-vcpkg {
}
download https://github.com/microsoft/vcpkg-tool/releases/latest/download/vcpkg.exe $VCPKG
- & $VCPKG z-bootstrap-readonly
+ & $VCPKG z-bootstrap-standalone
$PATH = $ENV:PATH
$ENV:PATH="$VCPKG_ROOT;$PATH"
- vcpkg-debug "Bootstrapped vcpkg: ${VCPKG_ROOT}"
+ z-vcpkg-debug "Bootstrapped vcpkg: ${VCPKG_ROOT}"
if( -not ( test-path $VCPKG_SCRIPT )) {
Write-Error "ERROR! Bootstrapping vcpkg failed."
@@ -128,7 +128,7 @@ if( -not (bootstrap-vcpkg )) {
$shh = New-Module -name vcpkg -ArgumentList @($VCPKG,$VCPKG_ROOT) -ScriptBlock {
param($VCPKG,$VCPKG_ROOT)
- function resolve([string]$name) {
+ function z-vcpkg-resolve([string]$name) {
$name = Resolve-Path $name -ErrorAction 0 -ErrorVariable _err
if (-not($name)) { return $_err[0].TargetObject }
$Error.clear()
@@ -147,13 +147,13 @@ $shh = New-Module -name vcpkg -ArgumentList @($VCPKG,$VCPKG_ROOT) -ScriptBlock {
if( -not (test-path $VCPKG )) {
write-error "vcpkg is not installed."
write-host -nonewline "You can reinstall vcpkg by running "
- write-host -fore green "iex (iwr -useb https://aka.ms/install-vcpkg.ps1)"
+ write-host -fore green "iex (iwr -useb https://aka.ms/vcpkg-init.ps1)"
return
}
# setup the postscript file
# Generate 31 bits of randomness, to avoid clashing with concurrent executions.
- $env:Z_VCPKG_POSTSCRIPT = resolve "${VCPKG_ROOT}/VCPKG_tmp_$(Get-Random -SetSeed $PID).ps1"
+ $env:Z_VCPKG_POSTSCRIPT = z-vcpkg-resolve "${VCPKG_ROOT}/VCPKG_tmp_$(Get-Random -SetSeed $PID).ps1"
& $VCPKG @args
@@ -169,7 +169,11 @@ $shh = New-Module -name vcpkg -ArgumentList @($VCPKG,$VCPKG_ROOT) -ScriptBlock {
}
}
+if ($args.Length -ne 0) {
return vcpkg @args
+}
+
+return 0
<#
:set
set ARGZ[%i%]=%1&set /a i+=1 & goto :eof

RENAME
install-vcpkg/vcpkg-scripts-sha.txt
vcpkg-init/vcpkg-scripts-sha.txt
Rename 'gitregistry' bundle to 'standalone' bundle, and install-vcpkg to vcpkg-init.