mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
## Why The schema exporter sits on application builds' critical path, but compiling it as a test harness also compiles and registers unit tests that schema generation does not need. ## What changed Build the exporter with `--cfg=test` to retain test-only schema derives without the test harness, and disable its debug metadata. Run schema generation directly on a thread with an 8 MiB stack. Share the environment-driven schema writer with the existing ignored test, allow a configurable crate root in `schema_sources`, and switch the public schema bundle to the dedicated generator. GitOrigin-RevId: 317e24f77e153b9ba0c5c583837eed3bcd3774fd
18 lines
610 B
Rust
18 lines
610 B
Rust
//! Bazel schema exporter using the crate's test-only schema derives.
|
|
//!
|
|
//! Built with `--cfg=test` rather than `--test`: schema derives remain enabled,
|
|
//! while Rust omits `#[test]` functions and the libtest harness.
|
|
|
|
#![allow(dead_code, unused_imports)]
|
|
|
|
include!("src/lib.rs");
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
// Match the stack used by the existing libtest-based schema writer.
|
|
std::thread::Builder::new()
|
|
.stack_size(8 * 1024 * 1024)
|
|
.spawn(schema_fixtures::write_schema_fixtures_from_env)?
|
|
.join()
|
|
.unwrap_or_else(|panic| std::panic::resume_unwind(panic))
|
|
}
|