Merge branch 'build-stamped-version'
This commit is contained in:
commit
b3b9103f2f
18 files changed
+322
-18
No files matched your search
@@ -39,6 +39,15 @@ cargo build --release # target/release/slinuxm
|
||||
|
||||
Without devenv you need a Rust toolchain, `pkg-config` and the libsystemd development files.
|
||||
|
||||
### Version
|
||||
|
||||
The binary carries a build-stamped version, `YYYY.MM.DD-<branch>-<sha>` (for example `2026.10.21-main-435a54a`). `slinuxm --version`, `GET /healthz`, `GET /api/v1/ping`, the MCP server info and the OTel `service.version` attribute all report it. `Cargo.toml` keeps a semver `version`, which is what the OpenAPI document's `info.version` uses so that `docs/openapi.json` does not change on every commit.
|
||||
|
||||
- The date is the build day in UTC, the branch has every character outside `[A-Za-z0-9._-]` replaced by `-` (`feature/x` becomes `feature-x`, a detached HEAD becomes `detached`), and the sha is 7 characters, with `-dirty` appended when tracked files have uncommitted changes.
|
||||
- Without git (a source tarball) the missing parts are `unknown`.
|
||||
- `build.rs` reads `SLINUXM_GIT_SHA`, `SLINUXM_GIT_BRANCH` and `SLINUXM_BUILD_DATE` (`YYYY.MM.DD`) when set, and `SLINUXM_VERSION` replaces the whole string. `SOURCE_DATE_EPOCH` is ignored on purpose, because Nix dev shells export a fixed 1980 value.
|
||||
- `nix build` has no `.git`, so the flake passes the commit date and short rev, and the branch is the fixed placeholder `nix` (a flake does not know its branch). Override it with `pkgs.callPackage ./nix/package.nix { gitBranch = "main"; … }`.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
|
||||
Reference in new issue
Block a user