mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
* gnu/packages/patches/codex-0.98.0-remove-patch-sections.patch: New file. * gnu/packages/patches/rust-codex-0.98.0-test-shebangs.patch: New file. * gnu/packages/patches/rust-codex-0.98.0-test-timeout.patch: New file. * gnu/packages/patches/rust-codex-0.98.0-windows-sandbox-protocol-version.patch: New file. * gnu/local.mk (dist_patch_DATA): Add references to the patches. * gnu/packages/rust-apps.scm (codex): New variable. * gnu/packages/rust-crates.scm: Add crates. * gnu/packages/rust-sources.scm (rust-codex-0.98.0): New variable. Change-Id: Ic4af28034cbae83a7e212ee328cbdc25bce31ef0
57 lines
2.1 KiB
Diff
57 lines
2.1 KiB
Diff
Author: Danny Milosavljevic <dannym@friendly-machines.com>
|
|
Date: 2026-02-27
|
|
License: ASL2.0
|
|
Subject: Use @SHELL@ placeholder for shebangs in embedded test scripts.
|
|
|
|
Tests that create and execute temporary shell scripts at runtime use
|
|
a hardcoded "#!/bin/sh" shebang. Replace with @SHELL@ so the build
|
|
phase can substitute the actual store path.
|
|
|
|
Also change assertions to print the actual error on failure.
|
|
|
|
diff -ruN a/codex-rs/rmcp-client/src/program_resolver.rs b/codex-rs/rmcp-client/src/program_resolver.rs
|
|
--- a/codex-rs/rmcp-client/src/program_resolver.rs
|
|
+++ b/codex-rs/rmcp-client/src/program_resolver.rs
|
|
@@ -82,7 +82,7 @@
|
|
cmd.envs(&env.mcp_env);
|
|
|
|
let output = cmd.output().await;
|
|
- assert!(output.is_ok(), "Unix should execute scripts directly");
|
|
+ output.expect("Unix should execute scripts directly");
|
|
Ok(())
|
|
}
|
|
|
|
@@ -134,10 +134,7 @@
|
|
cmd.envs(&env.mcp_env);
|
|
let output = cmd.output().await;
|
|
|
|
- assert!(
|
|
- output.is_ok(),
|
|
- "Resolved program should execute successfully"
|
|
- );
|
|
+ output.expect("Resolved program should execute successfully");
|
|
Ok(())
|
|
}
|
|
|
|
@@ -185,7 +182,7 @@
|
|
#[cfg(unix)]
|
|
{
|
|
let file = dir.join(Self::TEST_PROGRAM);
|
|
- fs::write(&file, "#!/bin/sh\nexit 0")?;
|
|
+ fs::write(&file, "#!@SHELL@\nexit 0")?;
|
|
Self::set_executable(&file)?;
|
|
}
|
|
|
|
diff -ruN a/codex-rs/tui/src/external_editor.rs b/codex-rs/tui/src/external_editor.rs
|
|
--- a/codex-rs/tui/src/external_editor.rs
|
|
+++ b/codex-rs/tui/src/external_editor.rs
|
|
@@ -159,7 +159,7 @@
|
|
|
|
let dir = tempdir().unwrap();
|
|
let script_path = dir.path().join("edit.sh");
|
|
- fs::write(&script_path, "#!/bin/sh\nprintf \"edited\" > \"$1\"\n").unwrap();
|
|
+ fs::write(&script_path, "#!@SHELL@\nprintf \"edited\" > \"$1\"\n").unwrap();
|
|
let mut perms = fs::metadata(&script_path).unwrap().permissions();
|
|
perms.set_mode(0o755);
|
|
fs::set_permissions(&script_path, perms).unwrap();
|