From 4337559ed0c50f963e8731885b78f4f2bb6f3c43 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Sat, 12 Sep 2026 21:08:10 +0800 Subject: [PATCH] ci: fix the Windows, Linux, macOS and ARM64 failures - Windows: vcpkg ships `pkgconf` without the `pkg-config` shim, so the oak-ffmpeg-link build script failed with "program not found". Probe `pkg-config`, fall back to `pkgconf` (or honor `PKG_CONFIG`), and join the child's `PKG_CONFIG_PATH` with the platform separator instead of a hard-coded `:` (which split `C:\...` apart). - Linux (and openKylin): the test binaries link the VAAPI stack via vcpkg's FFmpeg; install the `libva2`/`libva-drm2`/`libvdpau1` runtime packages the loader needs. - macOS: bump the gpui submodule (OakVideoEditorCommunity/oak-gpui@fix/macos-metal-layer-and-dead-code): `setColorspace:` now sends to the `MetalLayerRef` (`self.layer.as_ref()` made `&*layer` the owned type, which is not `objc::Message`), and the viewer's `GpuFrameEntry` carries the non-Linux dead-code allowance. - openKylin ARM64: switch the ocio patch to the fork's fix/aarch64-c-char rev. Upstream models C `char*` as `*const i8`; aarch64's `c_char` is u8, so the crates did not compile. The fix uses `c_char` throughout ocio-sys and the ocio-rs boundary (pushed as 30338c6a169bbbada862fb3ac256e79b656159cf). --- .github/workflows/ci.yml | 2 + Cargo.lock | 5 +-- Cargo.toml | 9 +++-- crates/oak-ffmpeg-link/build.rs | 65 +++++++++++++++++++++------------ gpui | 2 +- 5 files changed, 52 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 921de9776..567ea4daa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,7 @@ jobs: libasound2-dev libpulse-dev libsndfile1-dev \ libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \ libvulkan-dev libxkbcommon-dev libxkbcommon-x11-dev xvfb libdrm-dev \ + libva2 libva-drm2 libvdpau1 \ autoconf autoconf-archive automake libtool # ------------------------------------------------------------------ @@ -463,6 +464,7 @@ jobs: libasound2-dev libpulse-dev libsndfile1-dev \ libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \ libvulkan-dev libxkbcommon-dev libxkbcommon-x11-dev xvfb libdrm-dev \ + libva2 libva-drm2 libvdpau1 \ gdb file autoconf autoconf-archive automake libtool # ------------------------------------------------------------------ diff --git a/Cargo.lock b/Cargo.lock index 722975399..be031c121 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5084,8 +5084,7 @@ dependencies = [ [[package]] name = "ocio-rs" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3492534019b59e29dba06014f907dd12824537ed4d293d4108c4bfc669de7fd" +source = "git+https://github.com/Mike-Solar/ocio-rs.git?rev=30338c6a169bbbada862fb3ac256e79b656159cf#30338c6a169bbbada862fb3ac256e79b656159cf" dependencies = [ "ocio-sys", "thiserror 1.0.69", @@ -5094,7 +5093,7 @@ dependencies = [ [[package]] name = "ocio-sys" version = "0.2.1" -source = "git+https://github.com/Mike-Solar/ocio-rs.git?branch=main#ddb677d8a71d1047c2dd3f8a04fc88f7c5c23ccc" +source = "git+https://github.com/Mike-Solar/ocio-rs.git?rev=30338c6a169bbbada862fb3ac256e79b656159cf#30338c6a169bbbada862fb3ac256e79b656159cf" dependencies = [ "cc", "cmake", diff --git a/Cargo.toml b/Cargo.toml index f0e0f6ffd..2e6d63016 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,8 +70,9 @@ opt-level = 1 # ocio-sys 0.2.1's vendored sources fail to build on GCC >= 16 (yaml-cpp # misses ) and misdetect a system zlib-ng (minizip-ng then emits -# zng_* symbols the vendored zlib cannot satisfy). The fork tracks -# shaloong/ocio-rs main plus both build fixes; return to the crates.io -# release once it carries them. +# zng_* symbols the vendored zlib cannot satisfy); upstream also hard-codes +# `char*` as `*const i8`, which does not compile on aarch64 (c_char = u8). +# The fork carries all three fixes; return to the crates.io release once it +# does (the ocio-rs patch pulls the fork's `ocio-sys` path dependency too). [patch.crates-io] -ocio-sys = { git = "https://github.com/Mike-Solar/ocio-rs.git", branch = "main" } +ocio-rs = { git = "https://github.com/Mike-Solar/ocio-rs.git", rev = "30338c6a169bbbada862fb3ac256e79b656159cf" } diff --git a/crates/oak-ffmpeg-link/build.rs b/crates/oak-ffmpeg-link/build.rs index 6eb843d8e..f3023eef9 100644 --- a/crates/oak-ffmpeg-link/build.rs +++ b/crates/oak-ffmpeg-link/build.rs @@ -64,29 +64,48 @@ fn main() { } let pkg_path = env_or_dotenv("PKG_CONFIG_PATH").unwrap_or_default(); - let output = Command::new("pkg-config") - .arg("--static") - .arg("--libs") - .args([ - "libavformat", - "libavcodec", - "libavfilter", - "libavdevice", - "libavutil", - "libswscale", - "libswresample", - ]) - .env( - "PKG_CONFIG_PATH", - format!( - "{}{}{}", - pc_dir.display(), - if pkg_path.is_empty() { "" } else { ":" }, - pkg_path - ), - ) - .output() - .expect("pkg-config is required when FFMPEG_DIR is set"); + // The pkg-config child must see the FFMPEG_DIR .pc files. Join with the + // platform separator (`:` on Unix, `;` on Windows): formatting a `:` + // into a Windows `C:\...` path list makes pkgconf split the drive + // letter off. + let joined_path = { + let mut paths = vec![pc_dir.clone()]; + if !pkg_path.is_empty() { + paths.extend(std::env::split_paths(&pkg_path)); + } + std::env::join_paths(paths).unwrap_or_default() + }; + const FFMPEG_LIBS: [&str; 7] = [ + "libavformat", + "libavcodec", + "libavfilter", + "libavdevice", + "libavutil", + "libswscale", + "libswresample", + ]; + let run = |program: &str| { + Command::new(program) + .arg("--static") + .arg("--libs") + .args(FFMPEG_LIBS) + .env("PKG_CONFIG_PATH", &joined_path) + .output() + }; + // vcpkg ships `pkgconf` on Windows without a `pkg-config` shim (macOS + // Homebrew ships both); fall back on the standard name first, then + // pkgconf. Only a missing program falls back — a pkg-config that runs + // and fails is a real error (bad .pc, missing libs) and must surface. + let output = match env_or_dotenv("PKG_CONFIG").filter(|p| !p.trim().is_empty()) { + Some(custom) => run(&custom).expect("PKG_CONFIG points at a program that failed to run"), + None => match run("pkg-config") { + Ok(output) => output, + Err(e) if e.kind() == std::io::ErrorKind::NotFound => { + run("pkgconf").expect("pkg-config/pkgconf is required when FFMPEG_DIR is set") + } + Err(e) => panic!("failed to run pkg-config: {e}"), + }, + }; if !output.status.success() { panic!( "pkg-config --static --libs failed for the FFMPEG_DIR install: {}", diff --git a/gpui b/gpui index 868d97e60..56be9f758 160000 --- a/gpui +++ b/gpui @@ -1 +1 @@ -Subproject commit 868d97e60c1c3b693675964aa08ad78796503d8e +Subproject commit 56be9f7582c1ab0269a575a176b86f3ff9ae8564