ttsc 0.34.2 → 0.35.0
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/driver/compileraliases/names.go +69 -0
- package/driver/compileraliases/names_test.go +57 -0
- package/lib/compiler/internal/build/BuildExecution.d.ts +26 -0
- package/lib/compiler/internal/build/BuildExecution.js +13 -3
- package/lib/compiler/internal/build/BuildExecution.js.map +1 -1
- package/lib/compiler/internal/build/RunBuildOptions.d.ts +2 -0
- package/lib/compiler/internal/build/RuntimeBuildCache.d.ts +47 -0
- package/lib/compiler/internal/build/RuntimeBuildCache.js +235 -0
- package/lib/compiler/internal/build/RuntimeBuildCache.js.map +1 -0
- package/lib/compiler/internal/build/RuntimeBuildInputs.d.ts +44 -0
- package/lib/compiler/internal/build/RuntimeBuildInputs.js +282 -0
- package/lib/compiler/internal/build/RuntimeBuildInputs.js.map +1 -0
- package/lib/compiler/internal/build/RuntimeInputProof.d.ts +50 -0
- package/lib/compiler/internal/build/RuntimeInputProof.js +315 -0
- package/lib/compiler/internal/build/RuntimeInputProof.js.map +1 -0
- package/lib/compiler/internal/build/TsgoArguments.d.ts +5 -4
- package/lib/compiler/internal/build/TsgoArguments.js +11 -5
- package/lib/compiler/internal/build/TsgoArguments.js.map +1 -1
- package/lib/compiler/internal/build/runBuild.d.ts +3 -3
- package/lib/compiler/internal/build/runBuild.js +17 -4
- package/lib/compiler/internal/build/runBuild.js.map +1 -1
- package/lib/compiler/internal/resolveNativeTypeScriptPackage.d.ts +27 -0
- package/lib/compiler/internal/resolveNativeTypeScriptPackage.js +103 -0
- package/lib/compiler/internal/resolveNativeTypeScriptPackage.js.map +1 -0
- package/lib/compiler/internal/resolveTsgo.d.ts +7 -6
- package/lib/compiler/internal/resolveTsgo.js +16 -35
- package/lib/compiler/internal/resolveTsgo.js.map +1 -1
- package/lib/compiler/internal/runNativeCheckWithObservations.d.ts +18 -14
- package/lib/compiler/internal/runNativeCheckWithObservations.js +42 -18
- package/lib/compiler/internal/runNativeCheckWithObservations.js.map +1 -1
- package/lib/flags/FLAG_SCHEMA.js +7 -0
- package/lib/flags/FLAG_SCHEMA.js.map +1 -1
- package/lib/internal/nativeBinary.d.ts +4 -0
- package/lib/internal/nativeBinary.js +6 -1
- package/lib/internal/nativeBinary.js.map +1 -1
- package/lib/launcher/internal/parseTtsxCLI.d.ts +1 -0
- package/lib/launcher/internal/parseTtsxCLI.js +1 -0
- package/lib/launcher/internal/parseTtsxCLI.js.map +1 -1
- package/lib/launcher/internal/prepareExecution.d.ts +2 -0
- package/lib/launcher/internal/prepareExecution.js +11 -2
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/runTtsx.js +5 -0
- package/lib/launcher/internal/runTtsx.js.map +1 -1
- package/lib/launcher/internal/runtime/installRuntimeHooks.js +7 -0
- package/lib/launcher/internal/runtime/installRuntimeHooks.js.map +1 -1
- package/lib/plugin/internal/load/loadProjectPlugins.js +1 -0
- package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -1
- package/lib/plugin/internal/source/SourceBuildCacheLayout.d.ts +2 -0
- package/lib/plugin/internal/source/SourceBuildCacheLayout.js +3 -0
- package/lib/plugin/internal/source/SourceBuildCacheLayout.js.map +1 -1
- package/lib/plugin/internal/source/pluginBuildVersions.d.ts +8 -7
- package/lib/plugin/internal/source/pluginBuildVersions.js +13 -13
- package/lib/plugin/internal/source/pluginBuildVersions.js.map +1 -1
- package/lib/structures/ITtscPluginCapabilities.d.ts +13 -2
- package/package.json +9 -9
- package/src/compiler/internal/build/BuildExecution.ts +32 -16
- package/src/compiler/internal/build/RunBuildOptions.ts +3 -0
- package/src/compiler/internal/build/RuntimeBuildCache.ts +252 -0
- package/src/compiler/internal/build/RuntimeBuildInputs.ts +349 -0
- package/src/compiler/internal/build/RuntimeInputProof.ts +346 -0
- package/src/compiler/internal/build/TsgoArguments.ts +11 -5
- package/src/compiler/internal/build/runBuild.ts +20 -5
- package/src/compiler/internal/resolveNativeTypeScriptPackage.ts +110 -0
- package/src/compiler/internal/resolveTsgo.ts +17 -36
- package/src/compiler/internal/runNativeCheckWithObservations.ts +41 -18
- package/src/flags/FLAG_SCHEMA.ts +7 -0
- package/src/internal/nativeBinary.ts +4 -0
- package/src/launcher/internal/parseTtsxCLI.ts +1 -0
- package/src/launcher/internal/prepareExecution.ts +20 -2
- package/src/launcher/internal/runTtsx.ts +5 -0
- package/src/launcher/internal/runtime/installRuntimeHooks.ts +11 -0
- package/src/plugin/internal/load/loadProjectPlugins.ts +1 -0
- package/src/plugin/internal/source/SourceBuildCacheLayout.ts +4 -0
- package/src/plugin/internal/source/pluginBuildVersions.ts +13 -15
- package/src/structures/ITtscPluginCapabilities.ts +14 -2
- package/utility/host.go +22 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuntimeBuildCache.js","sourceRoot":"","sources":["../../../../src/compiler/internal/build/RuntimeBuildCache.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAiC;AACjC,sDAAyB;AACzB,0DAA6B;AAE7B,yDAAsD;AACtD,2FAAwF;AAGxF;;;;;;;;;;;;;;GAcG;AACH,IAAiB,iBAAiB,CAoOjC;AApOD,WAAiB,iBAAiB;IAChC,MAAM,MAAM,GAAG,uBAAuB,CAAC;IACvC,MAAM,SAAS,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;IAEpC;;;;;;;;;;;;;;;;OAgBG;IACH,SAAgB,GAAG,CAAC,KAWnB;QACC,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;QACxD,IAAI,QAA4B,CAAC;QACjC,IAAI,CAAC;YACH,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;QAC7B,CAAC;QAAC,MAAM,CAAC;YACP,qCAAqC;QACvC,CAAC;QACD,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;QACjD,MAAM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,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;oBAC/D,IAAI,CAAC,MAAM,CAAC;oBACZ,OAAO;iBACR,CAAC,CACH;YACP,0BAA0B,EACxB,MAAM,CAAC,0BAA0B,KAAK,SAAS;gBAC7C,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,GAAG,CACnD,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAC7C,CACF;YACP,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;YACnD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;SACpD,CAAC;IACJ,CAAC;AACH,CAAC,EApOgB,iBAAiB,aAAjB,iBAAiB,GAAjB,iBAAiB,QAoOjC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { TtscBuildResult } from "../../../structures/internal/TtscBuildResult";
|
|
2
|
+
import type { BuildExecution } from "./BuildExecution";
|
|
3
|
+
import type { RunBuildOptions } from "./RunBuildOptions";
|
|
4
|
+
/**
|
|
5
|
+
* Prove runtime build inputs through the selected upstream compiler's read-only
|
|
6
|
+
* effective configuration and source-selection commands. Repeating selection
|
|
7
|
+
* discovers added roots and changed resolution candidates without guessing a
|
|
8
|
+
* project boundary or treating workspace links as immutable dependencies.
|
|
9
|
+
* Native plugin observations add their independently replayed input closure.
|
|
10
|
+
* Custom compiler overrides require the physical identity of the installed
|
|
11
|
+
* package compiler; wrappers with undisclosed external inputs stay fresh.
|
|
12
|
+
*
|
|
13
|
+
* @evidence contracts/common.md#principled-implementation The actual selected compiler defines effective options and source membership; content and physical identities cover that closure and package scopes, with separate native producer proof for checks.
|
|
14
|
+
* @evidence contracts/common.md#clear-and-simple-design One factory supplies input capture and result admission to the runtime document store without changing normal build dispatch.
|
|
15
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Incomplete descriptors, unsupported effectful compiler modes and unproved native producers and custom compilers without package authority use the existing fresh build rather than weakening diagnostics or substituting a compiler.
|
|
16
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose describes compiler-owned membership, workspace scope and independent plugin observations.
|
|
17
|
+
* @evidence contracts/portability.md#os-neutral-implementation The selected executable receives native argv and cwd; source and package scopes use native physical paths and preserve lexical spellings without OS-wide case folding.
|
|
18
|
+
* @evidence contracts/performance.md#efficient-algorithms Each snapshot runs two read-only native queries and hashes selected source, package, executable and declared host input bytes; shared ancestor sets avoid repeated package-scope walks.
|
|
19
|
+
* @evidence contracts/performance.md#reuse-equivalent-work A completed emit may be reused only for equal selected input snapshots and currently valid native witnesses; unsupported proof falls back to compilation.
|
|
20
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Query buffers and path/hash records are call-local, with source/report bytes unbounded by this factory; the document store owns persistent byte limits and retention.
|
|
21
|
+
*/
|
|
22
|
+
export declare namespace RuntimeBuildInputs {
|
|
23
|
+
/**
|
|
24
|
+
* Construct the proof owners for one private runtime request.
|
|
25
|
+
* Program-mutating transform hosts need their declared emit-input sidecar.
|
|
26
|
+
* Check hosts need their declared observation protocol and complete
|
|
27
|
+
* descriptor discovery; no-plugin builds use the actual compiler's
|
|
28
|
+
* source/configuration selection directly. Custom selections are reusable
|
|
29
|
+
* only when they name that same package-backed compiler.
|
|
30
|
+
*
|
|
31
|
+
* @evidence contracts/common.md#principled-implementation Eligibility requires a private emitting request, complete descriptor selection and supported check witnesses; captures bracket content identities and native source selection, and result admission requires complete emitted-source ownership.
|
|
32
|
+
* @evidence contracts/common.md#clear-and-simple-design Two closures share the resolved request while capture owns current selection and admission owns retained generation proof.
|
|
33
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Native transforms without complete emit observations and arbitrary external-code or profiling modes decline reuse rather than inventing input completeness. Custom compiler overrides need matching installed package identity, including inherited dependency hints; the original build remains the fallback.
|
|
34
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states current producer support and private-runtime scope, including why fresh transformation remains necessary.
|
|
35
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source and package observations use native paths and bracketed byte reads, and upstream probes use the original compiler working directory and argv without shell composition.
|
|
36
|
+
* @evidence contracts/performance.md#efficient-algorithms Capture performs two upstream selection/config queries, actual executable proofs and O(selected bytes) hashes; unique ancestor and path sets bound duplicate reads within one snapshot. Admission replays only recorded native inputs.
|
|
37
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Equal deterministic snapshots retain compiler arguments, versions, content, scope manifests, plugin binaries/configuration and environment; graph and host witnesses separately gate cached check reuse.
|
|
38
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The resolved context and closures belong to one build; each capture releases local source and native-output buffers on return, with no resident process or historical map retained.
|
|
39
|
+
*/
|
|
40
|
+
function create(options: RunBuildOptions, execution: ReturnType<typeof BuildExecution.resolveExecutionContext>): {
|
|
41
|
+
capture: () => string | undefined;
|
|
42
|
+
admit: (result: TtscBuildResult, emitDir: string) => boolean;
|
|
43
|
+
} | undefined;
|
|
44
|
+
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RuntimeBuildInputs = void 0;
|
|
7
|
+
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const resolveNodeBinary_1 = require("../../../internal/resolveNodeBinary");
|
|
11
|
+
const runtimeExecutableIdentity_1 = require("../../../internal/runtimeExecutableIdentity");
|
|
12
|
+
const PluginContentIdentities_1 = require("../../../plugin/internal/source/PluginContentIdentities");
|
|
13
|
+
const pluginSourceStateHolds_1 = require("../../../plugin/internal/source/pluginSourceStateHolds");
|
|
14
|
+
const CompilerArgumentsInspection_1 = require("../CompilerArgumentsInspection");
|
|
15
|
+
const resolveTsgo_1 = require("../resolveTsgo");
|
|
16
|
+
const SidecarEnvironment_1 = require("../sharedHost/SidecarEnvironment");
|
|
17
|
+
const spawnNative_1 = require("../spawnNative");
|
|
18
|
+
const PassthroughFlags_1 = require("./PassthroughFlags");
|
|
19
|
+
const RuntimeInputProof_1 = require("./RuntimeInputProof");
|
|
20
|
+
const TsgoArguments_1 = require("./TsgoArguments");
|
|
21
|
+
/**
|
|
22
|
+
* Prove runtime build inputs through the selected upstream compiler's read-only
|
|
23
|
+
* effective configuration and source-selection commands. Repeating selection
|
|
24
|
+
* discovers added roots and changed resolution candidates without guessing a
|
|
25
|
+
* project boundary or treating workspace links as immutable dependencies.
|
|
26
|
+
* Native plugin observations add their independently replayed input closure.
|
|
27
|
+
* Custom compiler overrides require the physical identity of the installed
|
|
28
|
+
* package compiler; wrappers with undisclosed external inputs stay fresh.
|
|
29
|
+
*
|
|
30
|
+
* @evidence contracts/common.md#principled-implementation The actual selected compiler defines effective options and source membership; content and physical identities cover that closure and package scopes, with separate native producer proof for checks.
|
|
31
|
+
* @evidence contracts/common.md#clear-and-simple-design One factory supplies input capture and result admission to the runtime document store without changing normal build dispatch.
|
|
32
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Incomplete descriptors, unsupported effectful compiler modes and unproved native producers and custom compilers without package authority use the existing fresh build rather than weakening diagnostics or substituting a compiler.
|
|
33
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose describes compiler-owned membership, workspace scope and independent plugin observations.
|
|
34
|
+
* @evidence contracts/portability.md#os-neutral-implementation The selected executable receives native argv and cwd; source and package scopes use native physical paths and preserve lexical spellings without OS-wide case folding.
|
|
35
|
+
* @evidence contracts/performance.md#efficient-algorithms Each snapshot runs two read-only native queries and hashes selected source, package, executable and declared host input bytes; shared ancestor sets avoid repeated package-scope walks.
|
|
36
|
+
* @evidence contracts/performance.md#reuse-equivalent-work A completed emit may be reused only for equal selected input snapshots and currently valid native witnesses; unsupported proof falls back to compilation.
|
|
37
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Query buffers and path/hash records are call-local, with source/report bytes unbounded by this factory; the document store owns persistent byte limits and retention.
|
|
38
|
+
*/
|
|
39
|
+
var RuntimeBuildInputs;
|
|
40
|
+
(function (RuntimeBuildInputs) {
|
|
41
|
+
/**
|
|
42
|
+
* Construct the proof owners for one private runtime request.
|
|
43
|
+
* Program-mutating transform hosts need their declared emit-input sidecar.
|
|
44
|
+
* Check hosts need their declared observation protocol and complete
|
|
45
|
+
* descriptor discovery; no-plugin builds use the actual compiler's
|
|
46
|
+
* source/configuration selection directly. Custom selections are reusable
|
|
47
|
+
* only when they name that same package-backed compiler.
|
|
48
|
+
*
|
|
49
|
+
* @evidence contracts/common.md#principled-implementation Eligibility requires a private emitting request, complete descriptor selection and supported check witnesses; captures bracket content identities and native source selection, and result admission requires complete emitted-source ownership.
|
|
50
|
+
* @evidence contracts/common.md#clear-and-simple-design Two closures share the resolved request while capture owns current selection and admission owns retained generation proof.
|
|
51
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Native transforms without complete emit observations and arbitrary external-code or profiling modes decline reuse rather than inventing input completeness. Custom compiler overrides need matching installed package identity, including inherited dependency hints; the original build remains the fallback.
|
|
52
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states current producer support and private-runtime scope, including why fresh transformation remains necessary.
|
|
53
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source and package observations use native paths and bracketed byte reads, and upstream probes use the original compiler working directory and argv without shell composition.
|
|
54
|
+
* @evidence contracts/performance.md#efficient-algorithms Capture performs two upstream selection/config queries, actual executable proofs and O(selected bytes) hashes; unique ancestor and path sets bound duplicate reads within one snapshot. Admission replays only recorded native inputs.
|
|
55
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Equal deterministic snapshots retain compiler arguments, versions, content, scope manifests, plugin binaries/configuration and environment; graph and host witnesses separately gate cached check reuse.
|
|
56
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The resolved context and closures belong to one build; each capture releases local source and native-output buffers on return, with no resident process or historical map retained.
|
|
57
|
+
*/
|
|
58
|
+
function create(options, execution) {
|
|
59
|
+
if (options.runtimeCacheDir === undefined ||
|
|
60
|
+
typeof options.isolateOutputsTo !== "string" ||
|
|
61
|
+
options.emit !== true ||
|
|
62
|
+
options.format === true ||
|
|
63
|
+
execution.pluginSetupFailure !== undefined ||
|
|
64
|
+
execution.compilerSelection.inspectionError !== undefined ||
|
|
65
|
+
PassthroughFlags_1.PassthroughFlags.forwardsTerminalTsgoFlag(options))
|
|
66
|
+
return undefined;
|
|
67
|
+
const loaded = execution.pluginLoad;
|
|
68
|
+
if (execution.nativePlugins.some((plugin) => plugin.stage === "check"
|
|
69
|
+
? plugin.capabilities?.checkObservations !== true
|
|
70
|
+
: plugin.capabilities?.emitObservations !== true) ||
|
|
71
|
+
(loaded !== undefined &&
|
|
72
|
+
(!loaded.discoveryInputsComplete ||
|
|
73
|
+
!loaded.descriptorReadsDeclared ||
|
|
74
|
+
loaded.observationsComplete === false)))
|
|
75
|
+
return undefined;
|
|
76
|
+
const emitDir = options.isolateOutputsTo;
|
|
77
|
+
const args = TsgoArguments_1.TsgoArguments.createTsgoBuildArgs(execution, options, {
|
|
78
|
+
listEmittedFiles: false,
|
|
79
|
+
});
|
|
80
|
+
const env = SidecarEnvironment_1.SidecarEnvironment.merge(process.env, options.env);
|
|
81
|
+
// A custom executable can be a wrapper with undisclosed external inputs.
|
|
82
|
+
// Inherited hints to the installed compiler still have package authority.
|
|
83
|
+
if (execution.tsgo.packageJson === "") {
|
|
84
|
+
try {
|
|
85
|
+
const packaged = (0, resolveTsgo_1.resolveTsgo)({
|
|
86
|
+
cwd: execution.projectRoot,
|
|
87
|
+
env: SidecarEnvironment_1.SidecarEnvironment.merge(env, { TTSC_TSGO_BINARY: undefined }),
|
|
88
|
+
});
|
|
89
|
+
if (node_fs_1.default.realpathSync.native(packaged.binary) !==
|
|
90
|
+
node_fs_1.default.realpathSync.native(execution.tsgo.binary))
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const identities = execution.identities ??
|
|
98
|
+
PluginContentIdentities_1.PluginContentIdentities.open({
|
|
99
|
+
projectRoot: execution.projectRoot,
|
|
100
|
+
cacheDir: node_path_1.default.dirname(options.runtimeCacheDir),
|
|
101
|
+
env,
|
|
102
|
+
});
|
|
103
|
+
if (identities === undefined)
|
|
104
|
+
return undefined;
|
|
105
|
+
let inspected;
|
|
106
|
+
try {
|
|
107
|
+
inspected = CompilerArgumentsInspection_1.CompilerArgumentsInspection.inspect(args, execution.compilerSelection.compilerArgsCwd);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
if (inspected.args.some((arg) => /^--?(?:runExternalCode|generateTrace|generateCpuProfile|pprofDir|diagnostics|extendedDiagnostics|traceResolution|explainFiles|listFiles|listEmittedFiles|build|watch)(?:=|$)/i.test(arg)))
|
|
113
|
+
return undefined;
|
|
114
|
+
return {
|
|
115
|
+
capture: () => {
|
|
116
|
+
try {
|
|
117
|
+
if (process.env.TTSC_PLUGIN_DESCRIPTOR_LOAD === "1")
|
|
118
|
+
return undefined;
|
|
119
|
+
const node = execution.nativePlugins.length === 0
|
|
120
|
+
? undefined
|
|
121
|
+
: (0, resolveNodeBinary_1.resolveNodeBinary)(env, execution.projectRoot, identities);
|
|
122
|
+
if (execution.nativePlugins.length !== 0 && node === undefined)
|
|
123
|
+
return undefined;
|
|
124
|
+
const binaries = [
|
|
125
|
+
...new Set([
|
|
126
|
+
execution.tsgo.binary,
|
|
127
|
+
...execution.nativePlugins.map((plugin) => plugin.binary),
|
|
128
|
+
...(node === undefined ? [] : [node]),
|
|
129
|
+
]),
|
|
130
|
+
];
|
|
131
|
+
const compilerIdentities = binaries.map((binary) => (0, runtimeExecutableIdentity_1.runtimeExecutableIdentity)(binary, identities));
|
|
132
|
+
if (compilerIdentities.some((identity) => identity === undefined))
|
|
133
|
+
return undefined;
|
|
134
|
+
for (const [directory, state] of Object.entries(loaded?.pluginSources ?? {}))
|
|
135
|
+
if (!(0, pluginSourceStateHolds_1.pluginSourceStateHolds)(directory, state, {
|
|
136
|
+
projectRoot: execution.projectRoot,
|
|
137
|
+
}))
|
|
138
|
+
return undefined;
|
|
139
|
+
const query = (flags) => {
|
|
140
|
+
const result = (0, spawnNative_1.spawnNative)(execution.tsgo.binary, [...args, ...flags], { cwd: execution.compilerSelection.compilerArgsCwd, env });
|
|
141
|
+
if (result.error || result.status !== 0 || result.signal !== null)
|
|
142
|
+
throw new Error("runtime input inspection unavailable");
|
|
143
|
+
return String(result.stdout);
|
|
144
|
+
};
|
|
145
|
+
const config = JSON.parse(query(["--showConfig"]));
|
|
146
|
+
if (!config ||
|
|
147
|
+
typeof config.compilerOptions !== "object" ||
|
|
148
|
+
config.compilerOptions === null ||
|
|
149
|
+
config.references?.length ||
|
|
150
|
+
config.compilerOptions.runExternalCode === true ||
|
|
151
|
+
[
|
|
152
|
+
"generateTrace",
|
|
153
|
+
"generateCpuProfile",
|
|
154
|
+
"pprofDir",
|
|
155
|
+
"diagnostics",
|
|
156
|
+
"extendedDiagnostics",
|
|
157
|
+
"traceResolution",
|
|
158
|
+
"explainFiles",
|
|
159
|
+
"listFiles",
|
|
160
|
+
"listEmittedFiles",
|
|
161
|
+
].some((name) => config.compilerOptions[name]))
|
|
162
|
+
return undefined;
|
|
163
|
+
const listed = query([
|
|
164
|
+
"--listFilesOnly",
|
|
165
|
+
"true",
|
|
166
|
+
"--listEmittedFiles",
|
|
167
|
+
"false",
|
|
168
|
+
])
|
|
169
|
+
.split(/\r?\n/)
|
|
170
|
+
.filter((line) => line.length !== 0);
|
|
171
|
+
if (listed.length === 0 ||
|
|
172
|
+
!listed.every((file) => node_path_1.default.isAbsolute(file) && /\.(?:[cm]?[jt]sx?|json)$/i.test(file)))
|
|
173
|
+
return undefined;
|
|
174
|
+
const inputs = new Set([
|
|
175
|
+
...listed,
|
|
176
|
+
...execution.project.configPaths,
|
|
177
|
+
...inspected.observations.keys(),
|
|
178
|
+
]);
|
|
179
|
+
const scopes = new Set();
|
|
180
|
+
for (const file of listed) {
|
|
181
|
+
for (const spelling of [file, node_fs_1.default.realpathSync.native(file)]) {
|
|
182
|
+
let directory = node_path_1.default.dirname(spelling);
|
|
183
|
+
while (!scopes.has(directory)) {
|
|
184
|
+
scopes.add(directory);
|
|
185
|
+
inputs.add(node_path_1.default.join(directory, "package.json"));
|
|
186
|
+
const parent = node_path_1.default.dirname(directory);
|
|
187
|
+
if (parent === directory)
|
|
188
|
+
break;
|
|
189
|
+
directory = parent;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const hashes = [...inputs].sort().map((file) => {
|
|
194
|
+
try {
|
|
195
|
+
const observed = JSON.parse(CompilerArgumentsInspection_1.CompilerArgumentsInspection.observeInputFile(file));
|
|
196
|
+
return [file, observed[0], observed[2]];
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
if (error.code !== "ENOENT" &&
|
|
200
|
+
error.code !== "ENOTDIR")
|
|
201
|
+
throw error;
|
|
202
|
+
return [file, null, null];
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
const hostInputs = [];
|
|
206
|
+
for (const [file, expected] of Object.entries(loaded?.hostInputHashes ?? {}).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))) {
|
|
207
|
+
const [physical, hash] = RuntimeInputProof_1.RuntimeInputProof.observeHostInput(file);
|
|
208
|
+
if (hash !== expected ||
|
|
209
|
+
physical !== loaded?.hostInputRealpaths[file])
|
|
210
|
+
return undefined;
|
|
211
|
+
hostInputs.push([file, physical, hash]);
|
|
212
|
+
}
|
|
213
|
+
for (const [file, before] of inspected.observations)
|
|
214
|
+
if (CompilerArgumentsInspection_1.CompilerArgumentsInspection.observeInputFile(file) !== before)
|
|
215
|
+
return undefined;
|
|
216
|
+
// Only private destination values are normalized. The relative layout
|
|
217
|
+
// remains in the identity because source maps are output-relative.
|
|
218
|
+
for (const key of [
|
|
219
|
+
"outDir",
|
|
220
|
+
"declarationDir",
|
|
221
|
+
"tsBuildInfoFile",
|
|
222
|
+
"outFile",
|
|
223
|
+
])
|
|
224
|
+
if (typeof config.compilerOptions[key] === "string" &&
|
|
225
|
+
(node_path_1.default.resolve(node_path_1.default.dirname(execution.tsconfig), config.compilerOptions[key]) === options.isolateOutputsTo ||
|
|
226
|
+
node_path_1.default
|
|
227
|
+
.resolve(node_path_1.default.dirname(execution.tsconfig), config.compilerOptions[key])
|
|
228
|
+
.startsWith(emitDir + node_path_1.default.sep)))
|
|
229
|
+
config.compilerOptions[key] =
|
|
230
|
+
"<private-output>" +
|
|
231
|
+
node_path_1.default.relative(emitDir, node_path_1.default.resolve(node_path_1.default.dirname(execution.tsconfig), config.compilerOptions[key]));
|
|
232
|
+
// Upstream synthesizes an exclusion for the overridden outDir too.
|
|
233
|
+
if (Array.isArray(config.exclude))
|
|
234
|
+
config.exclude = config.exclude.map((name) => typeof name === "string" &&
|
|
235
|
+
node_path_1.default.resolve(node_path_1.default.dirname(execution.tsconfig), name) === emitDir
|
|
236
|
+
? "<private-output>"
|
|
237
|
+
: name);
|
|
238
|
+
const environment = Object.entries(env)
|
|
239
|
+
.filter(([key]) => !/^TTSX_RUNTIME_/i.test(key))
|
|
240
|
+
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
241
|
+
return JSON.stringify({
|
|
242
|
+
format: 1,
|
|
243
|
+
version: identities.version,
|
|
244
|
+
compilerIdentities,
|
|
245
|
+
config,
|
|
246
|
+
hashes,
|
|
247
|
+
hostInputs,
|
|
248
|
+
environment: node_crypto_1.default
|
|
249
|
+
.createHash("sha256")
|
|
250
|
+
.update(JSON.stringify(environment))
|
|
251
|
+
.digest("hex"),
|
|
252
|
+
project: execution.tsconfig,
|
|
253
|
+
cwd: execution.compilerSelection.compilerArgsCwd,
|
|
254
|
+
layout: node_path_1.default.relative(emitDir, execution.projectRoot),
|
|
255
|
+
unchecked: options.skipDiagnosticsCheck === true,
|
|
256
|
+
plugins: execution.nativePlugins,
|
|
257
|
+
pluginSources: loaded?.pluginSources,
|
|
258
|
+
descriptor: loaded?.hostInputHashes,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
admit: (result, emitDir) => {
|
|
266
|
+
if (result.status !== 0 ||
|
|
267
|
+
result.emittedSources === undefined ||
|
|
268
|
+
Object.keys(result.emittedSourceProofFailures ?? {}).length !== 0 ||
|
|
269
|
+
!Object.values(result.emittedSources).every((sources) => Array.isArray(sources) &&
|
|
270
|
+
sources.length > 0 &&
|
|
271
|
+
sources.every((source) => typeof source === "string" && node_path_1.default.isAbsolute(source))))
|
|
272
|
+
return false;
|
|
273
|
+
if (execution.nativePlugins.length !== 0 &&
|
|
274
|
+
result.graph?.inputObservations === undefined)
|
|
275
|
+
return false;
|
|
276
|
+
return RuntimeInputProof_1.RuntimeInputProof.holds(result, execution.projectRoot, emitDir);
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
RuntimeBuildInputs.create = create;
|
|
281
|
+
})(RuntimeBuildInputs || (exports.RuntimeBuildInputs = RuntimeBuildInputs = {}));
|
|
282
|
+
//# sourceMappingURL=RuntimeBuildInputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuntimeBuildInputs.js","sourceRoot":"","sources":["../../../../src/compiler/internal/build/RuntimeBuildInputs.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAiC;AACjC,sDAAyB;AACzB,0DAA6B;AAE7B,2EAAwE;AACxE,2FAAwF;AACxF,qGAAkG;AAClG,mGAAgG;AAEhG,gFAA6E;AAC7E,gDAA6C;AAC7C,yEAAsE;AACtE,gDAA6C;AAE7C,yDAAsD;AAEtD,2DAAwD;AACxD,mDAAgD;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,IAAiB,kBAAkB,CAuTlC;AAvTD,WAAiB,kBAAkB;IACjC;;;;;;;;;;;;;;;;OAgBG;IACH,SAAgB,MAAM,CACpB,OAAwB,EACxB,SAAoE;QAOpE,IACE,OAAO,CAAC,eAAe,KAAK,SAAS;YACrC,OAAO,OAAO,CAAC,gBAAgB,KAAK,QAAQ;YAC5C,OAAO,CAAC,IAAI,KAAK,IAAI;YACrB,OAAO,CAAC,MAAM,KAAK,IAAI;YACvB,SAAS,CAAC,kBAAkB,KAAK,SAAS;YAC1C,SAAS,CAAC,iBAAiB,CAAC,eAAe,KAAK,SAAS;YACzD,mCAAgB,CAAC,wBAAwB,CAAC,OAAO,CAAC;YAElD,OAAO,SAAS,CAAC;QACnB,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC;QACpC,IACE,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CACtC,MAAM,CAAC,KAAK,KAAK,OAAO;YACtB,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,iBAAiB,KAAK,IAAI;YACjD,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,gBAAgB,KAAK,IAAI,CACnD;YACD,CAAC,MAAM,KAAK,SAAS;gBACnB,CAAC,CAAC,MAAM,CAAC,uBAAuB;oBAC9B,CAAC,MAAM,CAAC,uBAAuB;oBAC/B,MAAM,CAAC,oBAAoB,KAAK,KAAK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@
|
|
|
1
|
+
import type { TtscBuildResult } from "../../../structures/internal/TtscBuildResult";
|
|
2
|
+
/**
|
|
3
|
+
* Replay the compiler and native input witnesses of a completed runtime build.
|
|
4
|
+
* Read predicates keep their original text or raw-byte codec; absence, entry
|
|
5
|
+
* kind, physical target and directory membership remain independent predicates.
|
|
6
|
+
* Failed or unsupported observations withhold reuse.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation Replay compares generation witnesses with current existence, stat, decoded text, physical identity and directory membership. Native version-one file, optional-file, entry and directory codecs use explicit tags, raw file/link bytes and sorted nul-delimited records. Compiler text strips UTF-8 BOM or decodes even UTF-16LE/BE bytes before SHA-256; host directory presence uses its separate domain marker.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design One namespace separates result admission, declared host inputs, compiler predicates and the native version-one codec. Private physical/absence and SHA-256 helpers serve the codecs without merging their meanings.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Unknown codecs, failed reads and producer proof failures decline admission. Only ENOENT/ENOTDIR prove absence; other physical-resolution errors remain unavailable. Following stat classifies compiler views while lstat retains native link kinds; only the producer private output subtree is excluded.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies generation proof, codec ownership and refusal semantics; private helper comments identify query, byte, decoded-text and null/error boundaries.
|
|
12
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native stat, lstat and realpath retain actual kinds, targets and spellings without case assumptions. POSIX directory names/link targets stay raw bytes, Windows names follow the producer UTF-8 codec, and compiler directory entries sort by UTF-8 bytes.
|
|
13
|
+
* @evidence contracts/performance.md#efficient-algorithms Replay visits recorded predicates and their bytes or immediate directory entries rather than unrelated trees. Hashing and BOM decoding cost O(bytes), including a big-endian copy; directory codecs cost O(N log N) sorting plus encoded bytes and link queries. Physical resolution follows native path/link traversal.
|
|
14
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Every retained predicate is observed anew to authorize completed-result reuse. Host capture and admission share the producer codec; no path memo, watcher silence or historical hash independently grants authority.
|
|
15
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Read buffers, decoded text, paths and sorted directory members are call-local and have no proof-reader byte or entry cap. Synchronous calls retain no handle, watcher, process or historical population; only returned proof values escape.
|
|
16
|
+
*/
|
|
17
|
+
export declare namespace RuntimeInputProof {
|
|
18
|
+
/**
|
|
19
|
+
* Validate result-level host witnesses and every reported compiler predicate.
|
|
20
|
+
* The caller independently proves the selected compiler, project membership
|
|
21
|
+
* and plugin selection; an absent graph alone grants no completeness.
|
|
22
|
+
*
|
|
23
|
+
* @evidence contracts/common.md#principled-implementation Explicit incomplete observations and any graph failure reject reuse; host paths require both content and physical witnesses, and rich compiler predicates are replayed under their own codec.
|
|
24
|
+
* @evidence contracts/common.md#clear-and-simple-design One admission pass delegates individual compiler observations and native codecs.
|
|
25
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Missing witness fields never become an empty successful observation, and only the caller-owned private output subtree is excluded.
|
|
26
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies result admission and the caller's separate completeness obligations.
|
|
27
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native path resolution anchors producer-relative graph keys, and current physical paths come from native realpath.
|
|
28
|
+
* @evidence contracts/performance.md#efficient-algorithms Input and predicate populations drive replay; each read hashes its actual bytes and directories sort immediate entry records.
|
|
29
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Generation witnesses, rather than an identity-key match, decide whether a completed build remains reusable.
|
|
30
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Temporary path and predicate records are invocation-owned without retained handles or history.
|
|
31
|
+
*/
|
|
32
|
+
function holds(result: TtscBuildResult, projectRoot: string, emitDir: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Observe a declared host input under its existing raw-file or directory-kind
|
|
35
|
+
* codec. Descriptor resolution can declare directories as presence inputs;
|
|
36
|
+
* those are distinct from compiler source reads and directory enumeration.
|
|
37
|
+
* Native identity and metadata bracket the observation. Missing paths carry
|
|
38
|
+
* null witnesses, while unavailable or changing observations throw.
|
|
39
|
+
*
|
|
40
|
+
* @evidence contracts/common.md#principled-implementation Raw file bytes and the existing ttsc:host-input:directory domain marker reproduce the descriptor/native host-input contract, with physical identity and full native metadata checked before and after.
|
|
41
|
+
* @evidence contracts/common.md#clear-and-simple-design One observer supplies the same declared-host codec to input capture and retained-result admission, independently of compiler text and enumeration predicates.
|
|
42
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Only ENOENT/ENOTDIR establish absence; unsupported entry kinds, read failures and changing witnesses refuse reuse instead of becoming empty content.
|
|
43
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes directory presence from directory membership, states the producer codec and explains failure semantics.
|
|
44
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native following stat, realpath and byte reads retain actual host links and physical spellings without OS-name or separator guesses.
|
|
45
|
+
* @evidence contracts/performance.md#efficient-algorithms File observations hash their complete byte buffer and bracket native metadata; directory presence hashes a fixed marker without scanning members.
|
|
46
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Capture and admission share the producer's codec, but every invocation observes current witnesses and retains no path-only truth.
|
|
47
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Read buffers and stat records are call-local; synchronous filesystem calls leave no retained handle or watcher.
|
|
48
|
+
*/
|
|
49
|
+
function observeHostInput(file: string): readonly [string | null, string | null];
|
|
50
|
+
}
|