Skip to content

Groundwork: make the source a cargo workspace - #157

Merged
nofuturekid merged 3 commits into
rebuildfrom
fix/146-groundwork-workspace
Nov 13, 2026
Merged

nofuturekid merged 3 commits into
rebuildfrom
fix/146-groundwork-workspace

Conversation

@nofuturekid

Copy link
Copy Markdown
Collaborator

Fixes #146

Stacked on #156 (the guards): this branch starts from fix/145-groundwork-guards, so the diff against rebuild shows #156's commits too until #156 has landed. Only the last commit, Make the source a cargo workspace, belongs to this pull request. Task 2 of the groundwork plan.

What changed

  • src/ becomes two crates. crates/obsbot-device (package obsbot-device, library obsbot_device) holds camera, commands, device, error, frame, presets, state, status, streaming and registry (was models.rs). crates/obsbot4linux holds main, cli, client, daemon and proto. Files move with git mv; the two guard tests and their fixtures move into the crates' tests/.
  • The root Cargo.toml is a virtual manifest: [workspace.package] (version 0.13.2, edition, rust-version, licence, authors, repository, homepage), [workspace.dependencies], [profile.release] strip = true.
  • crates/obsbot4linux/Cargo.toml keeps the package name, the binary name and the deb / rpm metadata, with ../../ asset paths.
  • lib.rs is laid out in four blank-line separated groups, one for each following task.
  • use paths: obsbot4linux:: becomes obsbot_device::, models becomes registry. Nothing else in the Rust code changes.
  • ci.yml and release.yml use --workspace; cargo deb -p obsbot4linux; cargo generate-rpm -p crates/obsbot4linux; crates/*/Cargo.toml is added to the release dry-run paths filter.
  • README (registry path), CONTRIBUTING (--workspace), one CHANGELOG line under Changed.
  • The program, its output and the packages do not change. No byte sent to the camera, no ioctl and no timing is touched.

Verification (local)

  • cargo fmt --check, cargo clippy --workspace --all-targets --locked -- -D warnings, shellcheck scripts/groundwork/*.sh scripts/package-contents.sh, actionlint .github/workflows/*.yml: no output.
  • cargo test --workspace --locked: 118 passed (library), 1 passed (byte_guard), 25 passed (binary), 2 passed (cli_surface), 0 doc tests. Same 146 tests as before.
  • G1: scripts/groundwork/test-names.sh for the base (12d9e0d) and the head gives 146 names each; comm -3 prints nothing.
  • G2 / G3: both fixtures are renames with 0 changed lines (git diff -M --stat).
  • G6: scripts/groundwork/move-check.sh <base> HEAD prints exactly the four changed code lines the plan lists (8 lines with the < / > pairs): models::from_card / from_by_id to registry::, obsbot4linux::device::detect and obsbot4linux::state::path to obsbot_device::.
  • G7: git diff -M --stat shows every moved file as a rename; device.rs 6 lines, lib.rs 13, byte_guard.rs 6, cli.rs 14, client.rs 4, daemon.rs 8 (use lines and the paths above).
  • Cargo.lock diff: adds the obsbot-device entry, changes the dependency list of obsbot4linux to clap, nix, obsbot-device, serde, serde_json. No other entry changes.
  • cargo metadata external crates and versions: diff against before is empty. name, version, license, description, homepage, repository, authors, edition, rust_version of obsbot4linux: diff empty.
  • cargo tree -e normal,build,features -p obsbot4linux: external crates and features, diff against before empty (97 lines).
  • cargo build --release --locked: file -b target/release/obsbot4linux ends in , stripped.
  • Packages are built by the release dry run of this pull request (G5, contents job against the unchanged packaging/contents.txt).
  • No camera was used; the binary was not run.

🤖 Generated with Claude Code

nofuturekid and others added 3 commits November 13, 2026 11:52
A byte guard records every frame and short command the builders emit for a fixed list of
calls, a CLI guard records the help text of every subcommand, and the release dry run lists
the files of every package. The workspace move must leave all three unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Taken from the package-contents artifact of the release dry run of this pull request: the
files of the deb, rpm, Arch and tarball packages for both architectures.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The library modules move to crates/obsbot-device, models.rs as registry.rs, and the 0.13 CLI
and daemon to crates/obsbot4linux, which keeps the package name, the binary and the package
metadata. Version, rust-version and licence come from [workspace.package]. No behaviour change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nofuturekid nofuturekid added the enhancement New feature or request label Nov 13, 2026
@nofuturekid
nofuturekid merged commit ce98ad9 into rebuild Nov 13, 2026
20 checks passed
@nofuturekid
nofuturekid deleted the fix/146-groundwork-workspace branch November 13, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant