Skip to content

Commit 0bf1f61

Browse files
bbornclaude
andcommitted
Fix Windows build: extract Unix-only signals behind build tags
syscall.SIGTSTP and syscall.SIGCONT don't exist on Windows, causing the GoReleaser Windows build to fail. Extract signal calls into platform-specific files using build tags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 97d2caf commit 0bf1f61

File tree

7 files changed

+42
-10
lines changed

7 files changed

+42
-10
lines changed

internal/executor/codex_executor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func (c *CodexExecutor) Suspend(taskID int64) bool {
295295
return false
296296
}
297297

298-
if err := proc.Signal(syscall.SIGTSTP); err != nil {
298+
if err := sendSIGTSTP(proc); err != nil {
299299
c.logger.Debug("Failed to suspend process", "pid", pid, "error", err)
300300
return false
301301
}
@@ -331,7 +331,7 @@ func (c *CodexExecutor) ResumeProcess(taskID int64) bool {
331331
return false
332332
}
333333

334-
if err := proc.Signal(syscall.SIGCONT); err != nil {
334+
if err := sendSIGCONT(proc); err != nil {
335335
c.logger.Debug("Failed to resume process", "pid", pid, "error", err)
336336
return false
337337
}

internal/executor/executor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ func (e *Executor) SuspendTask(taskID int64) bool {
362362
return false
363363
}
364364

365-
if err := proc.Signal(syscall.SIGTSTP); err != nil {
365+
if err := sendSIGTSTP(proc); err != nil {
366366
e.logger.Debug("Failed to suspend process", "pid", pid, "error", err)
367367
return false
368368
}
@@ -405,7 +405,7 @@ func (e *Executor) ResumeTask(taskID int64) bool {
405405
return false
406406
}
407407

408-
if err := proc.Signal(syscall.SIGCONT); err != nil {
408+
if err := sendSIGCONT(proc); err != nil {
409409
e.logger.Debug("Failed to resume process", "pid", pid, "error", err)
410410
return false
411411
}

internal/executor/gemini_executor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (g *GeminiExecutor) Suspend(taskID int64) bool {
233233
g.logger.Debug("Failed to find process", "pid", pid, "error", err)
234234
return false
235235
}
236-
if err := proc.Signal(syscall.SIGTSTP); err != nil {
236+
if err := sendSIGTSTP(proc); err != nil {
237237
g.logger.Debug("Failed to suspend process", "pid", pid, "error", err)
238238
return false
239239
}
@@ -264,7 +264,7 @@ func (g *GeminiExecutor) ResumeProcess(taskID int64) bool {
264264
delete(g.suspendedTasks, taskID)
265265
return false
266266
}
267-
if err := proc.Signal(syscall.SIGCONT); err != nil {
267+
if err := sendSIGCONT(proc); err != nil {
268268
g.logger.Debug("Failed to resume process", "pid", pid, "error", err)
269269
return false
270270
}

internal/executor/openclaw_executor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func (o *OpenClawExecutor) Suspend(taskID int64) bool {
257257
o.logger.Debug("Failed to find process", "pid", pid, "error", err)
258258
return false
259259
}
260-
if err := proc.Signal(syscall.SIGTSTP); err != nil {
260+
if err := sendSIGTSTP(proc); err != nil {
261261
o.logger.Debug("Failed to suspend process", "pid", pid, "error", err)
262262
return false
263263
}
@@ -288,7 +288,7 @@ func (o *OpenClawExecutor) ResumeProcess(taskID int64) bool {
288288
delete(o.suspendedTasks, taskID)
289289
return false
290290
}
291-
if err := proc.Signal(syscall.SIGCONT); err != nil {
291+
if err := sendSIGCONT(proc); err != nil {
292292
o.logger.Debug("Failed to resume process", "pid", pid, "error", err)
293293
return false
294294
}

internal/executor/opencode_executor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func (o *OpenCodeExecutor) Suspend(taskID int64) bool {
250250
o.logger.Debug("Failed to find process", "pid", pid, "error", err)
251251
return false
252252
}
253-
if err := proc.Signal(syscall.SIGTSTP); err != nil {
253+
if err := sendSIGTSTP(proc); err != nil {
254254
o.logger.Debug("Failed to suspend process", "pid", pid, "error", err)
255255
return false
256256
}
@@ -281,7 +281,7 @@ func (o *OpenCodeExecutor) ResumeProcess(taskID int64) bool {
281281
delete(o.suspendedTasks, taskID)
282282
return false
283283
}
284-
if err := proc.Signal(syscall.SIGCONT); err != nil {
284+
if err := sendSIGCONT(proc); err != nil {
285285
o.logger.Debug("Failed to resume process", "pid", pid, "error", err)
286286
return false
287287
}

internal/executor/signal_unix.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//go:build !windows
2+
3+
package executor
4+
5+
import (
6+
"os"
7+
"syscall"
8+
)
9+
10+
func sendSIGTSTP(proc *os.Process) error {
11+
return proc.Signal(syscall.SIGTSTP)
12+
}
13+
14+
func sendSIGCONT(proc *os.Process) error {
15+
return proc.Signal(syscall.SIGCONT)
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//go:build windows
2+
3+
package executor
4+
5+
import (
6+
"fmt"
7+
"os"
8+
)
9+
10+
func sendSIGTSTP(_ *os.Process) error {
11+
return fmt.Errorf("suspend not supported on Windows")
12+
}
13+
14+
func sendSIGCONT(_ *os.Process) error {
15+
return fmt.Errorf("resume not supported on Windows")
16+
}

0 commit comments

Comments
 (0)