Browse Source

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.
Timothy Flynn 6 months ago
parent
commit
5681dbee64

+ 1 - 1
.github/workflows/ladybird-js-artifacts.yml

@@ -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:

+ 1 - 1
.github/workflows/lagom-template.yml

@@ -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

+ 1 - 1
.github/workflows/libjs-test262.yml

@@ -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:

+ 1 - 1
.github/workflows/nightly-android.yml

@@ -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:

+ 2 - 2
CMakePresets.json

@@ -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": {

+ 1 - 1
Documentation/Troubleshooting.md

@@ -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 that’s not the case. Instead, despite that, you’ll be able to build successfully with the Qt chrome.

+ 2 - 2
Ladybird/Android/BuildLagomTools.sh

@@ -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

+ 1 - 1
Ladybird/Android/build.gradle.kts

@@ -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"
                 )
             }

+ 2 - 2
Meta/ladybird.sh

@@ -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() {

+ 4 - 11
Toolchain/BuildVcpkg.py

@@ -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