ladybird/Toolchain/BuildVcpkg.py
0GreenClover0 c286d38765
Some checks failed
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Build Dev Container Image / build (push) Has been cancelled
Meta: Update vcpkg to latest master
Includes a fix for vcpkg git commands not working in git versions
below 2.35.
2025-04-12 19:14:58 -06:00

40 lines
1.2 KiB
Python
Executable file

#!/usr/bin/env python3
import os
import subprocess
import pathlib
import sys
def main() -> int:
script_dir = pathlib.Path(__file__).parent.resolve()
git_repo = "https://github.com/microsoft/vcpkg.git"
git_rev = "bc994510d2eb11aac7b43b03f67a7751d5bfe0e4" # main on 2025-04-12
build_dir = script_dir.parent / "Build"
build_dir.mkdir(parents=True, exist_ok=True)
vcpkg_checkout = build_dir / "vcpkg"
if not vcpkg_checkout.is_dir():
subprocess.check_call(args=["git", "clone", git_repo], cwd=build_dir)
else:
bootstrapped_vcpkg_version = subprocess.check_output(
["git", "-C", vcpkg_checkout, "rev-parse", "HEAD"]).strip().decode()
if bootstrapped_vcpkg_version == git_rev:
return 0
print(f"Building vcpkg@{git_rev}")
subprocess.check_call(args=["git", "fetch", "origin"], cwd=vcpkg_checkout)
subprocess.check_call(args=["git", "checkout", git_rev], cwd=vcpkg_checkout)
bootstrap_script = "bootstrap-vcpkg.bat" if os.name == 'nt' else "bootstrap-vcpkg.sh"
subprocess.check_call(args=[vcpkg_checkout / bootstrap_script, "-disableMetrics"], cwd=vcpkg_checkout)
return 0
if __name__ == "__main__":
sys.exit(main())