Skip to content

Development

Hyacinthe-primus edited this page Nov 12, 2026 · 2 revisions

Development

CLI

cd gatecore-cli
cargo build --release --locked
cargo test --locked
cargo clippy --locked --all-targets
cargo doc --no-deps --open

Linux needs libudev-dev and pkg-config. Cargo.lock is committed; use --locked so a local build matches CI. The minimum supported Rust version is 1.90, declared in gatecore-cli/Cargo.toml and tested in CI.

Release builds use thin LTO, one codegen unit and stripped symbols.

The code is split into a library and a thin binary. Start with src/lib.rs for the module map, src/cli.rs for command definitions, src/protocol.rs for the wire messages, and tests/device_sim.rs for the firmware simulator.

Adding a command

  1. Add a variant to Command in gatecore-cli/src/cli.rs. One-shot mode and the shell both use it, including the help text and clap validation.
  2. Add the handler under gatecore-cli/src/commands/ and route it in commands::run.
  3. If the command needs a new wire message, add a Request variant in gatecore-cli/src/protocol.rs and handle it in SystemController::handleSerialMessage_.
  4. Add a simulator test in tests/device_sim.rs, then update the CLI Guide and the protocol specification.

Firmware

Build with the Arduino IDE or the upload scripts in gatecore-firmware/; see Firmware Setup. CI compiles the sketch for the ESP32-S3, but there are no host-side firmware tests. Card reads, renewal, scan, import and sync still need a smoke test on a real board.

Continuous integration

The workflows live in .github/workflows/.

Workflow Trigger What it does
gatecore-cli.yml Changes under gatecore-cli/** or the workflow file cargo test --locked on Ubuntu, Windows and macOS with stable Rust; cargo test --locked on Rust 1.90; clippy (advisory)
gatecore-firmware.yml Changes under gatecore-firmware/** or the workflow file Installs the ESP32 core and libraries, then compiles for the ESP32-S3 with the uploader FQBN
release.yml A tag matching v* Builds Windows x64, Linux x64, macOS arm64 and macOS x64 archives with SHA-256 files

Cutting a release

  1. Bump version in gatecore-cli/Cargo.toml, then run cargo update --workspace so Cargo.lock follows. A --locked build fails if the two disagree.

  2. Update the Changelog and the current-version lines in _Footer.md, Home.md and README.md.

  3. Tag and push:

    git tag v2.0.1
    git push origin v2.0.1

The release workflow rejects a tag that does not match gatecore-cli/Cargo.toml. Tags follow the CLI version. The firmware version is separate and is not part of the release assets.

Clone this wiki locally