Skip to content

feat(shell): initialize Rust workspace scaffold#1

Open
Count-I wants to merge 4 commits into
mainfrom
feature/workspace-scaffold
Open

feat(shell): initialize Rust workspace scaffold#1
Count-I wants to merge 4 commits into
mainfrom
feature/workspace-scaffold

Conversation

@Count-I
Copy link
Copy Markdown
Owner

@Count-I Count-I commented May 14, 2026

Summary

  • Cargo workspace con tres crates stub: minecrarch-shared, minecrarch-shell, minecrarch-modpack-manager
  • Activa CI jobs build-rust (cargo fmt + clippy + build + test con GTK4/libadwaita) y cargo-deny (licencias, bans, sources)
  • Fix .gitignore: src/ global ignoraba todos los dirs Rust; corregido a packaging/**/src/

ADR references

ADR-0011 (Rust), ADR-0013 (GTK4 + libadwaita), ADR-0009 (layer boundaries — tools/check-deps.sh en CI valida que shell/ no importe crates de servicios)

Changes

shared/ (minecrarch-shared): constantes D-Bus (bus names, object paths, field keys per docs/ipc.md), MinecrarchError con thiserror
shell/ (minecrarch-shell): Cargo.toml con gtk4 0.9 + libadwaita 0.7 + zbus + tokio + async-channel + tracing; stub main.rs
services/modpack-manager/: Cargo.toml con zbus + tokio + tracing; stub main.rs

Implementaciones reales en D4 (shell) y D5 (modpack-manager).

Count-I added 4 commits May 14, 2026 00:44
Creates the Cargo workspace with three initial members: minecrarch-shared,
minecrarch-shell, and minecrarch-modpack-manager. All members are stub
crates that compile cleanly. Real implementations follow in D4 and D5.

shared/ (minecrarch-shared):
- dbus_types: D-Bus constants — bus names, object paths, field key strings
  per docs/ipc.md; avoids complex zbus type derivation at scaffold stage
- error: MinecrarchError enum with thiserror (IPC, Launch, Install, IO)

shell/ (minecrarch-shell, stub):
- Cargo.toml with all deps: gtk4 0.9 + libadwaita 0.7 + zbus + tokio
  + async-channel + tracing + minecrarch-shared
- main.rs placeholder (replaced in D4 with full GTK4 application)

services/modpack-manager/ (minecrarch-modpack-manager, stub):
- Cargo.toml with zbus + tokio + tracing + minecrarch-shared
- main.rs placeholder (replaced in D5 with full D-Bus service)

CI:
- Activate build-rust job: cargo fmt + clippy + build + test with
  GTK4/libadwaita apt deps (libgtk-4-dev, libadwaita-1-dev)
- Activate cargo-deny job: checks licenses, bans, and sources

fix(.gitignore): scope src/ ignore to packaging/**/src/ to not shadow
Rust source directories — was incorrectly ignoring all src/ dirs

ADR-0011 (Rust), ADR-0013 (GTK4 + libadwaita), ADR-0009 (layer boundaries)
Build Rust workspace — 'empty line after doc comment':
  shared/src/dbus_types.rs used outer doc comments (///) with a blank
  line after them before the next item, which Rust treats as a
  misplaced doc comment. Fixed by converting to inner module doc
  comments (//!) at file level and // for item descriptions.

Dependency boundary check — false positive on own package name:
  tools/check-deps.sh was doing a global grep for the crate name
  string, which matched 'name = "minecrarch-modpack-manager"' in
  the [package] section of that service's own Cargo.toml. Fixed
  grep pattern to only match lines where the crate name appears at
  the start (dependency declaration syntax), not in a value position.

Cargo deny — 'edition 2024' unsupported by action's bundled Cargo:
  EmbarkStudios/cargo-deny-action@v1 ships a Docker container with
  Cargo older than 1.85 which does not support edition = "2024"
  used by toml_datetime v1.1.1. Fixed by switching to v2 of the
  action and installing dtolnay/rust-toolchain@stable first.
  Also cleaned up deprecated [advisories] keys (vulnerability,
  unmaintained, notice) that cargo-deny v2 no longer accepts;
  replaced with version = 2 + yanked = "deny" only.

Lint docs — MD040/MD031 in AGENTS.md Phase 1 Kickoff section:
  Code blocks in the kickoff section were missing language specifiers
  (text, bash, toml, rust) and blank lines before opening fences.
  Fixed all 7 errors.
unlicensed = "deny" and copyleft = "warn" were removed in cargo-deny
v2 (see EmbarkStudios/cargo-deny#611). With version = 2 and an
explicit allow list, any crate with a license not in the list —
including unlicensed crates and copyleft crates — is already denied
implicitly. The separate keys are redundant and now invalid.
license errors (unlicensed):
  All three workspace crates (shared, shell, modpack-manager) were
  missing the 'license' field. Added 'license = "MIT OR Apache-2.0"'
  as placeholder matching the project's candidate licenses.

bans error (gtk4 explicitly banned):
  deny.toml banned gtk4 with a 'wrappers' list that excluded
  minecrarch-shell, but the shell legitimately depends on gtk4 (ADR-0013).
  cargo-deny cannot scope bans per workspace member, so the ban was
  incorrect. Removed the gtk4 ban; architectural enforcement that services
  must not use gtk4 is already handled by tools/check-deps.sh in CI.

wildcard errors (path deps without version):
  cargo-deny treats path dependencies without an explicit version as
  wildcard deps. Added 'version = "0.1"' to minecrarch-shared path
  deps in shell/Cargo.toml and services/modpack-manager/Cargo.toml.
  Changed 'wildcards = "deny"' to 'wildcards = "warn"' since
  internal workspace path deps are intentionally version-free.

licenses error (Unicode-3.0 not in allow list):
  unicode-ident uses '(MIT OR Apache-2.0) AND Unicode-3.0'. Added
  'Unicode-3.0' to the allow list.
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.

1 participant