Add shared runtime build information (#37929)

## What changed

- Add `codex-build-info` to resolve a packaged runtime's semantic version from `codex-package.json` while preserving the commit stamped into the executable.
- Represent source builds as version `0.0.0` and expose helpers for display, serialization, and source-build detection.
- Stamp `STABLE_GIT_COMMIT` into final Bazel Rust binaries so Git changes do not invalidate the shared library graph.

## Testing

- Cover packaged, source, legacy, and invalid-version resolution, plus serialization round trips.

GitOrigin-RevId: 669b02449644c738ba2946a1b7aafe4ec31a9edb
This commit is contained in:
Adam Perry @ OpenAI authored and copyberry committed 2026-08-11 03:39:02 +00:00
1 parent 722784e936
commit 2cc9dbb984
7 files changed
+302 -1

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
[package]
edition.workspace = true
license.workspace = true
name = "codex-build-info"
version.workspace = true
[lib]
doctest = false
name = "codex_build_info"
path = "src/lib.rs"
[lints]
workspace = true
[dependencies]
codex-install-context = { workspace = true }
semver = { workspace = true, features = ["serde"] }
serde = { workspace = true, features = ["derive"] }
[dev-dependencies]
pretty_assertions = { workspace = true }
serde_json = { workspace = true }
tempfile = { workspace = true }