chore: display version, git hash, and build date in meshagent #10

Merged
nrupard merged 1 commit from chore/version-display into main 2026-05-08 04:09:03 +02:00
Owner

Bake three build-time constants into the binary via build.rs so operators can confirm the exact tree a running agent was built from when troubleshooting:

  • MESHAGENT_VERSION - resolved release version. Mirrors oci-build/get-version.nu (exact tag -> 0.1.0, commits past tag -> 0.1.0-3-g1b66909, no tag -> 0.0.0-g<sha>) so the constant baked into the binary matches the Forgejo generic-package version published by CI.
  • MESHAGENT_GIT_HASH - short HEAD SHA, or unknown outside a git checkout.
  • MESHAGENT_BUILD_DATE - UTC build timestamp (YYYY-MM-DDTHH:MM:SSZ).

Wire-up:

  • meshagent --version prints all three (clap long_version).
  • The agent emits an info! line with all three at startup so the version is visible in journald/log aggregation without needing access to the binary itself.
  • The version/versions console command (host msg relay used by the MeshCentral SPA) reports all three plus the protocol agent-version u32.
  • host/msg.rs agent_version field now uses MESHAGENT_VERSION (git-describe) instead of CARGO_PKG_VERSION so the SPA's hardware-identifiers panel matches the published package version.

Dev container Dockerfile now marks /workspace as a safe.directory so the git-backed build script works against the bind-mounted host repo without the "dubious ownership" refusal.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Bake three build-time constants into the binary via `build.rs` so operators can confirm the exact tree a running agent was built from when troubleshooting: - `MESHAGENT_VERSION` - resolved release version. Mirrors `oci-build/get-version.nu` (exact tag -> `0.1.0`, commits past tag -> `0.1.0-3-g1b66909`, no tag -> `0.0.0-g<sha>`) so the constant baked into the binary matches the Forgejo generic-package version published by CI. - `MESHAGENT_GIT_HASH` - short HEAD SHA, or `unknown` outside a git checkout. - `MESHAGENT_BUILD_DATE` - UTC build timestamp (`YYYY-MM-DDTHH:MM:SSZ`). Wire-up: - `meshagent --version` prints all three (clap `long_version`). - The agent emits an `info!` line with all three at startup so the version is visible in journald/log aggregation without needing access to the binary itself. - The `version`/`versions` console command (host msg relay used by the MeshCentral SPA) reports all three plus the protocol agent-version u32. - `host/msg.rs` `agent_version` field now uses `MESHAGENT_VERSION` (git-describe) instead of `CARGO_PKG_VERSION` so the SPA's hardware-identifiers panel matches the published package version. Dev container Dockerfile now marks `/workspace` as a `safe.directory` so the git-backed build script works against the bind-mounted host repo without the "dubious ownership" refusal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore: display version, git hash, and build date in meshagent
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 3m29s
34d23b1177
Bake three build-time constants into the binary via `build.rs` so operators can confirm the exact tree a running agent was built from when troubleshooting:

- `MESHAGENT_VERSION` - resolved release version. Mirrors `oci-build/get-version.nu` (exact tag -> `0.1.0`, commits past tag -> `0.1.0-3-g1b66909`, no tag -> `0.0.0-g<sha>`) so the constant baked into the binary matches the Forgejo generic-package version published by CI.
- `MESHAGENT_GIT_HASH` - short HEAD SHA, or `unknown` outside a git checkout.
- `MESHAGENT_BUILD_DATE` - UTC build timestamp (`YYYY-MM-DDTHH:MM:SSZ`).

Wire-up:

- `meshagent --version` prints all three (clap `long_version`).
- The agent emits an `info!` line with all three at startup so the version is visible in journald/log aggregation without needing access to the binary itself.
- The `version`/`versions` console command (host msg relay used by the MeshCentral SPA) reports all three plus the protocol agent-version u32.
- `host/msg.rs` `agent_version` field now uses `MESHAGENT_VERSION` (git-describe) instead of `CARGO_PKG_VERSION` so the SPA's hardware-identifiers panel matches the published package version.

Dev container Dockerfile now marks `/workspace` as a `safe.directory` so the git-backed build script works against the bind-mounted host repo without the "dubious ownership" refusal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nrupard deleted branch chore/version-display 2026-05-08 04:09:03 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-agent!10
No description provided.