You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
: add generated build info module with commit hash and metadata (#1738)
Summary:
this diff adds an experimental [build identity module](https://www.internalfb.com/phabricator/paste/view/P2018151567) to hyperactor_mesh.
at buck build time we generate a rust module ("build_info.rs") with four values: sapling changeset hash, build timestamp, user, and host. the file is not checked in; it is produced in buck-out and added to the crate via `mapped_srcs`. cargo / oss builds do not see it. fbcode builds get a new `hyperactor_mesh::build_info` module (behind `#[cfg(fbcode_build)]`) that exposes `commit()`, `timestamp()`, `user()`, and `host()`. each of those returns a `&'static str` baked in at build time. no syscalls or runtime i/o.
the module can also register these values into the global config/attrs registry. calling `init()` installs `BUILD_COMMIT`, `BUILD_TIMESTAMP`, `BUILD_USER`, and `BUILD_HOST` into process-wide `Attrs` via `hyperactor::config::global`. callsites that only need to compare versions (e.g. host/proc handshake) can read `commit()` directly. code that wants to surface this via logs or admin endpoints can call `init()` once and query the global config.
this is buck-only. we do not add a `build.rs`, we do not write into the source tree, and cargo builds are unchanged.
rfc: host/child handshake will start comparing `commit()` at startup and warn or fail on mismatch.
Differential Revision: D86009410
0 commit comments