From 4bffe422e4304d590566947d353a548a14867b9e Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 22 Feb 2026 19:15:11 -0800 Subject: [PATCH] vendor capnproto and ffmpeg via dependencies repo (#37327) --- SConstruct | 10 ++++++++++ pyproject.toml | 4 ++++ system/loggerd/SConscript | 4 ++-- tools/cabana/SConscript | 2 +- tools/install_ubuntu_dependencies.sh | 7 ------- tools/mac_setup.sh | 2 -- tools/replay/SConscript | 2 +- uv.lock | 16 +++++++++++++++- 8 files changed, 33 insertions(+), 14 deletions(-) diff --git a/SConstruct b/SConstruct index 3b8aadf914..3d611af0b2 100644 --- a/SConstruct +++ b/SConstruct @@ -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", diff --git a/pyproject.toml b/pyproject.toml index cc56eb3594..93d7b380b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/system/loggerd/SConscript b/system/loggerd/SConscript index cc8ef7c88f..fecf448855 100644 --- a/system/loggerd/SConscript +++ b/system/loggerd/SConscript @@ -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": diff --git a/tools/cabana/SConscript b/tools/cabana/SConscript index 025797d1e3..8ea59d0766 100644 --- a/tools/cabana/SConscript +++ b/tools/cabana/SConscript @@ -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] diff --git a/tools/install_ubuntu_dependencies.sh b/tools/install_ubuntu_dependencies.sh index 06ab8fda3a..e4b8a64559 100755 --- a/tools/install_ubuntu_dependencies.sh +++ b/tools/install_ubuntu_dependencies.sh @@ -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 \ diff --git a/tools/mac_setup.sh b/tools/mac_setup.sh index dece439752..e2ede7fbb8 100755 --- a/tools/mac_setup.sh +++ b/tools/mac_setup.sh @@ -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" diff --git a/tools/replay/SConscript b/tools/replay/SConscript index 698ab9885d..b39cf6dab1 100644 --- a/tools/replay/SConscript +++ b/tools/replay/SConscript @@ -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'): diff --git a/uv.lock b/uv.lock index aa03f6d5e2..9bfbd05dd5 100644 --- a/uv.lock +++ b/uv.lock @@ -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" },