1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-06-28 09:14:05 +02:00
Files
guix/gnu/packages/patches/rust-codex-0.120.0-connectors-cache-test-race.patch
Danny Milosavljevic 23377537da gnu: (codex, codex-acp): Update to 0.120.0 and 0.11.1.
* gnu/packages/codex.scm (codex): Update to 0.120.0.
[source]: Adjust patches.
[arguments]: Adjust cargo-install-paths, cargo-test-flags, and
cargo-package-crates.
[arguments]<#:phases>{patch-git-deps-to-vendor,patch-hardcoded-paths,
set-bubblewrap-source,create-node-version-file,set-home}: Adjust for
the new workspace and test environment.
[native-inputs]: Add bubblewrap, bubblewrap-source, lsof,
nss-certs-for-test, and procps.
[inputs]: Add libcap, oniguruma, and zlib.
[description]: Mention that codex-code-mode's V8 Javascript executor is
disabled.
(codex-acp): Update to 0.11.1.
[source]: Adjust patches and source hash.
[arguments]<#:phases>{patch-codex-deps}: Rewrite the codex dependency
for rust-v0.117.0, disable codex-code-mode's V8 runtime, and set
CODEX_BWRAP_SOURCE_DIR.
[arguments]<#:phases>{set-home}: Set HOME and USER.
[arguments]<#:phases>{create-node-version-file}: Create node-version.txt.
[native-inputs]: Add cmake-minimal, clang, and bubblewrap-source.
[inputs]: Add libcap and zlib.
* gnu/packages/rust-sources.scm (rust-deunicode-1.6.2.cfb8552): New
variable.
(rust-codex-0.117.0, rust-codex-0.120.0): New variables.
* gnu/packages/rust-crates.scm (rust-deunicode-1.6.2,
rust-deunicode-1.6.2.cfb8552): Define aliases for the new workspace
package.
(lookup-cargo-inputs): Update entries for codex, codex-acp, and
rust-codex-0.0.0.785c0c43. Add rust-deunicode-1.6.2.cfb8552.
* gnu/packages/patches/codex-acp-0.11.1-disable-code-mode.patch,
gnu/packages/patches/codex-acp-0.11.1-remove-patch-sections.patch,
gnu/packages/patches/rust-codex-0.117.0-core-remove-self-dep.patch,
gnu/packages/patches/rust-codex-0.117.0-remove-patch-sections.patch,
gnu/packages/patches/rust-codex-0.120.0-connectors-cache-test-race.patch,
gnu/packages/patches/rust-codex-0.120.0-core-remove-self-dep.patch,
gnu/packages/patches/rust-codex-0.120.0-remove-libwebrtc.patch,
gnu/packages/patches/rust-codex-0.120.0-test-timeout.patch: New files.
* gnu/packages/patches/codex-acp-0.9.2-remove-patch-sections.patch,
gnu/packages/patches/codex-acp-0.9.2-replace-result-flatten.patch:
Delete files.
* gnu/local.mk (dist_patch_DATA): Register the new patches.

Change-Id: I280a752507f40e525243dcb869c264da96605bd7
2026-04-23 07:19:23 +02:00

27 lines
1.1 KiB
Diff

Author: Danny Milosavljevic <dannym@friendly-machines.com>
Date: 2026-04-14
License: ASL2.0
Subject: Fix race condition in codex-connectors cache test.
ALL_CONNECTORS_CACHE is a single global Option, not a map. When Rust's
test runner executes tests in parallel, the
list_all_connectors_merges_and_normalizes_directory_apps test can
overwrite the cache entry between the two calls in
list_all_connectors_uses_shared_cache, causing a key mismatch and a
spurious "cache should have been used" failure.
Fix by clearing the cache at the start of the cache test so it does not
depend on execution order relative to other tests.
--- a/codex-rs/connectors/src/lib.rs
+++ b/codex-rs/connectors/src/lib.rs
@@ -441,6 +441,9 @@
#[tokio::test]
async fn list_all_connectors_uses_shared_cache() -> anyhow::Result<()> {
+ // Clear any stale cache entry left by a concurrently running test.
+ *ALL_CONNECTORS_CACHE.lock().unwrap() = None;
+
let calls = Arc::new(AtomicUsize::new(0));
let call_counter = Arc::clone(&calls);
let key = cache_key("shared");