From 45c80a1d1aeb5930bfb2a0f7c15a8fbfefb057ae Mon Sep 17 00:00:00 2001 From: kishore563 <79913473+kishore563@users.noreply.github.com> Date: Thu, 12 Mar 2026 14:34:07 +0530 Subject: [PATCH 1/4] Implement Unix process management in run_unix.go Windows fix --- workers/run_unix.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 workers/run_unix.go diff --git a/workers/run_unix.go b/workers/run_unix.go new file mode 100644 index 00000000..21149b3c --- /dev/null +++ b/workers/run_unix.go @@ -0,0 +1,22 @@ +//go:build !windows + +package workers + +import ( + "os" + "os/exec" + "syscall" +) + +func setSysProcAttr(cmd *exec.Cmd) { + cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} +} + +func osSendInterrupt(process *os.Process) error { + return process.Signal(syscall.SIGINT) +} + +func osSendKill(process *os.Process) error { + // Shut down the process group (including all child processes) + return syscall.Kill(-process.Pid, syscall.SIGKILL) +} From 3864f876db8aa17f3864be8e231bbdd5fe5c9527 Mon Sep 17 00:00:00 2001 From: kishore563 <79913473+kishore563@users.noreply.github.com> Date: Thu, 12 Mar 2026 14:34:45 +0530 Subject: [PATCH 2/4] Add Windows-specific process handling functions --- workers/run_windows.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 workers/run_windows.go diff --git a/workers/run_windows.go b/workers/run_windows.go new file mode 100644 index 00000000..74dbbe05 --- /dev/null +++ b/workers/run_windows.go @@ -0,0 +1,20 @@ +//go:build windows + +package workers + +import ( + "os" + "os/exec" +) + +func setSysProcAttr(cmd *exec.Cmd) { + // Setpgid is not supported on Windows; no-op +} + +func osSendInterrupt(process *os.Process) error { + return process.Kill() +} + +func osSendKill(process *os.Process) error { + return process.Kill() +} From ed38686e0f56687493f3c0c0a80f1028b70d9e73 Mon Sep 17 00:00:00 2001 From: kishore563 <79913473+kishore563@users.noreply.github.com> Date: Thu, 12 Mar 2026 14:35:49 +0530 Subject: [PATCH 3/4] Update run.go --- workers/run.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/workers/run.go b/workers/run.go index 9ca84150..da898237 100644 --- a/workers/run.go +++ b/workers/run.go @@ -9,7 +9,6 @@ import ( "runtime" "strconv" "strings" - "syscall" "time" "github.com/spf13/pflag" @@ -137,7 +136,7 @@ func (r *Runner) Run(ctx context.Context, baseDir string) error { if err != nil { return fmt.Errorf("failed creating command: %w", err) } - cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} // set process group ID for shutdown + setSysProcAttr(cmd) // set process group ID for shutdown // Direct logging output to provided logger, if available. if r.LoggingOptions.PreparedLogger != nil { @@ -243,10 +242,12 @@ func sendInterrupt(process *os.Process) error { if runtime.GOOS == "windows" { return process.Kill() } - return process.Signal(syscall.SIGINT) + return osSendInterrupt(process) } func sendKill(process *os.Process) error { - // shutting down the process group (ie including all child processes) - return syscall.Kill(-process.Pid, syscall.SIGKILL) + if runtime.GOOS == "windows" { + return process.Kill() + } + return osSendKill(process) } From 4cd42290ed73bc36efaf93d8dcb5a5faaf3748db Mon Sep 17 00:00:00 2001 From: kishore563 <79913473+kishore563@users.noreply.github.com> Date: Thu, 12 Mar 2026 14:36:35 +0530 Subject: [PATCH 4/4] Normalize path separators for glob in protogen.js --- workers/typescript/protogen.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/workers/typescript/protogen.js b/workers/typescript/protogen.js index 41508d90..2ac5485d 100644 --- a/workers/typescript/protogen.js +++ b/workers/typescript/protogen.js @@ -3,6 +3,11 @@ const { resolve } = require('path'); const { promisify } = require('util'); const glob = require('glob'); const { statSync, mkdirSync } = require('fs'); + +// Normalize path separators for glob (Windows uses backslashes, glob requires forward slashes) +function toGlobPath(p) { + return p.replace(/\\/g, '/'); +} const pbjs = require('protobufjs-cli/pbjs'); const pbts = require('protobufjs-cli/pbts'); @@ -73,7 +78,7 @@ async function compileProtos(dtsOutputFile, ...args) { async function main() { mkdirSync(outputDir, { recursive: true }); - const protoFiles = glob.sync(resolve(protoBaseDir, '**/*.proto')); + const protoFiles = glob.sync(toGlobPath(resolve(protoBaseDir, '**/*.proto'))); const protosMTime = Math.max(...protoFiles.map(mtime)); const genMTime = mtime(jsOutputFile);