11 Commits

  • Ignore proc-macro-error2 advisory (#26974)
    ## Summary
    - ignore RUSTSEC-2026-0173 in cargo-deny and cargo-audit config
    - document that proc-macro-error2 is pulled in transitively via
    i18n-embed-fl/age/codex-secrets
    - leave the ignore temporary until codex-secrets moves off age or age
    drops i18n-embed-fl
    
    ## Validation
    - just fmt
    - cargo deny check --hide-inclusion-graph
  • windows: link MSVC release binaries with static CRT (#22905)
    ## Why
    
    Windows release artifacts currently import `VCRUNTIME140.dll` and
    `VCRUNTIME140_1.dll`. That becomes observable on clean Windows machines
    that do not already have the VC++ runtime available globally:
    
    - Desktop Store launches can fail after the app relocates `codex.exe`
    out of `WindowsApps`, which means an MSIX-level VCLibs dependency does
    not protect the relocated CLI/app-server process.
    - The npm CLI path reproduces the same missing-DLL startup failure when
    `System32\vcruntime140_1.dll` is hidden and `PATH` is stripped of
    incidental fallback copies.
    
    In that setup, the existing Windows binary exits with `0xC0000135` /
    `-1073741515` before Codex code runs.
    
    ## What changed
    
    - Add `-C target-feature=+crt-static` to the existing MSVC-only Cargo
    rustflags in `codex-rs/.cargo/config.toml`.
    - Preserve the existing `/STACK:8388608` linker setting in the same
    target block.
    
    This keeps the change scoped to Windows MSVC builds and avoids altering
    non-Windows or GNU target behavior.
    
    ## Verification
    
    I built an x64 Windows release probe with static CRT linkage and the
    normal 8 MiB stack reserve, then verified:
    
    - `dumpbin /dependents codex.exe` no longer reports `VCRUNTIME140.dll`
    or `VCRUNTIME140_1.dll`.
    - `dumpbin /headers codex.exe` reports `800000 size of stack reserve`.
    - With `System32\vcruntime140_1.dll` hidden and `PATH` stripped to
    Windows system directories only:
      - the old npm CLI path exits `-1073741515`
    - the rebuilt static-CRT `codex.exe --version` succeeds with exit code
    `0`
      - the rebuilt TUI starts successfully
    
    I also confirmed `codex.exe app-server --listen ws://127.0.0.1:0` starts
    and binds normally with the static-CRT artifact.
  • fix: cargo deny (#20627)
    Fix cargo deny by ack the `RUSTSEC` while a fix land
    ```
      RUSTSEC-2026-0118
      NSEC3 closest-encloser proof validation enters unbounded loop on cross-zone responses
    
      RUSTSEC-2026-0119
      CPU exhaustion during message encoding due to O(n²) name compression
    
      Dependency path:
    
      hickory-proto 0.25.2
      └── hickory-resolver 0.25.2
          └── rama-dns 0.3.0-alpha.4
              └── rama-tcp 0.3.0-alpha.4
                  └── codex-network-proxy
    ```
    
    Also upgrade some workers version to prevent this:
    ```
    warning[license-not-encountered]: license was not encountered
        ┌─ ./codex-rs/deny.toml:131:6
        │
    131 │     "OpenSSL",
        │      ━━━━━━━ unmatched license allowance
    
    warning[duplicate]: found 2 duplicate entries for crate 'base64'
       ┌─ /github/workspace/codex-rs/Cargo.lock:79:1
       │
    79 │ ╭ base64 0.21.7 registry+https://github.com/rust-lang/crates.io-index
    80 │ │ base64 0.22.1 registry+https://github.com/rust-lang/crates.io-index
       │ ╰───────────────────────────────────────────────────────────────────┘ lock entries
    ```
  • [codex] Fix current main CI blockers (#17917)
    ## Summary
    - Fix marketplace-add local path detection on Windows by using
    `Path::is_absolute()`.
    - Make marketplace-add local-source tests parse/write TOML through the
    same helpers instead of raw string matching.
    - Update `rand` 0.9.x to 0.9.3 and document the remaining audited `rand`
    0.8.5 advisory exception.
    - Refresh `MODULE.bazel.lock` after the Cargo.lock update.
    
    ## Why
    Latest `main` had two independent CI blockers: marketplace-add tests
    were not portable to Windows path/TOML escaping, and cargo-deny still
    reported `RUSTSEC-2026-0097` after the recent rustls-webpki fix.
    
    ## Validation
    - `cargo test -p codex-core marketplace_add -- --nocapture`
    - `cargo deny --all-features check`
    - `just bazel-lock-check`
    - `just fix -p codex-core`
    - `just fmt`
    - `git diff --check`
  • fix: pin inputs (#17471)
    ## Summary
    - Pin Rust git patch dependencies to immutable revisions and make
    cargo-deny reject unknown git and registry sources unless explicitly
    allowlisted.
    - Add checked-in SHA-256 coverage for the current rusty_v8 release
    assets, wire those hashes into Bazel, and verify CI override downloads
    before use.
    - Add rusty_v8 MODULE.bazel update/check tooling plus a Bazel CI guard
    so future V8 bumps cannot drift from the checked-in checksum manifest.
    - Pin release/lint cargo installs and all external GitHub Actions refs
    to immutable inputs.
    
    ## Future V8 bump flow
    Run these after updating the resolved `v8` crate version and checksum
    manifest:
    
    ```bash
    python3 .github/scripts/rusty_v8_bazel.py update-module-bazel
    python3 .github/scripts/rusty_v8_bazel.py check-module-bazel
    ```
    
    The update command rewrites the matching `rusty_v8_<crate_version>`
    `http_file` SHA-256 values in `MODULE.bazel` from
    `third_party/v8/rusty_v8_<crate_version>.sha256`. The check command is
    also wired into Bazel CI to block drift.
    
    ## Notes
    - This intentionally excludes RustSec dependency upgrades and
    bubblewrap-related changes per request.
    - The branch was rebased onto the latest origin/main before opening the
    PR.
    
    ## Validation
    - cargo fetch --locked
    - cargo deny check advisories
    - cargo deny check
    - cargo deny check sources
    - python3 .github/scripts/rusty_v8_bazel.py check-module-bazel
    - python3 .github/scripts/rusty_v8_bazel.py update-module-bazel
    - python3 -m unittest discover -s .github/scripts -p
    'test_rusty_v8_bazel.py'
    - python3 -m py_compile .github/scripts/rusty_v8_bazel.py
    .github/scripts/rusty_v8_module_bazel.py
    .github/scripts/test_rusty_v8_bazel.py
    - repo-wide GitHub Actions `uses:` audit: all external action refs are
    pinned to 40-character SHAs
    - yq eval on touched workflows and local actions
    - git diff --check
    - just bazel-lock-check
    
    ## Hash verification
    - Confirmed `MODULE.bazel` hashes match
    `third_party/v8/rusty_v8_146_4_0.sha256`.
    - Confirmed GitHub release asset digests for denoland/rusty_v8
    `v146.4.0` and openai/codex `rusty-v8-v146.4.0` match the checked-in
    hashes.
    - Streamed and SHA-256 hashed all 10 `MODULE.bazel` rusty_v8 asset URLs
    locally; every downloaded byte stream matched both `MODULE.bazel` and
    the checked-in manifest.
    
    ## Pin verification
    - Confirmed signing-action pins match the peeled commits for their tag
    comments: `sigstore/cosign-installer@v3.7.0`, `azure/login@v2`, and
    `azure/trusted-signing-action@v0`.
    - Pinned the remaining tag-based action refs in Bazel CI/setup:
    `actions/setup-node@v6`, `facebook/install-dotslash@v2`,
    `bazelbuild/setup-bazelisk@v3`, and `actions/cache/restore@v5`.
    - Normalized all `bazelbuild/setup-bazelisk@v3` refs to the peeled
    commit behind the annotated tag.
    - Audited Cargo git dependencies: every manifest git dependency uses
    `rev` only, every `Cargo.lock` git source has `?rev=<sha>#<same-sha>`,
    and `cargo deny check sources` passes with `required-git-spec = "rev"`.
    - Shallow-fetched each distinct git dependency repo at its pinned SHA
    and verified Git reports each object as a commit.
  • chore(ci): add cargo audit workflow and policy (#7108)
    - add to ignore current unmaintained advisories (derivative, fxhash,
    paste) so audits gate new issues only
    - introduce GitHub Actions workflow to run on push/PR using to install
    cargo-audit
    
    Existing advisories (all "unmaintained"):
    - https://rustsec.org/advisories/RUSTSEC-2024-0388
    - https://rustsec.org/advisories/RUSTSEC-2025-0057
    - https://rustsec.org/advisories/RUSTSEC-2024-0436
  • build: 8mb stacks on win (#5997)
    #5981 seems to be fixing what's actually a call stack overflow, maybe
    this will fix it without disabling a feature?