| 60 | // A fake bundle launcher that echoes the threaded host pid, so we can prove the |
| 61 | // shim passed CODEGRAPH_HOST_PPID down to the server (#1185). |
| 62 | function writeHostPpidLauncher(binDir: string): void { |
| 63 | fs.mkdirSync(binDir, { recursive: true }); |
| 64 | const p = path.join(binDir, 'codegraph'); |
| 65 | fs.writeFileSync(p, '#!/bin/sh\necho "HOST_PPID=[${CODEGRAPH_HOST_PPID}]"\n'); |
| 66 | fs.chmodSync(p, 0o755); |
| 67 | } |
| 68 | |
| 69 | // Launch the shim with async spawn so the in-process HTTPS server can respond |
| 70 | // while it runs (spawnSync would block this event loop and deadlock). |