Skip to content

Build panda firmware during package build and enforce wheel artifact checks#2367

Open
FuZoe wants to merge 2 commits intocommaai:masterfrom
FuZoe:master
Open

Build panda firmware during package build and enforce wheel artifact checks#2367
FuZoe wants to merge 2 commits intocommaai:masterfrom
FuZoe:master

Conversation

@FuZoe
Copy link

@FuZoe FuZoe commented Mar 2, 2026

Summary

Compile panda firmware during package build (not during wheel install) and include firmware binaries in the wheel.

Changes

Build System

  • setup.py: custom build_firmware command wired into build subcommands
  • pyproject.toml: build requirements (scons, pycryptodome, opendbc) and package data for firmware/certs
  • MANIFEST.in: include source files for sdist

CI

  • package.yml: build wheel, validate contents, test wheel install, test editable hook

Validation

  • scripts/check_wheel.py: enforces 9 required files and rejects .o/.d/.elf/.map intermediates

Required Files in Wheel

  • panda/board/obj/panda_h7.bin.signed
  • panda/board/obj/panda_jungle_h7.bin.signed
  • panda/board/obj/body_h7.bin.signed
  • panda/board/obj/bootstub.panda_h7.bin
  • panda/board/obj/bootstub.panda_jungle_h7.bin
  • panda/board/obj/bootstub.body_h7.bin
  • panda/board/certs/debug
  • panda/board/certs/debug.pub
  • panda/board/certs/release.pub

Prerequisites

ARM toolchain (arm-none-eabi-gcc) must be available for source builds. CI provides ARM toolchain setup.

Local Test

# With dependencies pre-installed (or use --no-isolation for network-limited environments)
python -m build --wheel --no-isolation
b43fcda18c6b4f33979a9b54758cedd0
python scripts/check_wheel.py dist/pandacan-*.whl
QQ_1772441332225

Fixes #2239

fuzoe added 2 commits March 2, 2026 16:45
…date wheel contents

- add setup.py with build_firmware command invoked from build subcommands

- add build requirements for firmware compilation (scons, pycryptodome, opendbc)

- include firmware binaries and cert files via setuptools package data

- add MANIFEST.in for sdist source completeness

- add scripts/check_wheel.py to enforce required/forbidden wheel artifacts

- add CI workflow to build wheel, validate contents, test wheel install, and test editable install hook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup proper pip package

1 participant