diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index cacb4523ad..9529871b79 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -45,6 +45,7 @@ jobs: run: | python3 -m unittest tools.laptop_device_build.tests.test_runtime_dependencies -v python3 -c 'from pathlib import Path; assert b"starting pandad (comma hardware)" in Path("openpilot/selfdrive/pandad/pandad").read_bytes(), "Shipped pandad must use the comma hardware build profile"' + python3 -c 'from pathlib import Path; paths = ("openpilot/system/camerad/camerad", "msgq_repo/msgq/visionipc/_visionipc.so", "openpilot/system/loggerd/encoderd", "openpilot/tools/replay/replay"); assert all(b"/dev/ion\0" in Path(p).read_bytes() for p in paths), "Shipped camera buffers must use ION"' - name: Test one-shot branch migration run: python3 -m unittest discover -s scripts/tests -v - name: Validate tracked dependencies @@ -93,7 +94,7 @@ jobs: env: GOTOOLCHAIN: local run: | - sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update && sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y --no-install-recommends pkg-config zlib1g-dev + sudo apt-get update && sudo apt-get install -y --no-install-recommends pkg-config zlib1g-dev (cd mapd_repo && go mod download) PYTHONPATH="$GITHUB_WORKSPACE" python3 -m openpilot.starpilot.maps.package_shadow - name: Build devel @@ -218,7 +219,7 @@ jobs: env: RAYLIB_BACKEND: headless STARPILOT_TEST_DIAGNOSTICS: ci-results/host-test-diagnostics/unittest - run: tools/op.sh test --jobs 2 --json-output unit-test-results.json + run: tools/op.sh test --json-output unit-test-results.json - name: Test GM vehicle configurations and CAN behavior if: ${{ !cancelled() && steps.build.outcome == 'success' }} timeout-minutes: 5 @@ -303,7 +304,7 @@ jobs: .venv/bin/python -c "import av; assert 'libx264' in av.codecs_available" - name: Provide Mesa software graphics for pixel-level tests if: ${{ !cancelled() && steps.build.outcome == 'success' }} - run: sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update && sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y libegl1 libgles-dev libgl1-mesa-dri + run: sudo apt-get update && sudo apt-get install -y libegl1 libgles-dev libgl1-mesa-dri - name: Test every assigned custom pytest node serially if: ${{ !cancelled() && steps.build.outcome == 'success' }} timeout-minutes: 20 @@ -410,7 +411,7 @@ jobs: go-version: '1.25.1' cache-dependency-path: mapd_repo/go.sum - name: Install native build dependencies - run: sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update && sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y --no-install-recommends pkg-config zlib1g-dev + run: sudo apt-get update && sudo apt-get install -y --no-install-recommends pkg-config zlib1g-dev - name: Test and build pinned map provider run: python3 tools/ci/run_map_tests.py --output ci-results/map-provider - name: Save test and build evidence diff --git a/msgq_repo/SConscript b/msgq_repo/SConscript index 21bc37ba22..cbdf01e0fc 100644 --- a/msgq_repo/SConscript +++ b/msgq_repo/SConscript @@ -39,7 +39,7 @@ msgq_python = envNanobind.Program(f'msgq/_ipc{python_suffix}', ['msgq/ipc_py.cc' # Build Vision IPC vipc_files = ['visionipc.cc', 'visionipc_server.cc', 'visionipc_client.cc'] -if File('/dev/ion').exists(): +if arch == "comma_arm64" or File('/dev/ion').exists(): vipc_files += ['visionbuf_ion.cc'] else: vipc_files += ['visionbuf.cc'] diff --git a/msgq_repo/libvisionipc.a b/msgq_repo/libvisionipc.a index 661adca17c..d807914de4 100644 Binary files a/msgq_repo/libvisionipc.a and b/msgq_repo/libvisionipc.a differ diff --git a/msgq_repo/msgq/visionipc/_visionipc.so b/msgq_repo/msgq/visionipc/_visionipc.so index 3d69a39bee..4a9842009a 100755 Binary files a/msgq_repo/msgq/visionipc/_visionipc.so and b/msgq_repo/msgq/visionipc/_visionipc.so differ diff --git a/openpilot/system/camerad/camerad b/openpilot/system/camerad/camerad index a2d9d153e2..1c06a7ba69 100755 Binary files a/openpilot/system/camerad/camerad and b/openpilot/system/camerad/camerad differ diff --git a/openpilot/system/loggerd/encoderd b/openpilot/system/loggerd/encoderd index d3dce364ff..c807480c95 100755 Binary files a/openpilot/system/loggerd/encoderd and b/openpilot/system/loggerd/encoderd differ diff --git a/openpilot/tools/replay/replay b/openpilot/tools/replay/replay index 79655aee0e..6c58568548 100755 Binary files a/openpilot/tools/replay/replay and b/openpilot/tools/replay/replay differ diff --git a/prebuilt.json b/prebuilt.json index def2546a68..3f0d242591 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "fef1c4ace34f8bfeb0f4ee4ef7c0f4ef928c9a8da6a17e559bbf76ea1a7a6f65", "schema_version": 1} +{"protected_inventory_sha256": "6ae9f9c3947f9fbed4e12c940e1b24c1475cdaa85bb1932a5d0d481564da6bf6", "schema_version": 1} diff --git a/tools/laptop_device_build/tests/test_runtime_dependencies.py b/tools/laptop_device_build/tests/test_runtime_dependencies.py index de33805441..96dce42b02 100644 --- a/tools/laptop_device_build/tests/test_runtime_dependencies.py +++ b/tools/laptop_device_build/tests/test_runtime_dependencies.py @@ -5,6 +5,7 @@ import ast import subprocess import sys import unittest +from unittest.mock import Mock ROOT = Path(__file__).resolve().parents[3] @@ -46,3 +47,23 @@ class LiveSteeringServiceInventoryTest(unittest.TestCase): with self.subTest(binary=binary): self.assertIn(service.encode(), (ROOT / binary).read_bytes(), f'{binary}: rebuild after changing the native service registry') + + +class VisionBufferAllocatorTest(unittest.TestCase): + def test_device_build_uses_ion_without_a_build_host_device_node(self): + source = ast.parse((ROOT / 'msgq_repo/SConscript').read_text()) + first = next(i for i, node in enumerate(source.body) if isinstance(node, ast.Assign) + and any(isinstance(target, ast.Name) and target.id == 'vipc_files' for target in node.targets)) + allocator = compile(ast.Module(body=source.body[first:first + 2], type_ignores=[]), '', 'exec') + for arch, ion_present, expected in (('comma_arm64', False, 'visionbuf_ion.cc'), + ('comma_arm64', True, 'visionbuf_ion.cc'), + ('aarch64', False, 'visionbuf.cc'), + ('x86_64', False, 'visionbuf.cc'), + ('Darwin', False, 'visionbuf.cc'), + ('aarch64', True, 'visionbuf_ion.cc')): + with self.subTest(arch=arch, ion_present=ion_present): + node = Mock() + node.exists.return_value = ion_present + context = {'arch': arch, 'File': Mock(return_value=node)} + exec(allocator, context) + self.assertEqual(context['vipc_files'][-1], expected)