diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index d81f5baae..f606a442d 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -4,6 +4,7 @@ self-hosted-runner: labels: - warp-ubuntu-latest-x64-8x + - warp-ubuntu-latest-arm64-16x - warp-windows-latest-x64-16x - warp-windows-2025-vs2026-x64-16x - warp-macos-26-arm64-6x diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index af6f79272..a96f609d9 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,9 +20,12 @@ jobs: # Linux: one native package per distro, each built INSIDE that # distro's container so the declared dependencies always resolve to # the distro's own package names (dpkg-shlibdeps / rpmbuild - # auto-requires / Arch static base list). deb: hand-rolled dpkg-deb; - # rpm: rpmbuild; arch: makepkg. AppImage stays on the Ubuntu runner - # (self-contained by design). + # auto-requires / Arch static base list). The FFmpeg/codec libraries + # come from the vcpkg manifest (root vcpkg.json, x64-linux triplet), so + # these containers carry the build toolchain and the headless/UI + # runtime deps only. deb: hand-rolled dpkg-deb; rpm: rpmbuild; arch: + # makepkg. AppImage stays on the Ubuntu runner (self-contained by + # design). # ------------------------------------------------------------------ linux: name: Linux packages (${{ matrix.distro }}) @@ -63,53 +66,75 @@ jobs: run: | case "${{ matrix.distro }}" in debian) + apt-get update apt-get install -y \ - build-essential cmake pkg-config nasm dpkg-dev \ + build-essential clang libclang-dev cmake pkg-config nasm \ + git curl zip unzip tar python3 dpkg-dev \ libpipewire-0.3-dev libspa-0.2-dev libjack-jackd2-dev \ libasound2-dev libpulse-dev libsndfile1-dev \ libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \ libvulkan-dev libxkbcommon-dev libxkbcommon-x11-dev \ - librsvg2-bin - # ffnvcodec headers (NVDEC for the project FFmpeg build) are - # NOT in Ubuntu/Debian's apt index under a stable name - # (the old libffnvcodec-dev was dropped from noble; the - # community replacement is distro-version specific). The - # headers are distribution-free, so install them from - # source like the Fedora branch. - git clone --depth 1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git /tmp/nv-codec-headers - make -C /tmp/nv-codec-headers install PREFIX=/usr + gdb xvfb librsvg2-bin ;; fedora) dnf install -y \ - gcc gcc-c++ cmake pkgconf-pkg-config nasm \ + gcc gcc-c++ clang clang-devel cmake pkgconf-pkg-config nasm \ + git curl zip unzip tar python3 \ pipewire-devel jack-audio-connection-kit-devel \ alsa-lib-devel pulseaudio-libs-devel libsndfile-devel \ mesa-libGL-devel mesa-vulkan-drivers \ vulkan-headers vulkan-loader-devel \ libxkbcommon-devel libxkbcommon-x11-devel \ rpm-build librsvg2-tools - # ffnvcodec headers (NVDEC for the project FFmpeg build) are - # not in Fedora's base repos (RPM Fusion only); they are - # distribution-free headers, so install them from source. - git clone --depth 1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git /tmp/nv-codec-headers - make -C /tmp/nv-codec-headers install PREFIX=/usr ;; arch) pacman -S --needed --noconfirm \ - base-devel cmake pkgconf nasm \ + base-devel clang cmake pkgconf nasm \ + git curl zip unzip tar python \ pipewire jack2 alsa-lib libpulse libsndfile \ mesa vulkan-headers vulkan-icd-loader \ - libxkbcommon libxkbcommon-x11 librsvg \ - ffnvcodec-headers + libxkbcommon libxkbcommon-x11 librsvg ;; esac + # ------------------------------------------------------------------ + # vcpkg (manifest mode) + caches + # ------------------------------------------------------------------ + - name: Bootstrap vcpkg + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg.git .cache/vcpkg + .cache/vcpkg/bootstrap-vcpkg.sh -disableMetrics + echo "$PWD/.cache/vcpkg" >> "$GITHUB_PATH" + echo "VCPKG_ROOT=$PWD/.cache/vcpkg" >> "$GITHUB_ENV" + + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: | + vcpkg_installed + ~/.cache/vcpkg/archives + # The distro prefix matters: the same Ubuntu-runner cache scope + # backs three different container distros. + key: vcpkg-${{ matrix.distro }}-x64-linux-${{ hashFiles('vcpkg.json') }} + save-always: true + + - name: Install dependencies (vcpkg manifest) + run: vcpkg install --triplet x64-linux + - name: Configure build environment run: | + { + echo "CC=clang" + echo "CXX=clang++" + } >> "$GITHUB_ENV" # tooling/ocio-env.sh: vendored static OCIO everywhere it # builds (the [patch.crates-io] ocio-sys tracks shaloong/ocio-rs # main, whose vendored sources build on GCC >= 16). bash tooling/ocio-env.sh >> "$GITHUB_ENV" + prefix="$PWD/vcpkg_installed/x64-linux" + echo "FFMPEG_DIR=$prefix" >> "$GITHUB_ENV" + echo "PKG_CONFIG_PATH=$prefix/lib/pkgconfig" >> "$GITHUB_ENV" + echo "$prefix/tools/pkgconf" >> "$GITHUB_PATH" - name: Cache cargo artifacts uses: Swatinem/rust-cache@v2 @@ -117,15 +142,6 @@ jobs: shared-key: oak-${{ matrix.distro }} cache-on-failure: true - - name: Cache project FFmpeg - uses: actions/cache@v4 - with: - path: .cache/ffmpeg - key: ffmpeg-${{ matrix.distro }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }} - - - name: Build project FFmpeg (static, GPL + free codecs + hwaccel) - run: tooling/ffmpeg/build-ffmpeg.sh - - name: Build (release) run: cargo build --release --locked @@ -173,20 +189,48 @@ jobs: - name: Install system dependencies run: | - tooling/install-deps.sh + sudo apt-get update + # FFmpeg/codec libraries come from the vcpkg manifest (root + # vcpkg.json); this list is the toolchain vcpkg needs plus the + # GUI runtime deps the AppImage bundles. sudo apt-get install -y \ - cmake librsvg2-bin \ + build-essential clang libclang-dev cmake pkg-config nasm \ + git curl zip unzip tar python3 \ + librsvg2-bin \ libpipewire-0.3-dev libspa-0.2-dev libjack-jackd2-dev \ libasound2-dev libpulse-dev libsndfile1-dev \ libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \ libvulkan-dev libxkbcommon-dev libxkbcommon-x11-dev - # ffnvcodec headers (NVDEC for the project FFmpeg build) are - # handled by install-deps.sh (source install; the Ubuntu package - # name differs per release and `libffnvcodec-dev` is gone on - # noble) — do NOT apt-install them here. + + # ------------------------------------------------------------------ + # vcpkg (manifest mode) + caches + # ------------------------------------------------------------------ + - name: Bootstrap vcpkg + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg.git .cache/vcpkg + .cache/vcpkg/bootstrap-vcpkg.sh -disableMetrics + echo "$PWD/.cache/vcpkg" >> "$GITHUB_PATH" + echo "VCPKG_ROOT=$PWD/.cache/vcpkg" >> "$GITHUB_ENV" + + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: | + vcpkg_installed + ~/.cache/vcpkg/archives + key: vcpkg-${{ runner.os }}-appimage-${{ hashFiles('vcpkg.json') }} + save-always: true + + - name: Install dependencies (vcpkg manifest) + run: vcpkg install --triplet x64-linux - name: Configure build environment - run: bash tooling/ocio-env.sh >> "$GITHUB_ENV" + run: | + bash tooling/ocio-env.sh >> "$GITHUB_ENV" + prefix="$PWD/vcpkg_installed/x64-linux" + echo "FFMPEG_DIR=$prefix" >> "$GITHUB_ENV" + echo "PKG_CONFIG_PATH=$prefix/lib/pkgconfig" >> "$GITHUB_ENV" + echo "$prefix/tools/pkgconf" >> "$GITHUB_PATH" - name: Cache cargo artifacts uses: Swatinem/rust-cache@v2 @@ -194,15 +238,6 @@ jobs: shared-key: oak-appimage cache-on-failure: true - - name: Cache project FFmpeg - uses: actions/cache@v4 - with: - path: .cache/ffmpeg - key: ffmpeg-appimage-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }} - - - name: Build project FFmpeg (static, GPL + free codecs + hwaccel) - run: tooling/ffmpeg/build-ffmpeg.sh - - name: Install cargo-packager run: cargo install cargo-packager --locked @@ -240,19 +275,43 @@ jobs: - name: Install system dependencies run: | - tooling/install-deps.sh - brew install cmake librsvg + # Homebrew's pkgconf installs a `pkg-config` symlink, which is + # the name crates/oak-ffmpeg-link/build.rs invokes; nasm is what + # vcpkg's ffmpeg port requires to build. librsvg stays for + # rsvg-convert (app icon) and is bundled into the .app below. + brew install cmake pkg-config nasm librsvg + + # ------------------------------------------------------------------ + # vcpkg (manifest mode) + caches + # ------------------------------------------------------------------ + - name: Bootstrap vcpkg + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg.git .cache/vcpkg + .cache/vcpkg/bootstrap-vcpkg.sh -disableMetrics + echo "$PWD/.cache/vcpkg" >> "$GITHUB_PATH" + echo "VCPKG_ROOT=$PWD/.cache/vcpkg" >> "$GITHUB_ENV" + + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: | + vcpkg_installed + ~/.cache/vcpkg/archives + key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} + save-always: true + + - name: Install dependencies (vcpkg manifest) + run: vcpkg install --triplet arm64-osx - name: Configure build environment run: | # Vendored static OCIO (same as every non-Windows platform via # tooling/ocio-env.sh); no OCIO_INSTALL_DIR override. bash tooling/ocio-env.sh >> "$GITHUB_ENV" - { - echo "CFLAGS=-I/opt/homebrew/include" - echo "LDFLAGS=-L/opt/homebrew/lib" - echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig/openjpeg" - } >> "$GITHUB_ENV" + prefix="$PWD/vcpkg_installed/arm64-osx" + echo "FFMPEG_DIR=$prefix" >> "$GITHUB_ENV" + echo "PKG_CONFIG_PATH=$prefix/lib/pkgconfig" >> "$GITHUB_ENV" + echo "$prefix/tools/pkgconf" >> "$GITHUB_PATH" - name: Cache cargo artifacts uses: Swatinem/rust-cache@v2 @@ -260,17 +319,6 @@ jobs: shared-key: oak-workspace cache-on-failure: true - - name: Cache project FFmpeg - uses: actions/cache@v4 - with: - path: .cache/ffmpeg - key: ffmpeg-${{ runner.os }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }} - - - name: Build project FFmpeg (static, GPL + free codecs + hwaccel) - run: | - tooling/ffmpeg/build-ffmpeg.sh - echo "FFMPEG_DIR=$PWD/.cache/ffmpeg" >> "$GITHUB_ENV" - - name: Install cargo-packager run: cargo install cargo-packager --locked @@ -339,6 +387,17 @@ jobs: # every free codec + hwaccel, pkgconf, librsvg); the resolved tree # lands in vcpkg_installed/ and is keyed on the manifest. The # binary-cache archives dir makes a manifest bump rebuild cheap. + # Bootstrap a fresh clone rather than leaning on whatever vcpkg the + # image carries: `builtin-baseline`/`overrides` are only honored by + # a recent vcpkg-tool, and every OS job must behave alike. + - name: Bootstrap vcpkg + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg.git "$env:GITHUB_WORKSPACE\.cache\vcpkg" + & "$env:GITHUB_WORKSPACE\.cache\vcpkg\bootstrap-vcpkg.bat" -disableMetrics + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + "$env:GITHUB_WORKSPACE\.cache\vcpkg" >> $env:GITHUB_PATH + "VCPKG_ROOT=$env:GITHUB_WORKSPACE\.cache\vcpkg" >> $env:GITHUB_ENV + - name: Cache vcpkg artifacts uses: actions/cache@v4 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5e5ad548..f02b1a8d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,19 +35,49 @@ jobs: # ------------------------------------------------------------------ - name: Install system dependencies run: | - # Codec/filter libraries for the ffmpeg-sys-next build feature - # (see tooling/install-deps.sh). - tooling/install-deps.sh - # cmake/make for the vendored OpenColorIO build (ocio-sys - # `bundled`; Ubuntu's libopencolorio-dev is 2.1, older than the - # bridge's API floor) plus the headless test infra gpui needs: - # X11, software Mesa Vulkan (lavapipe) and xvfb. + sudo apt-get update + # The codec/filter libraries behind FFmpeg come from the vcpkg + # manifest (root vcpkg.json; see docs/build.md) — this list is + # the toolchain vcpkg itself needs, cmake/make for the vendored + # OpenColorIO build (ocio-sys `bundled`; Ubuntu's + # libopencolorio-dev is 2.1, older than the bridge's API floor), + # and the headless test infra gpui needs: X11, software Mesa + # Vulkan (lavapipe) and xvfb. sudo apt-get install -y \ - cmake \ + build-essential clang libclang-dev cmake pkg-config nasm \ + git curl zip unzip tar python3 \ libpipewire-0.3-dev libspa-0.2-dev libjack-jackd2-dev \ libasound2-dev libpulse-dev libsndfile1-dev \ libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \ - libvulkan-dev libxkbcommon-dev libxkbcommon-x11-dev xvfb build-essential clang libclang-dev + libvulkan-dev libxkbcommon-dev libxkbcommon-x11-dev xvfb + + # ------------------------------------------------------------------ + # vcpkg (manifest mode) + caches + # ------------------------------------------------------------------ + # The runner has no vcpkg preinstalled; bootstrap a fresh clone. + # The manifest at the repo root pins the dependency set (FFmpeg 9.0.1 + # via `overrides`, everything else via `builtin-baseline`) and the + # resolved tree lands in vcpkg_installed/. + - name: Bootstrap vcpkg + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg.git .cache/vcpkg + .cache/vcpkg/bootstrap-vcpkg.sh -disableMetrics + echo "$PWD/.cache/vcpkg" >> "$GITHUB_PATH" + echo "VCPKG_ROOT=$PWD/.cache/vcpkg" >> "$GITHUB_ENV" + + # The archives dir is vcpkg's binary cache: a manifest bump then + # rebuilds only what changed. Same key scheme as the Windows job. + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: | + vcpkg_installed + ~/.cache/vcpkg/archives + key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} + save-always: true + + - name: Install dependencies (vcpkg manifest) + run: vcpkg install --triplet x64-linux # ------------------------------------------------------------------ # Build environment @@ -60,7 +90,10 @@ jobs: - name: Configure build environment run: | bash tooling/ocio-env.sh >> "$GITHUB_ENV" - echo "FFMPEG_DIR=.cache/ffmpeg" >> "$GITHUB_ENV" + prefix="$PWD/vcpkg_installed/x64-linux" + echo "FFMPEG_DIR=$prefix" >> "$GITHUB_ENV" + echo "PKG_CONFIG_PATH=$prefix/lib/pkgconfig" >> "$GITHUB_ENV" + echo "$prefix/tools/pkgconf" >> "$GITHUB_PATH" # ------------------------------------------------------------------ # Caches @@ -73,25 +106,6 @@ jobs: shared-key: oak-ci-linux cache-on-failure: true - # The project FFmpeg (release/8.0, static, all free codecs + hwaccel) - # is built by tooling/ffmpeg/build-ffmpeg.sh — 10-20 min on a cold - # cache. It does not depend on the Rust toolchain, so key it on the - # script itself and keep it out of rust-cache. - - name: Cache project FFmpeg - uses: actions/cache@v4 - with: - path: .cache/ffmpeg - key: ffmpeg-${{ runner.os }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }} - save-always: true - - # ------------------------------------------------------------------ - # Project FFmpeg (script + FFMPEG_DIR; see docs/build.md) - # ------------------------------------------------------------------ - - name: Build project FFmpeg - run: | - tooling/ffmpeg/build-ffmpeg.sh - echo "FFMPEG_DIR=$PWD/.cache/ffmpeg" >> "$GITHUB_ENV" - # ------------------------------------------------------------------ # Build & test # ------------------------------------------------------------------ @@ -223,6 +237,17 @@ jobs: # every free codec + hwaccel, pkgconf, librsvg); the resolved tree # lands in vcpkg_installed/ and is keyed on the manifest. The # binary-cache archives dir makes a manifest bump rebuild cheap. + # Bootstrap a fresh clone rather than leaning on whatever vcpkg the + # image carries: `builtin-baseline`/`overrides` are only honored by + # a recent vcpkg-tool, and all three OS jobs must behave alike. + - name: Bootstrap vcpkg + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg.git "$env:GITHUB_WORKSPACE\.cache\vcpkg" + & "$env:GITHUB_WORKSPACE\.cache\vcpkg\bootstrap-vcpkg.bat" -disableMetrics + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + "$env:GITHUB_WORKSPACE\.cache\vcpkg" >> $env:GITHUB_PATH + "VCPKG_ROOT=$env:GITHUB_WORKSPACE\.cache\vcpkg" >> $env:GITHUB_ENV + - name: Cache vcpkg artifacts uses: actions/cache@v4 with: @@ -250,8 +275,8 @@ jobs: # no OCIO_RS_NO_MSVC_INCLUDES anywhere. "OCIO_RS_ENABLE_REAL=1" >> $env:GITHUB_ENV "OCIO_RS_LINK=static" >> $env:GITHUB_ENV - # Record the resolved versions in the build log: pinning them - # with builtin-baseline in vcpkg.json is a follow-up. + # Record the resolved versions in the build log (the manifest + # pins them via overrides + builtin-baseline). vcpkg list # Covers the whole target/ dir plus ~/.cargo; shared across branches @@ -304,8 +329,36 @@ jobs: # ------------------------------------------------------------------ - name: Install system dependencies run: | - tooling/install-deps.sh - brew install cmake + # Homebrew's pkgconf installs a `pkg-config` symlink, which is + # the name crates/oak-ffmpeg-link/build.rs invokes; nasm is what + # vcpkg's ffmpeg port requires to build (same split as the other + # platforms: FFmpeg libraries come from the vcpkg manifest). + brew install cmake pkg-config nasm + + # ------------------------------------------------------------------ + # vcpkg (manifest mode) + caches + # ------------------------------------------------------------------ + # The runner has no vcpkg preinstalled; bootstrap a fresh clone. + - name: Bootstrap vcpkg + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg.git .cache/vcpkg + .cache/vcpkg/bootstrap-vcpkg.sh -disableMetrics + echo "$PWD/.cache/vcpkg" >> "$GITHUB_PATH" + echo "VCPKG_ROOT=$PWD/.cache/vcpkg" >> "$GITHUB_ENV" + + # The archives dir is vcpkg's binary cache: a manifest bump then + # rebuilds only what changed. Same key scheme as the Windows job. + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: | + vcpkg_installed + ~/.cache/vcpkg/archives + key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} + save-always: true + + - name: Install dependencies (vcpkg manifest) + run: vcpkg install --triplet arm64-osx # ------------------------------------------------------------------ # Build environment @@ -315,14 +368,10 @@ jobs: # Vendored static OCIO (same as every non-Windows platform via # tooling/ocio-env.sh); no OCIO_INSTALL_DIR override. bash tooling/ocio-env.sh >> "$GITHUB_ENV" - # Homebrew quirks: lame.pc / snappy / libopenjp2.pc live off the - # default pkg-config search paths (see docs/build.md). - { - echo "CFLAGS=-I/opt/homebrew/include" - echo "LDFLAGS=-L/opt/homebrew/lib" - echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig/openjpeg" - } >> "$GITHUB_ENV" - echo "FFMPEG_DIR=.cache/ffmpeg" >> "$GITHUB_ENV" + prefix="$PWD/vcpkg_installed/arm64-osx" + echo "FFMPEG_DIR=$prefix" >> "$GITHUB_ENV" + echo "PKG_CONFIG_PATH=$prefix/lib/pkgconfig" >> "$GITHUB_ENV" + echo "$prefix/tools/pkgconf" >> "$GITHUB_PATH" # ------------------------------------------------------------------ # Caches @@ -335,24 +384,6 @@ jobs: shared-key: oak-ci-macos cache-on-failure: true - # The project FFmpeg (release/8.0, static, all free codecs + hwaccel) - # is built by tooling/ffmpeg/build-ffmpeg.sh — 10-20 min on a cold - # cache. It does not depend on the Rust toolchain, so key it on the - # script itself and keep it out of rust-cache. - - name: Cache project FFmpeg - uses: actions/cache@v4 - with: - path: .cache/ffmpeg - key: ffmpeg-${{ runner.os }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }} - - # ------------------------------------------------------------------ - # Project FFmpeg (script + FFMPEG_DIR; see docs/build.md) - # ------------------------------------------------------------------ - - name: Build project FFmpeg - run: | - tooling/ffmpeg/build-ffmpeg.sh - echo "FFMPEG_DIR=$PWD/.cache/ffmpeg" >> "$GITHUB_ENV" - # ------------------------------------------------------------------ # Build & test # ------------------------------------------------------------------ @@ -373,3 +404,148 @@ jobs: echo "first pass failed; retrying once for worker-pool flakes" cargo test --workspace --locked fi + + # second upstream target: openKylin (Debian/Ubuntu-derived) in its own + # image. The base image is bare (no sudo, no make, no python3) and the + # steps run as root, so there is no sudo prefix anywhere below. + openkylin: + name: Build & test (openKylin ${{ matrix.arch }}) + runs-on: ${{ matrix.runner }} + container: openkylin/openkylin:latest + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + runner: warp-ubuntu-latest-x64-8x + triplet: x64-linux + - arch: arm64 + runner: warp-ubuntu-latest-arm64-16x + triplet: arm64-linux + # The Test step's watchdog caps a hung suite at 30 min; give a cold + # vcpkg install + full compile + test room beyond that. + timeout-minutes: 90 + steps: + # The image ships neither git nor curl (checkout and vcpkg need + # both). First step of the job, so the package lists are still fresh. + - name: Install git and curl + run: apt-get update && apt-get install -y git curl ca-certificates + + - name: Checkout + uses: actions/checkout@v4 + with: + # gpui/ is a git submodule; its crates are workspace members of + # their own repo and build as path dependencies of oakapp. + submodules: true + + - name: Install Rust (stable) + uses: dtolnay/rust-toolchain@stable + + # ------------------------------------------------------------------ + # System dependencies + # ------------------------------------------------------------------ + # Same package set as the Linux job (both distros carry the Ubuntu + # names); patch/xz-utils are openKylin's own packaging brought in by + # zip/unzip. nasm and zip come from the kylinsoft "anything" PPA, + # which the image enables by default. + - name: Install system dependencies + run: | + apt-get update + apt-get install -y \ + build-essential clang libclang-dev cmake pkg-config nasm \ + git curl zip unzip tar python3 patch xz-utils \ + libpipewire-0.3-dev libspa-0.2-dev libjack-jackd2-dev \ + libasound2-dev libpulse-dev libsndfile1-dev \ + libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \ + libvulkan-dev libxkbcommon-dev libxkbcommon-x11-dev xvfb \ + gdb file + + # ------------------------------------------------------------------ + # vcpkg (manifest mode) + caches + # ------------------------------------------------------------------ + # The image has no vcpkg preinstalled; bootstrap a fresh clone. + - name: Bootstrap vcpkg + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg.git .cache/vcpkg + .cache/vcpkg/bootstrap-vcpkg.sh -disableMetrics + echo "$PWD/.cache/vcpkg" >> "$GITHUB_PATH" + echo "VCPKG_ROOT=$PWD/.cache/vcpkg" >> "$GITHUB_ENV" + + # The archives dir is vcpkg's binary cache: a manifest bump then + # rebuilds only what changed. + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: | + vcpkg_installed + ~/.cache/vcpkg/archives + # The arch prefix matters here: both jobs run the same distro + # image through the same cache scope, unlike the OS jobs. + key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-openkylin-${{ hashFiles('vcpkg.json') }} + save-always: true + + - name: Install dependencies (vcpkg manifest) + run: vcpkg install --triplet ${{ matrix.triplet }} + + # ------------------------------------------------------------------ + # Build environment + # ------------------------------------------------------------------ + - name: Configure build environment + run: | + { + echo "CC=clang" + echo "CXX=clang++" + } >> "$GITHUB_ENV" + bash tooling/ocio-env.sh >> "$GITHUB_ENV" + prefix="$PWD/vcpkg_installed/${{ matrix.triplet }}" + echo "FFMPEG_DIR=$prefix" >> "$GITHUB_ENV" + echo "PKG_CONFIG_PATH=$prefix/lib/pkgconfig" >> "$GITHUB_ENV" + echo "$prefix/tools/pkgconf" >> "$GITHUB_PATH" + + # Covers the whole target/ dir plus ~/.cargo. + - name: Cache cargo artifacts + uses: Swatinem/rust-cache@v2 + with: + shared-key: oak-ci-openkylin-${{ matrix.arch }} + cache-on-failure: true + + # ------------------------------------------------------------------ + # Build & test + # ------------------------------------------------------------------ + - name: Build + run: cargo check --workspace --locked + + # xvfb + 24-bit screen, same as the Linux job: the gpui + # #[gpui::test] tests open real windows and render through wgpu on + # Mesa's software Vulkan (lavapipe). The watchdog logic is the Linux + # job's; the retry once below covers the same worker-pool flake, + # which is a stale-tmpfs/container property too — a real regression + # fails both passes. + - name: Test + timeout-minutes: 45 + shell: bash + run: | + run_suite() { + xvfb-run -a -s "-screen 0 1920x1080x24" cargo test --workspace --locked & + TEST_PID=$! + ( + sleep 1800 + echo "::warning::test suite exceeded 1800s; dumping hung-process stacks" + for p in $(pgrep -f 'target/debug/deps/|target/debug/oak-worker'); do + echo "===== thread stacks of pid $p ($(readlink /proc/$p/exe 2>/dev/null)) =====" + gdb -batch -ex 'thread apply all bt' -p "$p" || true + done + pkill -9 -f 'target/debug/deps/' || true + pkill -9 -f 'target/debug/oak-worker' || true + ) >/dev/null 2>&1 & + WATCHDOG_PID=$! + wait $TEST_PID + rc=$? + kill $WATCHDOG_PID 2>/dev/null || true + wait $WATCHDOG_PID 2>/dev/null || true + return $rc + } + if ! run_suite; then + echo "first pass failed; retrying once for worker-pool flakes" + run_suite + fi diff --git a/.gitignore b/.gitignore index 002fa8173..d203afc10 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ CmakeSettings.json # clangd's index and likely other things that need not be in the repository .cache/ -# vcpkg manifest-mode install tree (Windows CI/CD; see vcpkg.json) +# vcpkg manifest-mode install tree (CI/CD; see vcpkg.json) vcpkg_installed/ # Generated packaging assets (icons/icon.png is produced from Oak_Icon.svg diff --git a/docs/build.md b/docs/build.md index b2c1c2f4b..42eb1a56c 100644 --- a/docs/build.md +++ b/docs/build.md @@ -36,6 +36,15 @@ macOS, Linux, and Windows. For the Chinese version see config entry is the only machine-agnostic way). The `oak-ffmpeg-link` build script panics without it; run `build-ffmpeg.sh` once before the first `cargo build`. +- **CI/CD uses the vcpkg manifest instead of `build-ffmpeg.sh`.** Every + desktop job runs `vcpkg install --triplet ` against the repo-root `vcpkg.json`, which + pins FFmpeg to **9.0.1#1** (`overrides`) and every other port through + `builtin-baseline`; the tree lands in `vcpkg_installed/` and + jobs point `FFMPEG_DIR`/`PKG_CONFIG_PATH` at it. The C/C++ libraries + outside that set (OCIO is vendored, the rest come from the system + package manager) are unchanged. The local-build path above remains + valid and is what the docs below describe. ## Quick start (macOS / Linux) @@ -88,8 +97,9 @@ cargo test --workspace # Linux: see "headless tests" below > **CI/CD note**: the GitHub Windows CI/CD no longer uses this path — it > builds MSVC-ABI on `warp-windows-2025-vs2026-x64-16x` with vcpkg -> manifest mode (`vcpkg.json` at the repo root: FFmpeg with every free -> codec + hwaccel, pkgconf, librsvg) and the vendored static OCIO. The +> manifest mode (`vcpkg.json` at the repo root: FFmpeg 9.0.1 with every +> free codec + hwaccel, pkgconf, librsvg, all pinned by +> `overrides`/`builtin-baseline`) and the vendored static OCIO. The > MSYS2 flow below remains the documented local-build alternative. The Windows build targets **x86_64-pc-windows-gnu** with MSYS2's own diff --git a/tooling/install-deps.sh b/tooling/install-deps.sh index db9477d18..2b84989b4 100755 --- a/tooling/install-deps.sh +++ b/tooling/install-deps.sh @@ -21,6 +21,9 @@ # itself is built from source by tooling/ffmpeg/build-ffmpeg.sh (which # installs into .cache/ffmpeg) and is NOT installed here. # +# This is the local-build path. CI/CD gets the same libraries from the +# vcpkg manifest (root vcpkg.json) instead — see docs/build.md. +# # Supported: Homebrew (macOS), MSYS2 UCRT64 (Windows), Debian/Ubuntu, # Fedora, Arch. Run it yourself — nothing in the build invokes it # automatically (it needs sudo on Linux). diff --git a/vcpkg.json b/vcpkg.json index fa76a9435..f6ba6f645 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,7 +1,8 @@ { "name": "oak", "version": "0.5.0", - "comment": "Windows dependencies (CI/CD, MSVC): the project's FFmpeg with every free codec + hwaccel (mirrors tooling/ffmpeg/build-ffmpeg.sh's configure), plus pkgconf so the -sys crates can find the .pc files. ffmpeg version pinning via builtin-baseline is a follow-up once CI reports the resolved version (see .github/workflows/ci.yml).", + "$comment": "FFmpeg (+ pkgconf, librsvg on Windows) for every desktop platform CI/CD builds — Linux, macOS and Windows — with the project's feature set (every free codec + hwaccel, mirroring tooling/ffmpeg/build-ffmpeg.sh's configure switches). Local builds may keep using tooling/install-deps.sh + tooling/ffmpeg/build-ffmpeg.sh. ffmpeg is pinned to 9.0.1#1 via overrides; builtin-baseline pins the rest of the port tree.", + "builtin-baseline": "771b0a2e7c473c3a6bee56553be4d5bb32bb653c", "dependencies": [ { "name": "ffmpeg", @@ -25,11 +26,27 @@ "freetype", "fribidi", "fontconfig", - "gnutls", - "ffnvcodec" + "openssl", + { + "name": "nvcodec", + "platform": "linux | (windows & !arm64)" + }, + { + "name": "vaapi", + "platform": "linux" + } ] }, "pkgconf", - "librsvg" + { + "name": "librsvg", + "platform": "windows" + } + ], + "overrides": [ + { + "name": "ffmpeg", + "version": "9.0.1#1" + } ] }