2025-07-11 13:30:11 -04:00
|
|
|
[package]
|
|
|
|
|
name = "codex-chatgpt"
|
2025-11-24 12:22:18 -08:00
|
|
|
version.workspace = true
|
|
|
|
|
edition.workspace = true
|
|
|
|
|
license.workspace = true
|
2025-07-11 13:30:11 -04:00
|
|
|
|
|
|
|
|
[lints]
|
|
|
|
|
workspace = true
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
2025-09-22 18:47:01 +02:00
|
|
|
anyhow = { workspace = true }
|
|
|
|
|
clap = { workspace = true, features = ["derive"] }
|
|
|
|
|
codex-core = { workspace = true }
|
2026-02-11 04:59:24 -08:00
|
|
|
codex-utils-cli = { workspace = true }
|
feat: introduce find_resource! macro that works with Cargo or Bazel (#8879)
To support Bazelification in https://github.com/openai/codex/pull/8875,
this PR introduces a new `find_resource!` macro that we use in place of
our existing logic in tests that looks for resources relative to the
compile-time `CARGO_MANIFEST_DIR` env var.
To make this work, we plan to add the following to all `rust_library()`
and `rust_test()` Bazel rules in the project:
```
rustc_env = {
"BAZEL_PACKAGE": native.package_name(),
},
```
Our new `find_resource!` macro reads this value via
`option_env!("BAZEL_PACKAGE")` so that the Bazel package _of the code
using `find_resource!`_ is injected into the code expanded from the
macro. (If `find_resource()` were a function, then
`option_env!("BAZEL_PACKAGE")` would always be
`codex-rs/utils/cargo-bin`, which is not what we want.)
Note we only consider the `BAZEL_PACKAGE` value when the `RUNFILES_DIR`
environment variable is set at runtime, indicating that the test is
being run by Bazel. In this case, we have to concatenate the runtime
`RUNFILES_DIR` with the compile-time `BAZEL_PACKAGE` value to build the
path to the resource.
In testing this change, I discovered one funky edge case in
`codex-rs/exec-server/tests/common/lib.rs` where we have to _normalize_
(but not canonicalize!) the result from `find_resource!` because the
path contains a `common/..` component that does not exist on disk when
the test is run under Bazel, so it must be semantically normalized using
the [`path-absolutize`](https://crates.io/crates/path-absolutize) crate
before it is passed to `dotslash fetch`.
Because this new behavior may be non-obvious, this PR also updates
`AGENTS.md` to make humans/Codex aware that this API is preferred.
2026-01-07 18:06:08 -08:00
|
|
|
codex-utils-cargo-bin = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
serde = { workspace = true, features = ["derive"] }
|
|
|
|
|
serde_json = { workspace = true }
|
|
|
|
|
tokio = { workspace = true, features = ["full"] }
|
2025-10-29 12:11:44 +00:00
|
|
|
codex-git = { workspace = true }
|
2026-01-28 19:51:58 -08:00
|
|
|
urlencoding = { workspace = true }
|
2025-07-11 13:30:11 -04:00
|
|
|
|
|
|
|
|
[dev-dependencies]
|
2026-01-28 19:51:58 -08:00
|
|
|
pretty_assertions = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
tempfile = { workspace = true }
|