vendor capnproto and ffmpeg via dependencies repo (#37327)

This commit is contained in:
Adeeb Shihadeh
2026-02-22 19:15:11 -08:00
committed by GitHub
parent f881a9ba68
commit 4bffe422e4
8 changed files with 33 additions and 14 deletions

View File

@@ -38,6 +38,14 @@ assert arch in [
"Darwin", # macOS arm64 (x86 not supported)
]
if arch != "larch64":
import capnproto
import ffmpeg as ffmpeg_pkg
pkgs = [capnproto, ffmpeg_pkg]
else:
# TODO: remove when AGNOS has our new vendor pkgs
pkgs = []
env = Environment(
ENV={
"PATH": os.environ['PATH'],
@@ -74,6 +82,7 @@ env = Environment(
"#third_party/acados/include/hpipm/include",
"#third_party/catch2/include",
"#third_party/libyuv/include",
[x.INCLUDE_DIR for x in pkgs],
],
LIBPATH=[
"#common",
@@ -83,6 +92,7 @@ env = Environment(
"#rednose/helpers",
f"#third_party/libyuv/{arch}/lib",
f"#third_party/acados/{arch}/lib",
[x.LIB_DIR for x in pkgs],
],
RPATH=[],
CYTHONCFILESUFFIX=".cpp",

View File

@@ -25,6 +25,10 @@ dependencies = [
"setuptools",
"numpy >=2.0",
# vendored native dependencies
"capnproto @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=capnproto",
"ffmpeg @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=ffmpeg",
# body / webrtcd
"av",
"aiohttp",

View File

@@ -1,8 +1,8 @@
Import('env', 'arch', 'messaging', 'common', 'visionipc')
libs = [common, messaging, visionipc,
'avformat', 'avcodec', 'avutil',
'yuv', 'pthread', 'zstd']
'avformat', 'avcodec', 'swresample', 'avutil', 'x264',
'yuv', 'pthread', 'z', 'm', 'zstd']
src = ['logger.cc', 'zstd_writer.cc', 'video_writer.cc', 'encoder/encoder.cc', 'encoder/v4l_encoder.cc', 'encoder/jpeg_encoder.cc']
if arch != "larch64":

View File

@@ -75,7 +75,7 @@ qt_libs = base_libs
cabana_env = qt_env.Clone()
cabana_libs = [cereal, messaging, visionipc, replay_lib, 'avutil', 'avcodec', 'avformat', 'bz2', 'zstd', 'curl', 'yuv', 'usb-1.0'] + qt_libs
cabana_libs = [cereal, messaging, visionipc, replay_lib, 'avformat', 'avcodec', 'swresample', 'avutil', 'x264', 'z', 'bz2', 'zstd', 'curl', 'yuv', 'usb-1.0'] + qt_libs
opendbc_path = '-DOPENDBC_FILE_PATH=\'"%s"\'' % (cabana_env.Dir("../../opendbc/dbc").abspath)
cabana_env['CXXFLAGS'] += [opendbc_path]

View File

@@ -34,14 +34,7 @@ function install_ubuntu_common_requirements() {
git-lfs \
xvfb
# TODO: vendor the rest of these in third_party/
$SUDO apt-get install -y --no-install-recommends \
capnproto \
libcapnp-dev \
ffmpeg \
libavformat-dev \
libavcodec-dev \
libavutil-dev \
libbz2-dev \
libeigen3-dev \
libgles2-mesa-dev \

View File

@@ -28,10 +28,8 @@ fi
brew bundle --file=- <<-EOS
brew "git-lfs"
brew "capnp"
brew "coreutils"
brew "eigen"
brew "ffmpeg"
brew "libusb"
brew "llvm"
brew "zeromq"

View File

@@ -12,7 +12,7 @@ if arch != "Darwin":
replay_lib_src.append("qcom_decoder.cc")
replay_lib = replay_env.Library("replay", replay_lib_src, LIBS=base_libs, FRAMEWORKS=base_frameworks)
Export('replay_lib')
replay_libs = [replay_lib, 'avutil', 'avcodec', 'avformat', 'bz2', 'zstd', 'curl', 'yuv', 'ncurses'] + base_libs
replay_libs = [replay_lib, 'avformat', 'avcodec', 'swresample', 'avutil', 'x264', 'z', 'bz2', 'zstd', 'curl', 'yuv', 'ncurses'] + base_libs
replay_env.Program("replay", ["main.cc"], LIBS=replay_libs, FRAMEWORKS=base_frameworks)
if GetOption('extras'):

16
uv.lock generated
View File

@@ -119,6 +119,11 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/7b/ff/48fa68888b8d5bae36d915556ff18f9e5fdc6b5ff5ae23dc4904c9713168/av-13.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:5ea0deab0e6a739cb742fba2a3983d8102f7516a3cdf3c46669f3cac0ed1f351", size = 25781343, upload-time = "2024-10-06T04:53:29.577Z" },
]
[[package]]
name = "capnproto"
version = "1.0.1"
source = { git = "https://github.com/commaai/dependencies.git?subdirectory=capnproto&rev=releases#acf53363042d92d3206b8ce6b9da4bfb75b200c7" }
[[package]]
name = "casadi"
version = "3.7.2"
@@ -374,6 +379,11 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/ab/84/02fc1827e8cdded4aa65baef11296a9bbe595c474f0d6d758af082d849fd/execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec", size = 40708, upload-time = "2025-11-12T09:56:36.333Z" },
]
[[package]]
name = "ffmpeg"
version = "7.1.0"
source = { git = "https://github.com/commaai/dependencies.git?subdirectory=ffmpeg&rev=releases#acf53363042d92d3206b8ce6b9da4bfb75b200c7" }
[[package]]
name = "fonttools"
version = "4.61.1"
@@ -419,7 +429,7 @@ wheels = [
[[package]]
name = "gcc-arm-none-eabi"
version = "13.2.1"
source = { git = "https://github.com/commaai/dependencies.git?subdirectory=gcc-arm-none-eabi&rev=releases#e769f658aad6ab46e98490bf0800e69b99e22f7a" }
source = { git = "https://github.com/commaai/dependencies.git?subdirectory=gcc-arm-none-eabi&rev=releases#acf53363042d92d3206b8ce6b9da4bfb75b200c7" }
[[package]]
name = "ghp-import"
@@ -749,10 +759,12 @@ dependencies = [
{ name = "aiohttp" },
{ name = "aiortc" },
{ name = "av" },
{ name = "capnproto" },
{ name = "casadi" },
{ name = "cffi" },
{ name = "crcmod-plus" },
{ name = "cython" },
{ name = "ffmpeg" },
{ name = "inputs" },
{ name = "jeepney" },
{ name = "json-rpc" },
@@ -815,6 +827,7 @@ requires-dist = [
{ name = "aiohttp" },
{ name = "aiortc" },
{ name = "av" },
{ name = "capnproto", git = "https://github.com/commaai/dependencies.git?subdirectory=capnproto&rev=releases" },
{ name = "casadi", specifier = ">=3.6.6" },
{ name = "cffi" },
{ name = "codespell", marker = "extra == 'testing'" },
@@ -822,6 +835,7 @@ requires-dist = [
{ name = "crcmod-plus" },
{ name = "cython" },
{ name = "dearpygui", marker = "(platform_machine != 'aarch64' and extra == 'tools') or (sys_platform != 'linux' and extra == 'tools')", specifier = ">=2.1.0" },
{ name = "ffmpeg", git = "https://github.com/commaai/dependencies.git?subdirectory=ffmpeg&rev=releases" },
{ name = "gcc-arm-none-eabi", marker = "extra == 'dev'", git = "https://github.com/commaai/dependencies.git?subdirectory=gcc-arm-none-eabi&rev=releases" },
{ name = "hypothesis", marker = "extra == 'testing'", specifier = "==6.47.*" },
{ name = "inputs" },