//! Build script that captures the Rust compiler version at build time.
//!
//! Rust has no stable runtime API for querying its own version, so the closest analogue to a
//! "language/runtime version" for the `User-Agent` header is the compiler that built the crate.
//! We run `rustc --version` here and expose the semver (e.g. `1.94.1`) as the `BUILD_RUSTC_VERSION`
//! compile-time env var, read via `env!`/`option_env!` in `src/common.rs`.
use Command;
/// Runs `rustc --version` and extracts the semver token (e.g. `1.94.1` from
/// `rustc 1.94.1 (abc 2026-01-01)`). Returns `None` if rustc cannot be invoked or parsed.