ttsc 0.31.3 → 0.31.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/compiler/internal/build/BuildExecution.js +43 -6
- package/lib/compiler/internal/build/BuildExecution.js.map +1 -1
- package/lib/compiler/internal/build/runExternalEmitProvenance.d.ts +15 -0
- package/lib/compiler/internal/build/runExternalEmitProvenance.js +67 -4
- package/lib/compiler/internal/build/runExternalEmitProvenance.js.map +1 -1
- package/lib/internal/E2ETrace.d.ts +1 -0
- package/lib/internal/E2ETrace.js.map +1 -1
- package/lib/internal/probeLocalProcess.d.ts +31 -0
- package/lib/internal/probeLocalProcess.js +64 -0
- package/lib/internal/probeLocalProcess.js.map +1 -0
- package/lib/launcher/internal/runtime/ProcessOwnedDirectory.d.ts +2 -0
- package/lib/launcher/internal/runtime/ProcessOwnedDirectory.js +2 -1
- package/lib/launcher/internal/runtime/ProcessOwnedDirectory.js.map +1 -1
- package/lib/launcher/internal/runtime/isLocalProcessGone.d.ts +10 -10
- package/lib/launcher/internal/runtime/isLocalProcessGone.js +15 -22
- package/lib/launcher/internal/runtime/isLocalProcessGone.js.map +1 -1
- package/lib/launcher/internal/watch/FseventsStreams.d.ts +2 -0
- package/lib/launcher/internal/watch/FseventsStreams.js +19 -0
- package/lib/launcher/internal/watch/FseventsStreams.js.map +1 -1
- package/lib/plugin/internal/load/loadProjectPlugins.js +11 -5
- package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -1
- package/lib/plugin/internal/source/GoBuildCacheCoordination.js +4 -1
- package/lib/plugin/internal/source/GoBuildCacheCoordination.js.map +1 -1
- package/lib/plugin/internal/source/PluginBuildLockOwner.d.ts +8 -7
- package/lib/plugin/internal/source/PluginBuildLockOwner.js +10 -14
- package/lib/plugin/internal/source/PluginBuildLockOwner.js.map +1 -1
- package/package.json +8 -8
- package/src/compiler/internal/build/BuildExecution.ts +43 -10
- package/src/compiler/internal/build/runExternalEmitProvenance.ts +84 -4
- package/src/internal/E2ETrace.ts +2 -0
- package/src/internal/probeLocalProcess.ts +61 -0
- package/src/launcher/internal/runtime/ProcessOwnedDirectory.ts +5 -1
- package/src/launcher/internal/runtime/isLocalProcessGone.ts +17 -20
- package/src/launcher/internal/watch/FseventsStreams.ts +22 -0
- package/src/plugin/internal/load/loadProjectPlugins.ts +16 -13
- package/src/plugin/internal/source/GoBuildCacheCoordination.ts +4 -1
- package/src/plugin/internal/source/PluginBuildLockOwner.ts +10 -13
|
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
+
import { probeLocalProcess } from "../../../internal/probeLocalProcess";
|
|
5
6
|
import { PluginBuildLockProtocol } from "./PluginBuildLockProtocol";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -177,15 +178,16 @@ export namespace PluginBuildLockOwner {
|
|
|
177
178
|
* process with its id exists. A holder on another host, or one whose id is
|
|
178
179
|
* alive (possibly reused), is not proven gone.
|
|
179
180
|
*
|
|
180
|
-
* Only ESRCH
|
|
181
|
-
*
|
|
181
|
+
* Only ESRCH, or a Linux zombie that exited but was never collected, proves
|
|
182
|
+
* absence. Permission errors, invalid probe arguments and other failures
|
|
183
|
+
* remain inconclusive and must not authorize reclamation.
|
|
182
184
|
*
|
|
183
|
-
* @evidence contracts/common.md#principled-implementation
|
|
184
|
-
* @evidence contracts/common.md#clear-and-simple-design Host comparison and
|
|
185
|
+
* @evidence contracts/common.md#principled-implementation probeLocalProcess checks existence without terminating the process; same-host ESRCH or an uncollected zombie establishes absence, while presence or any other error does not.
|
|
186
|
+
* @evidence contracts/common.md#clear-and-simple-design Host comparison and the shared probe express the proof boundary directly, without a second process-discovery mechanism.
|
|
185
187
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts Unexpected probe failures are not converted to a dead-owner special case or hidden behind retries.
|
|
186
|
-
* @evidence contracts/common.md#meaningful-documentation Native paragraphs distinguish PID reuse, remote owners and each inconclusive failure class before the tags.
|
|
187
|
-
* @evidence contracts/portability.md#os-neutral-implementation os.hostname and Node's platform-independent signal-zero probe preserve native host scope; only the explicit no-such-process code authorizes absence.
|
|
188
|
-
* @evidence contracts/performance.md#efficient-algorithms A hostname comparison and one process-existence syscall avoid enumerating native processes; string comparison costs grow only with hostname length.
|
|
188
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs distinguish PID reuse, remote owners, uncollected zombies and each inconclusive failure class before the tags.
|
|
189
|
+
* @evidence contracts/portability.md#os-neutral-implementation os.hostname and Node's platform-independent signal-zero probe preserve native host scope; only the explicit no-such-process code, or Linux's own zombie state, authorizes absence.
|
|
190
|
+
* @evidence contracts/performance.md#efficient-algorithms A hostname comparison and one process-existence syscall, plus one /proc read on Linux, avoid enumerating native processes; string comparison costs grow only with hostname length.
|
|
189
191
|
*
|
|
190
192
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Liveness is a time-sensitive observation; a previously absent or present PID cannot be cached as proof for a later reclamation.
|
|
191
193
|
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The query owns no retained handle or running task and returns only its immediate proof decision.
|
|
@@ -193,12 +195,7 @@ export namespace PluginBuildLockOwner {
|
|
|
193
195
|
export function gone(owner: IRecord): boolean {
|
|
194
196
|
if (owner.hostname.toLowerCase() !== os.hostname().toLowerCase())
|
|
195
197
|
return false;
|
|
196
|
-
|
|
197
|
-
process.kill(owner.pid, 0);
|
|
198
|
-
return false;
|
|
199
|
-
} catch (error) {
|
|
200
|
-
return (error as NodeJS.ErrnoException).code === "ESRCH";
|
|
201
|
-
}
|
|
198
|
+
return probeLocalProcess(owner.pid).result === "absent";
|
|
202
199
|
}
|
|
203
200
|
|
|
204
201
|
/**
|