Commit Graph

2 Commits

Author SHA1 Message Date
Øyvind Harboe
e294555cc7 Update tools/workspace_status.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-01 18:56:59 +01:00
Øyvind Harboe
0c5482a1a0 bazel: embed git version via workspace stamping
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>
2026-03-01 17:48:04 +01:00