Let the CLI compile for Windows again

3b16e0679b4c · AtlantisPleb · · parent 3d29337200b1

Let the CLI compile for Windows again

`ops/release-cli.sh` declares seven platforms and `windows-x86_64` did not
build: `process_group` is a Unix extension on `Command`, and two call sites
invoked it unconditionally, so the whole crate failed with `no method named
process_group` plus four cascading inference errors from the chain it broke.

`tools.rs` and `computer.rs` already guarded theirs with `#[cfg(unix)]`. These
two did not, and nothing caught it because no test and no gate builds a Windows
target — the release script is the only thing that does, and it reports a
missing platform rather than a failure, so it looked like a toolchain gap.

Both are guarded the same way `computer.rs` does it, which also forced the
chains apart so the intent reads: build the command, then set the group where
that means something.

Verified by building the target: `PE32+ executable (console) x86-64, for MS
Windows`. The host toolchain also needed `mingw-w64` for `dlltool`, which is a
machine prerequisite rather than a repository change; the script's own error
was clear enough to name it.

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified crates/openagents-cli/src/acp.rs
  • modified crates/openagents-cli/src/delegate.rs

Diff

2 files changed, +20 -8

crates/openagents-cli/src/acp.rs modified +10 -4

@@ -279,10 +279,16 @@ impl AcpHarness {

279 279
            .current_dir(cwd)
280 280
            .stdin(Stdio::piped())
281 281
            .stdout(Stdio::piped())
282
            .stderr(Stdio::piped())
283
            // Its own process group, so stopping the child stops what the
284
            // child started.
285
            .process_group(0);
282
            .stderr(Stdio::piped());
283
        // Its own process group, so stopping the child stops what the child
284
        // started. `process_group` is a Unix extension and does not exist on
285
        // Windows, where the whole crate fails to compile if it is called
286
        // unconditionally.
287
        #[cfg(unix)]
288
        {
289
            use std::os::unix::process::CommandExt;
290
            command.process_group(0);
291
        }
286 292
        if let Some(environment) = &self.env {
287 293
            command.env_clear().envs(environment.iter().cloned());
288 294
        }
crates/openagents-cli/src/delegate.rs modified +10 -4

@@ -696,7 +696,8 @@ async fn run_cli_child(

696 696
    let id = task.id;
697 697
    let (command, args) = harness_command(lane, &task.prompt, &workspace.path, options);
698 698
699
    let mut child = match Command::new(&command)
699
    let mut spawn = Command::new(&command);
700
    spawn
700 701
        .args(&args)
701 702
        .envs(options.child_env())
702 703
        .current_dir(&workspace.path)

@@ -704,10 +705,15 @@ async fn run_cli_child(

704 705
        // than a wait nobody can see.
705 706
        .stdin(Stdio::null())
706 707
        .stdout(Stdio::piped())
707
        .stderr(Stdio::piped())
708
        .process_group(0)
709
        .spawn()
708
        .stderr(Stdio::piped());
709
    // Its own process group, so cancelling a fan-out stops what the children
710
    // started. `process_group` is a Unix extension and is absent on Windows.
711
    #[cfg(unix)]
710 712
    {
713
        use std::os::unix::process::CommandExt;
714
        spawn.process_group(0);
715
    }
716
    let mut child = match spawn.spawn() {
711 717
        Ok(child) => child,
712 718
        Err(error) => {
713 719
            let why = if error.kind() == std::io::ErrorKind::NotFound {

This page updates live while a promote is in flight · changelog