Meta: Move the vcpkg installation/cache directories under Build

In addition to changing the build-type dependent build directories, we
can take this opportunity to move the vcpkg cache directory to the Build
folder itself. This probably isn't 100% needed, but it ensures that no
leftover artifacts are used from non-dynamic vcpkg builds, and it's also
generally nice to have all build artifacts under Build.
This commit is contained in:
Timothy Flynn 2024-09-30 12:55:24 -04:00 committed by Andrew Kaster
parent 4ffca2089e
commit 5681dbee64
Notes: github-actions[bot] 2024-11-06 17:40:12 +00:00
10 changed files with 16 additions and 23 deletions

View file

@ -5,7 +5,7 @@ on: [push]
env:
LADYBIRD_SOURCE_DIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
VCPKG_ROOT: ${{ github.workspace }}/Toolchain/Tarballs/vcpkg
VCPKG_ROOT: ${{ github.workspace }}/Build/vcpkg
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
jobs:

View file

@ -26,7 +26,7 @@ env:
# github.workspace = /home/runner/work/ladybird/ladybird
LADYBIRD_SOURCE_DIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
VCPKG_ROOT: ${{ github.workspace }}/Toolchain/Tarballs/vcpkg
VCPKG_ROOT: ${{ github.workspace }}/Build/vcpkg
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
# Use the compiler version for the ccache compiler hash. Otherwise, if plugins are enabled, the plugin .so files

View file

@ -4,7 +4,7 @@ on: [push]
env:
LADYBIRD_SOURCE_DIR: ${{ github.workspace }}
VCPKG_ROOT: ${{ github.workspace }}/Toolchain/Tarballs/vcpkg
VCPKG_ROOT: ${{ github.workspace }}/Build/vcpkg
jobs:
run_and_update_results:

View file

@ -10,7 +10,7 @@ env:
# github.workspace = /home/runner/work/ladybird/ladybird
LADYBIRD_SOURCE_DIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
VCPKG_ROOT: ${{ github.workspace }}/Toolchain/Tarballs/vcpkg
VCPKG_ROOT: ${{ github.workspace }}/Build/vcpkg
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
concurrency:

View file

@ -20,8 +20,8 @@
},
"environment": {
"LADYBIRD_SOURCE_DIR": "${fileDir}",
"VCPKG_ROOT": "${fileDir}/Toolchain/Tarballs/vcpkg",
"VCPKG_BINARY_SOURCES": "clear;files,${fileDir}/Toolchain/Build/vcpkg-binary-cache,readwrite;$penv{VCPKG_BINARY_SOURCES}"
"VCPKG_ROOT": "${fileDir}/Build/vcpkg",
"VCPKG_BINARY_SOURCES": "clear;files,${fileDir}/Build/caches/vcpkg-binary-cache,readwrite;$penv{VCPKG_BINARY_SOURCES}"
},
"vendor": {
"jetbrains.com/clion": {

View file

@ -42,6 +42,6 @@ When building with the Qt chrome on macOS, you may encounter the following messa
…followed by 14-line stack trace, the top of which is this:
> Toolchain/Tarballs/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
> Build/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
…and all of it shown in bright yellow, making you think it must be important and something must need to be fixed. But thats not the case. Instead, despite that, youll be able to build successfully with the Qt chrome.

View file

@ -37,10 +37,10 @@ cmake -S "${LADYBIRD_SOURCE_DIR}/Meta/Lagom" -B "$BUILD_DIR/lagom-tools" \
-DSERENITY_CACHE_DIR="$CACHE_DIR" \
-DLAGOM_TOOLS_ONLY=ON \
-DINSTALL_LAGOM_TOOLS=ON \
-DCMAKE_TOOLCHAIN_FILE="$LADYBIRD_SOURCE_DIR/Toolchain/Tarballs/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_TOOLCHAIN_FILE="$LADYBIRD_SOURCE_DIR/Build/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_INSTALL_OPTIONS="--no-print-usage" \
-DVCPKG_OVERLAY_TRIPLETS="$LADYBIRD_SOURCE_DIR/Meta/CMake/vcpkg/release-triplets" \
-DVCPKG_ROOT="$LADYBIRD_SOURCE_DIR/Toolchain/Tarballs/vcpkg" \
-DVCPKG_ROOT="$LADYBIRD_SOURCE_DIR/Build/vcpkg" \
-DVCPKG_MANIFEST_DIR="$LADYBIRD_SOURCE_DIR"
ninja -C "$BUILD_DIR/lagom-tools" install

View file

@ -40,7 +40,7 @@ android {
"-DLagomTools_DIR=$buildDir/lagom-tools-install/share/LagomTools",
"-DANDROID_STL=c++_shared",
"-DSERENITY_CACHE_DIR=$cacheDir",
"-DVCPKG_ROOT=$sourceDir/Toolchain/Tarballs/vcpkg",
"-DVCPKG_ROOT=$sourceDir/Build/vcpkg",
"-DVCPKG_TARGET_ANDROID=ON"
)
}

View file

@ -99,8 +99,8 @@ cmd_with_target() {
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=$LADYBIRD_SOURCE_DIR/Build/ladybird-install-${BUILD_PRESET}")
export PATH="$LADYBIRD_SOURCE_DIR/Toolchain/Local/cmake/bin:$LADYBIRD_SOURCE_DIR/Toolchain/Local/vcpkg/bin:$PATH"
export VCPKG_ROOT="$LADYBIRD_SOURCE_DIR/Toolchain/Tarballs/vcpkg"
export VCPKG_ROOT="${LADYBIRD_SOURCE_DIR}/Build/vcpkg"
export PATH="${LADYBIRD_SOURCE_DIR}/Toolchain/Local/cmake/bin:${VCPKG_ROOT}:${PATH}"
}
ensure_target() {

View file

@ -4,7 +4,6 @@ import os
import subprocess
import pathlib
import sys
import shutil
def main() -> int:
@ -13,12 +12,12 @@ def main() -> int:
git_repo = "https://github.com/microsoft/vcpkg.git"
git_rev = "10b7a178346f3f0abef60cecd5130e295afd8da4" # 2024.10.21
tarball_dir = script_dir / "Tarballs"
tarball_dir.mkdir(parents=True, exist_ok=True)
vcpkg_checkout = tarball_dir / "vcpkg"
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=tarball_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()
@ -34,12 +33,6 @@ def main() -> int:
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, shell=True)
install_dir = script_dir / "Local" / "vcpkg" / "bin"
install_dir.mkdir(parents=True, exist_ok=True)
vcpkg_name = "vcpkg.exe" if os.name == 'nt' else "vcpkg"
shutil.copy(vcpkg_checkout / vcpkg_name, install_dir / vcpkg_name)
return 0