mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
Let build-deb.sh build with Cargo features, and mark the version when it does
A measurement run needs the .deb built with a non-default feature, and the script had no way to express that: its argument loop took only --target, --version and --no-build, and nothing forwarded a feature list or read one from the environment. --features <list> now forwards to cargo-deb's native -F. The marking is the half that is easy to skip and matters more. The auto-derived dev Version is built from the crate version, the commit date and the sha, none of which change when a feature is enabled, so an instrumented package and a default package of the same commit carried byte-identical versions. Two consequences, and the second is worse than the first: the node offers no way to tell which one it is running, and reverting is an install of a version already present, which no-ops silently and leaves the instrumented binary in place. That is precisely the failure the per-commit version was introduced to prevent, reappearing one level down. The Version now carries a +<features> marker, folded to dots since underscores and commas are not legal there. The marker sorts above the unmarked build, checked with dpkg --compare-versions rather than assumed, so installing a feature build is an upgrade and reverting is a downgrade: revert with dpkg -i, not apt install. The ~dev ordering below a tagged release is preserved. --features is refused together with --no-build, which would stamp the marker onto whatever binaries happened to be sitting in target/ while claiming the features had reached them. Verified end to end rather than by reading: a real --features profiling build produces a package whose fipsctl accepts the profile subcommand and whose daemon carries the capture-file header text that only exists under the feature gate. The release packaging path is untouched, shown by diffing the cargo invocation the old and new scripts produce across five argument shapes including the --version/--no-build pair the packaging workflow uses; all five are identical. Authored on master rather than maint, which takes bug fixes and CI or tooling changes but not new capability, so the three copies of this script now differ by design.
This commit is contained in:
@@ -21,6 +21,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
`LogsDirectory=fips` was added to the packaged systemd units so the capture
|
||||
directory is created and cleaned up declaratively.
|
||||
|
||||
- `packaging/debian/build-deb.sh --features <list>` builds the `.deb` with a
|
||||
Cargo feature list, which is how an instrumented package is produced for a
|
||||
measurement run. The auto-derived dev Version gains a matching `+<features>`
|
||||
marker, so a feature build and a default build of the same commit are no
|
||||
longer indistinguishable: without it the two carry byte-identical versions,
|
||||
an install of one over the other is an apt no-op, and the running node offers
|
||||
no way to tell which one it has. The marker sorts above the unmarked build, so
|
||||
installing a feature build is an upgrade and reverting to the default build is
|
||||
a downgrade — revert with `dpkg -i` rather than `apt install`. `--features` is
|
||||
refused together with `--no-build`, which would stamp the marker onto binaries
|
||||
the features never reached.
|
||||
|
||||
### Changed
|
||||
|
||||
- The Ethernet transport's per-interface `discovery` flag was renamed to
|
||||
|
||||
Reference in New Issue
Block a user