Use Bazel's --workspace_status_command mechanism to populate
OPENROAD_VERSION and OPENROAD_GIT_DESCRIBE in the Version.hh header.
With the default --nostamp (dev builds) STABLE_GIT_VERSION is empty,
so the genrule output is deterministic and the Bazel cache is never
invalidated on commits. With --stamp (or --config=release) the script
runs `git describe` and embeds the real version string, e.g.
26Q1-1485-g51d4ea27c3, without requiring a full rebuild.
Usage:
# Development build (cache-safe, version shows "bazel-nostamp"):
bazel build //...
# Release build (real git version embedded, e.g. "26Q1-1485-g51d4ea27c3"):
bazel build --config=release //:openroad
# Check the embedded version at runtime:
./bazel-bin/openroad -version
Fixes#7140.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>