@smoothbricks/nx-plugin 0.7.7 → 0.7.8
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/README.md +4 -1
- package/dist/.build-inputs.json +2 -2
- package/dist/managed-files/ci-workflow.d.ts +7 -0
- package/dist/managed-files/ci-workflow.d.ts.map +1 -1
- package/dist/managed-files/ci-workflow.js +11 -4
- package/dist/managed-files/publish-workflow.d.ts.map +1 -1
- package/dist/managed-files/publish-workflow.js +13 -4
- package/managed/raw/patches/ttsc@0.34.1.patch +388 -0
- package/managed/templates/github/actions/setup-devenv/action.yml +51 -14
- package/package.json +2 -2
- package/src/managed-files/ci-workflow.ts +12 -4
- package/src/managed-files/publish-workflow.ts +15 -3
package/README.md
CHANGED
|
@@ -2421,7 +2421,10 @@ the run's memory: the least finite `memory.max` of the run's cgroup and its ance
|
|
|
2421
2421
|
Linux, `hw.memsize` on macOS (`host-memory.ts`). A run whose memory cannot be read fails in `preTasksExecution`, naming
|
|
2422
2422
|
the file or sysctl. A task whose own peak exceeds the run's memory is granted once nothing else holds memory, and its
|
|
2423
2423
|
stderr says so; the wait line names the charge as `memory=<bytes>` or `memory=none`. A granted executor's sub-pool
|
|
2424
|
-
charges no memory.
|
|
2424
|
+
charges no memory. A host CI scope's first run of a task it holds no record of is the `memory=none` case: the managed
|
|
2425
|
+
`setup-devenv` action starts a scope from the records of the pushes it follows (a pull request's base branch's, a
|
|
2426
|
+
release workflow's CI's) and takes, at each run, the record of every task the scope lacks
|
|
2427
|
+
(`specs/cowshed/05_gateway.md`, "Without mbx, every Nx run budgets itself").
|
|
2425
2428
|
|
|
2426
2429
|
The pool runs on a worker thread of its own (`cpu-pool-thread.ts`). The process that serves the run, the Nx daemon when
|
|
2427
2430
|
installed plugins load in it or the Nx CLI without one, hashes tasks and builds the project graph in synchronous calls
|
package/dist/.build-inputs.json
CHANGED
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"packages/nx-plugin/src/graph-input-contract.ts": "8a1aec1294960ae80bcff55a0370c95004a911bf1afe6caa47e666da3baeac43",
|
|
97
97
|
"packages/nx-plugin/src/index.ts": "223dd22b1bc871a24c9a7a7b66e2d496870cac40b52281f7119356a09287a96a",
|
|
98
98
|
"packages/nx-plugin/src/managed-assets.ts": "9cea959c09f3163992e666eecc5a65ec1f1b63c81fc56c5e99088507d02c5e3b",
|
|
99
|
-
"packages/nx-plugin/src/managed-files/ci-workflow.ts": "
|
|
99
|
+
"packages/nx-plugin/src/managed-files/ci-workflow.ts": "57773e51bae9b3334f77b77fa42a82a1ab011aa9a371e958e24f5747231ba0e5",
|
|
100
100
|
"packages/nx-plugin/src/managed-files/context.ts": "5b83c000322382cb781df4f415f3759388e69686b76779599572a62a5c4dd28c",
|
|
101
101
|
"packages/nx-plugin/src/managed-files/files.ts": "c88d4f6ab100f25e8e0453f898ed42d8cf067d8c102b2c2984a1f33fb1b34a2c",
|
|
102
102
|
"packages/nx-plugin/src/managed-files/generator.ts": "8cf1a1b121645c5ead86c163c9da03f612efb2fff6aabed3ea858d87d6cbd0b3",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"packages/nx-plugin/src/managed-files/paths.ts": "0727cde9a3eea88420290b63cb4c9a3ffab857b39e0411eed3c4ddeb4e563745",
|
|
108
108
|
"packages/nx-plugin/src/managed-files/pr-preview-cleanup-workflow.ts": "0f34805a6d737f364c23801da62aefcd4afdc7ba87e911019dd6301be640b385",
|
|
109
109
|
"packages/nx-plugin/src/managed-files/private-npm-policy.ts": "795882f98b2c2434e7c0115e93a7b4c0da6142ae0602274b362893c49a46d5a7",
|
|
110
|
-
"packages/nx-plugin/src/managed-files/publish-workflow.ts": "
|
|
110
|
+
"packages/nx-plugin/src/managed-files/publish-workflow.ts": "cc339390ddd41ac04d965b8adc8a4fe60a4a549df8b779d169dc10ace8722708",
|
|
111
111
|
"packages/nx-plugin/src/managed-files/tree.ts": "a6b7dc515796a3824199938ce70af7d2b45347ed32064b487f3d5f381509dc54",
|
|
112
112
|
"packages/nx-plugin/src/manifest-hash.ts": "26cb2598853801cf70785386e1847feba7f04780b43809597004b7fb7ecbc2b6",
|
|
113
113
|
"packages/nx-plugin/src/nextest-code-bound.ts": "e1036934a35f1b65e0f43bddbea259e01a1100e553cdeaefc2db8823a4517340",
|
|
@@ -148,6 +148,13 @@ export declare function defineCiWorkflow(options: CiWorkflowDefinitionOptions):
|
|
|
148
148
|
* rather than from `github.workflow`, which a forge may fill with the file name.
|
|
149
149
|
*/
|
|
150
150
|
export declare const CI_CONCURRENCY_GROUP = "CI-${{ github.event.pull_request.number || github.ref }}";
|
|
151
|
+
/**
|
|
152
|
+
* The CI workflow's name and its one job's id. A workflow whose tests are CI's (a release's) hands them to the
|
|
153
|
+
* setup-devenv action as `records-workflow` and `records-job`, so a task its Nx scope holds no record of is charged what
|
|
154
|
+
* CI's pushes last recorded of it (specs/cowshed/05_gateway.md, "Without mbx, every Nx run budgets itself").
|
|
155
|
+
*/
|
|
156
|
+
export declare const CI_WORKFLOW_NAME = "CI";
|
|
157
|
+
export declare const CI_JOB_ID = "main";
|
|
151
158
|
export declare function renderCiWorkflowYaml(options: CiWorkflowDefinitionOptions): string;
|
|
152
159
|
/** Job env for `.npmrc` token expansion. Registry URL is not a GitHub variable. */
|
|
153
160
|
export declare function privateNpmReadTokenJobEnv(options: Pick<CiWorkflowDefinitionOptions, 'privateNpm'>): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/ci-workflow.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,aAAa,EACb,6BAA6B,EAE7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAGlC,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CACrC,MAAM,CACJ,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,gBAA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;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,EAAE,CAMxG;AAmRD;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,6CAA6C,CAAC;AAEjF,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,EAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,GAAG,UAAU,EAC3B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,SAAS,SAAc,GACtB,MAAM,EAAE,CAkBV"}
|
|
@@ -96,6 +96,13 @@ export function defineCiWorkflow(options) {
|
|
|
96
96
|
* rather than from `github.workflow`, which a forge may fill with the file name.
|
|
97
97
|
*/
|
|
98
98
|
export const CI_CONCURRENCY_GROUP = 'CI-${{ github.event.pull_request.number || github.ref }}';
|
|
99
|
+
/**
|
|
100
|
+
* The CI workflow's name and its one job's id. A workflow whose tests are CI's (a release's) hands them to the
|
|
101
|
+
* setup-devenv action as `records-workflow` and `records-job`, so a task its Nx scope holds no record of is charged what
|
|
102
|
+
* CI's pushes last recorded of it (specs/cowshed/05_gateway.md, "Without mbx, every Nx run budgets itself").
|
|
103
|
+
*/
|
|
104
|
+
export const CI_WORKFLOW_NAME = 'CI';
|
|
105
|
+
export const CI_JOB_ID = 'main';
|
|
99
106
|
export function renderCiWorkflowYaml(options) {
|
|
100
107
|
const steps = defineCiWorkflow(options);
|
|
101
108
|
return [
|
|
@@ -107,7 +114,7 @@ export function renderCiWorkflowYaml(options) {
|
|
|
107
114
|
].join('');
|
|
108
115
|
}
|
|
109
116
|
function renderCiWorkflowHeader(options) {
|
|
110
|
-
return `name:
|
|
117
|
+
return `name: ${CI_WORKFLOW_NAME}
|
|
111
118
|
|
|
112
119
|
on:
|
|
113
120
|
push:
|
|
@@ -142,7 +149,7 @@ defaults:
|
|
|
142
149
|
working-directory: tooling/direnv
|
|
143
150
|
|
|
144
151
|
jobs:
|
|
145
|
-
|
|
152
|
+
${CI_JOB_ID}:
|
|
146
153
|
name: Validate
|
|
147
154
|
${renderRunsOnLine(options.runsOn)}
|
|
148
155
|
timeout-minutes: 45
|
|
@@ -656,8 +663,8 @@ export function cargoCredentialStepLines(step, config) {
|
|
|
656
663
|
const mirrorUrl = new URL(origin.internalMirror);
|
|
657
664
|
const mirrorBase = `${mirrorUrl.protocol}//${mirrorUrl.host}/`.replaceAll("'", "'\\''");
|
|
658
665
|
for (const prefix of mirrorRewritePrefixes(origin)) {
|
|
659
|
-
lines.push(
|
|
660
|
-
lines.push(
|
|
666
|
+
lines.push(` echo "GIT_CONFIG_KEY_\${idx}=url.${mirrorBase}.insteadOf"`);
|
|
667
|
+
lines.push(` echo "GIT_CONFIG_VALUE_\${idx}=${prefix.replaceAll("'", "'\\''")}"`);
|
|
661
668
|
lines.push(' idx=$((idx + 1))');
|
|
662
669
|
}
|
|
663
670
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/publish-workflow.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"publish-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/publish-workflow.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAOL,KAAK,sBAAsB,EAM5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAgD,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AASxG,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,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D,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAwFnC;AA2BD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,gCAAqC,GAAG,MAAM,CA2BhG"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { isMap, isScalar, parseDocument } from 'yaml';
|
|
3
3
|
import { LINUX_PLATFORM_TARGET_GLOBS, MACOS_PLATFORM_TARGET_GLOBS, RELEASE_CONFIGURATION, } from '../platform-targets.js';
|
|
4
4
|
import { isSmoothBricksCodebasePackageName } from '../workspace-package-policy.js';
|
|
5
|
-
import { artifactStepLines, CiWorkflowStepKind, cargoCredentialJobEnvLines, cargoCredentialStepLines, deployStepSecretEnvLines, githubActionPins, remoteCacheJobEnvLines, sourceCheckoutsStepLines, TRACE_DB_ARTIFACT_GLOB, } from './ci-workflow.js';
|
|
5
|
+
import { artifactStepLines, CI_JOB_ID, CI_WORKFLOW_NAME, CiWorkflowStepKind, cargoCredentialJobEnvLines, cargoCredentialStepLines, deployStepSecretEnvLines, githubActionPins, remoteCacheJobEnvLines, sourceCheckoutsStepLines, TRACE_DB_ARTIFACT_GLOB, } from './ci-workflow.js';
|
|
6
6
|
import { GITHUB_HOSTED_LINUX_RUNNER, renderRunsOnLine } from './github-runs-on.js';
|
|
7
7
|
/**
|
|
8
8
|
* Carried by every step that builds what ships: the build aggregate and each
|
|
@@ -394,6 +394,15 @@ function commentLinesForStep(step) {
|
|
|
394
394
|
}
|
|
395
395
|
return [` # Step ${step.number}`];
|
|
396
396
|
}
|
|
397
|
+
/** The setup-devenv step's `uses` and the scope its task records start from: a release's tests are CI's. */
|
|
398
|
+
function setupDevenvUsesLines() {
|
|
399
|
+
return [
|
|
400
|
+
' uses: ./.github/actions/setup-devenv',
|
|
401
|
+
' with:',
|
|
402
|
+
` records-workflow: ${CI_WORKFLOW_NAME}`,
|
|
403
|
+
` records-job: ${CI_JOB_ID}`,
|
|
404
|
+
];
|
|
405
|
+
}
|
|
397
406
|
function yamlLinesForStep(step, options) {
|
|
398
407
|
switch (step.kind) {
|
|
399
408
|
case PublishWorkflowStepKind.Checkout:
|
|
@@ -414,7 +423,7 @@ function yamlLinesForStep(step, options) {
|
|
|
414
423
|
case PublishWorkflowStepKind.CargoCredentials:
|
|
415
424
|
return cargoCredentialsStepLines(options);
|
|
416
425
|
case PublishWorkflowStepKind.SetupDevenv:
|
|
417
|
-
return [` - name: ${step.name}`, ' id: setup',
|
|
426
|
+
return [` - name: ${step.name}`, ' id: setup', ...setupDevenvUsesLines()];
|
|
418
427
|
case PublishWorkflowStepKind.ConfigureReleaseAuthor:
|
|
419
428
|
return [
|
|
420
429
|
` - name: ${step.name}`,
|
|
@@ -819,7 +828,7 @@ function renderMacosPlatformSteps(options) {
|
|
|
819
828
|
if (siblingSourceCheckouts.length > 0) {
|
|
820
829
|
lines.push('', ` # Step ${stepNumber++}`, ...siblingSourceCheckouts);
|
|
821
830
|
}
|
|
822
|
-
lines.push('', ` # Step ${stepNumber++}. Composite action internals do not affect top-level job step`, ' # anchors; update these comments if top-level steps move.', ' - name: 🧱 Setup Nix/devenv', ' id: setup',
|
|
831
|
+
lines.push('', ` # Step ${stepNumber++}. Composite action internals do not affect top-level job step`, ' # anchors; update these comments if top-level steps move.', ' - name: 🧱 Setup Nix/devenv', ' id: setup', ...setupDevenvUsesLines());
|
|
823
832
|
if (isSmoothBricksCodebasePackageName(options.repoName)) {
|
|
824
833
|
lines.push('', ` # Step ${stepNumber++}`, ' - name: 🏗️ Build smoo Nx version actions', ' # Nx Release loads @smoothbricks/nx-plugin/version-actions through the', ' # export map in its own node process, and versioning runs before the', ' # build phase, so the hook must exist in dist first. Downstream', ' # consumers install the published package and skip this bootstrap.', ' #', ' # `nx` cannot do it: the project graph loads this very plugin, so', ' # `nx build nx-plugin` deadlocks on the executor it is building.', ' # ttsc needs only the package tsconfig -- the bootstrap the shell entry', ' # runs (tooling/direnv/enter-shell.ts) -- and emits as the typescript-emit', ' # executor does (EMIT_OVERRIDES), so dist holds no build info.', ' working-directory: packages/nx-plugin', ' run: bun ../../tooling/ttsc-emit.ts');
|
|
825
834
|
}
|
|
@@ -874,7 +883,7 @@ function renderFinalLinuxPublishSteps(options) {
|
|
|
874
883
|
if (siblingSourceCheckouts.length > 0) {
|
|
875
884
|
lines.push('', ` # Step ${stepNumber++}`, ...siblingSourceCheckouts);
|
|
876
885
|
}
|
|
877
|
-
lines.push('', ` # Step ${stepNumber++}`, ' - name: 🧱 Setup Nix/devenv', ' # Pending release repair builds historical npm gaps before the current', ' # verified artifacts are restored, so this job still needs the full', ' # toolchain even though current release publishing is prebuilt-only.', ' id: setup',
|
|
886
|
+
lines.push('', ` # Step ${stepNumber++}`, ' - name: 🧱 Setup Nix/devenv', ' # Pending release repair builds historical npm gaps before the current', ' # verified artifacts are restored, so this job still needs the full', ' # toolchain even though current release publishing is prebuilt-only.', ' id: setup', ...setupDevenvUsesLines(), '', ` # Step ${stepNumber++}`, ...artifactStepLines(options.actionsProvider, '📥 Download candidate artifacts', 'download', [
|
|
878
887
|
`pattern: publish-*-${githubExpression('github.run_id')}`,
|
|
879
888
|
`path: ${githubExpression('runner.temp')}/publish-artifacts`,
|
|
880
889
|
'merge-multiple: false',
|
|
@@ -113,6 +113,62 @@ diff --git a/lib/internal/javascriptRuntimeCapabilities.js b/lib/internal/javasc
|
|
|
113
113
|
// Inside a ttsx run this is the user's NODE_OPTIONS, not ttsx's preloads,
|
|
114
114
|
// which would refuse the cache and run in the probe (#1740).
|
|
115
115
|
const effectiveEnv = TtsxNodeOptions_1.TtsxNodeOptions.forHelpers(SidecarEnvironment_1.SidecarEnvironment.merge(process.env, env));
|
|
116
|
+
diff --git a/lib/plugin/internal/load/loadProjectPlugins.js b/lib/plugin/internal/load/loadProjectPlugins.js
|
|
117
|
+
--- a/lib/plugin/internal/load/loadProjectPlugins.js
|
|
118
|
+
+++ b/lib/plugin/internal/load/loadProjectPlugins.js
|
|
119
|
+
@@ -275,10 +275,14 @@
|
|
120
|
+
// With the witness of each such reading, so a build of a directory package
|
|
121
|
+
// selection already read keys on that reading instead of probing Go again.
|
|
122
|
+
const environmentWitnesses = new Map();
|
|
123
|
+
+ // And one walk of each SDK those readings key on, shared while the load runs
|
|
124
|
+
+ // synchronously. A watch delivery ends that batch: the owner may await, and
|
|
125
|
+
+ // time and edits pass, so the readings after it walk again.
|
|
126
|
+
const readings = {
|
|
127
|
+
sources: sourceDigests,
|
|
128
|
+
environments: environmentDigests,
|
|
129
|
+
witnesses: environmentWitnesses,
|
|
130
|
+
+ goRoots: new Map(),
|
|
131
|
+
};
|
|
132
|
+
// Records describing sources must never land inside one, so the store is
|
|
133
|
+
// admitted for source proofs only once every source of the load is known.
|
|
134
|
+
@@ -314,6 +318,7 @@
|
|
135
|
+
// A worker owns the watch baseline now. Complete this handoff before Go
|
|
136
|
+
// metadata or source proof consumes the roots, preserving #1728 (#1758).
|
|
137
|
+
yield options.onWatchInputs([...interests].sort(), sourceIdentities);
|
|
138
|
+
+ readings.goRoots.clear();
|
|
139
|
+
const initialSize = interests.size;
|
|
140
|
+
for (const candidate of candidates) {
|
|
141
|
+
// Nested source-only proposals replace the outer root manifests. Do not
|
|
142
|
+
@@ -324,8 +329,10 @@
|
|
143
|
+
if (reportsPluginSource(directory))
|
|
144
|
+
interests.add(directory);
|
|
145
|
+
}
|
|
146
|
+
- if (interests.size !== initialSize)
|
|
147
|
+
+ if (interests.size !== initialSize) {
|
|
148
|
+
yield options.onWatchInputs([...interests].sort(), sourceIdentities);
|
|
149
|
+
+ readings.goRoots.clear();
|
|
150
|
+
+ }
|
|
151
|
+
}
|
|
152
|
+
const proposals = NativeSourcePackages_1.NativeSourcePackages.propose(candidates.map((candidate) => ({
|
|
153
|
+
...candidate,
|
|
154
|
+
@@ -370,6 +377,8 @@
|
|
155
|
+
// Admission can now narrow the provisional interests without restamping the
|
|
156
|
+
// retained package/module baselines. Final host errors still keep these roots.
|
|
157
|
+
yield options.onWatchInputs?.(buildDirectories, sourceIdentities);
|
|
158
|
+
+ if (options.onWatchInputs !== undefined)
|
|
159
|
+
+ readings.goRoots.clear();
|
|
160
|
+
const keyedDirectories = new Set(buildDirectories);
|
|
161
|
+
const linkedContributors = records
|
|
162
|
+
.filter((record) => record.stage === "transform")
|
|
163
|
+
@@ -564,7 +573,7 @@
|
|
164
|
+
env: effectiveEnv,
|
|
165
|
+
sourceDigest,
|
|
166
|
+
environment: environmentDigests.get(directory) ??
|
|
167
|
+
- (0, pluginBuildEnvironment_1.pluginBuildEnvironment)(directory, effectiveEnv, undefined, sourceIdentities),
|
|
168
|
+
+ (0, pluginBuildEnvironment_1.pluginBuildEnvironment)(directory, effectiveEnv, undefined, sourceIdentities, readings.goRoots),
|
|
169
|
+
}),
|
|
170
|
+
])),
|
|
171
|
+
project,
|
|
116
172
|
diff --git a/lib/plugin/internal/source/GoSourceInputs.js b/lib/plugin/internal/source/GoSourceInputs.js
|
|
117
173
|
--- a/lib/plugin/internal/source/GoSourceInputs.js
|
|
118
174
|
+++ b/lib/plugin/internal/source/GoSourceInputs.js
|
|
@@ -133,6 +189,40 @@ diff --git a/lib/plugin/internal/source/GoSourceInputs.js b/lib/plugin/internal/
|
|
|
133
189
|
// Only the actual `go build` needs ttsc's GOCACHE; read-only metadata spawns
|
|
134
190
|
// (`go mod edit`, `go env`, `go version`) call goBuildEnv with no cache root
|
|
135
191
|
// and inherit ambient GOCACHE rather than receiving the managed build
|
|
192
|
+
diff --git a/lib/plugin/internal/source/NativeSourcePackages.d.ts b/lib/plugin/internal/source/NativeSourcePackages.d.ts
|
|
193
|
+
--- a/lib/plugin/internal/source/NativeSourcePackages.d.ts
|
|
194
|
+
+++ b/lib/plugin/internal/source/NativeSourcePackages.d.ts
|
|
195
|
+
@@ -1,5 +1,6 @@
|
|
196
|
+
import { PluginBuildEnvironmentWitness } from "./PluginBuildEnvironmentWitness";
|
|
197
|
+
import { PluginContentIdentities } from "./PluginContentIdentities";
|
|
198
|
+
+import type { GoRootBatch } from "./hashPluginBuildEnvironment";
|
|
199
|
+
import { SourcePluginWorkspace } from "./SourcePluginWorkspace";
|
|
200
|
+
/**
|
|
201
|
+
* Observe Go-selected packages under the native builder's workspace policy.
|
|
202
|
+
@@ -68,6 +69,11 @@
|
|
203
|
+
* directory keys on that reading instead of probing Go again.
|
|
204
|
+
*/
|
|
205
|
+
witnesses?: Map<string, PluginBuildEnvironmentWitness.Record>;
|
|
206
|
+
+ /**
|
|
207
|
+
+ * The load's synchronous batch of SDK observations
|
|
208
|
+
+ * (`hashPluginBuildEnvironment`), cleared at each watch delivery.
|
|
209
|
+
+ */
|
|
210
|
+
+ goRoots?: GoRootBatch;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Observe entries together in a private module layout for their context.
|
|
214
|
+
diff --git a/lib/plugin/internal/source/NativeSourcePackages.js b/lib/plugin/internal/source/NativeSourcePackages.js
|
|
215
|
+
--- a/lib/plugin/internal/source/NativeSourcePackages.js
|
|
216
|
+
+++ b/lib/plugin/internal/source/NativeSourcePackages.js
|
|
217
|
+
@@ -391,7 +391,7 @@
|
|
218
|
+
if (environment === undefined) {
|
|
219
|
+
const hash = node_crypto_1.default.createHash("sha256");
|
|
220
|
+
const witness = new Map();
|
|
221
|
+
- (0, hashPluginBuildEnvironment_1.hashPluginBuildEnvironment)(hash, goBinary, moduleRoot, env, { readFile: (location) => node_fs_1.default.readFileSync(location) }, witness, identities);
|
|
222
|
+
+ (0, hashPluginBuildEnvironment_1.hashPluginBuildEnvironment)(hash, goBinary, moduleRoot, env, { readFile: (location) => node_fs_1.default.readFileSync(location) }, witness, identities, readings.goRoots);
|
|
223
|
+
environment = hash.digest("hex");
|
|
224
|
+
readings.environments?.set(resolvedRoot, environment);
|
|
225
|
+
readings.witnesses?.set(resolvedRoot, witness);
|
|
136
226
|
diff --git a/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js b/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js
|
|
137
227
|
--- a/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js
|
|
138
228
|
+++ b/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js
|
|
@@ -160,6 +250,245 @@ diff --git a/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js b/lib/
|
|
|
160
250
|
worker = created;
|
|
161
251
|
const retire = () => {
|
|
162
252
|
if (worker === created)
|
|
253
|
+
diff --git a/lib/plugin/internal/source/collectPluginSourceFiles.d.ts b/lib/plugin/internal/source/collectPluginSourceFiles.d.ts
|
|
254
|
+
--- a/lib/plugin/internal/source/collectPluginSourceFiles.d.ts
|
|
255
|
+
+++ b/lib/plugin/internal/source/collectPluginSourceFiles.d.ts
|
|
256
|
+
@@ -21,7 +21,11 @@
|
|
257
|
+
* A link (a symbolic link or a Windows junction) outside those directories is
|
|
258
|
+
* refused rather than skipped. The build would compile what it names, which
|
|
259
|
+
* neither this list nor anything keyed on it covers; a Go module zip excludes
|
|
260
|
+
- * links from a module's content for the same reason.
|
|
261
|
+
+ * links from a module's content for the same reason. A link at or below a name
|
|
262
|
+
+ * the go tool passes over (one beginning with `.` or `_`, or `testdata`; `go
|
|
263
|
+
+ * help packages`) is skipped like one in an excluded directory: Go neither
|
|
264
|
+
+ * compiles it nor embeds a link. Tools keep links there, as cowshed does for a
|
|
265
|
+
+ * package's `.cache/lmao`, and refusing one cost the module its source identity.
|
|
266
|
+
*
|
|
267
|
+
* @param root The source directory: a plugin's Go module root, an overlay
|
|
268
|
+
* module, a contributor's source, or a `replace` target outside the module.
|
|
269
|
+
diff --git a/lib/plugin/internal/source/collectPluginSourceFiles.js b/lib/plugin/internal/source/collectPluginSourceFiles.js
|
|
270
|
+
--- a/lib/plugin/internal/source/collectPluginSourceFiles.js
|
|
271
|
+
+++ b/lib/plugin/internal/source/collectPluginSourceFiles.js
|
|
272
|
+
@@ -30,7 +30,11 @@
|
|
273
|
+
* A link (a symbolic link or a Windows junction) outside those directories is
|
|
274
|
+
* refused rather than skipped. The build would compile what it names, which
|
|
275
|
+
* neither this list nor anything keyed on it covers; a Go module zip excludes
|
|
276
|
+
- * links from a module's content for the same reason.
|
|
277
|
+
+ * links from a module's content for the same reason. A link at or below a name
|
|
278
|
+
+ * the go tool passes over (one beginning with `.` or `_`, or `testdata`; `go
|
|
279
|
+
+ * help packages`) is skipped like one in an excluded directory: Go neither
|
|
280
|
+
+ * compiles it nor embeds a link. Tools keep links there, as cowshed does for a
|
|
281
|
+
+ * package's `.cache/lmao`, and refusing one cost the module its source identity.
|
|
282
|
+
*
|
|
283
|
+
* @param root The source directory: a plugin's Go module root, an overlay
|
|
284
|
+
* module, a contributor's source, or a `replace` target outside the module.
|
|
285
|
+
@@ -72,7 +76,8 @@
|
|
286
|
+
// list, the key, nor a watch covers, and a copy of the module cannot
|
|
287
|
+
// recreate a link without the symlink privilege on Windows.
|
|
288
|
+
if (GoSourceInputs_1.GoSourceInputs.shouldPruneDirectory(entry.name) ||
|
|
289
|
+
- GoSourceInputs_1.GoSourceInputs.shouldOmitSourceFile(entry.name))
|
|
290
|
+
+ GoSourceInputs_1.GoSourceInputs.shouldOmitSourceFile(entry.name) ||
|
|
291
|
+
+ goToolIgnores(root, full))
|
|
292
|
+
continue;
|
|
293
|
+
throw new Error(`ttsc: plugin source ${root} contains a link at ${full}. A plugin's Go ` +
|
|
294
|
+
`sources are its own files, as a Go module zip holds them: replace the ` +
|
|
295
|
+
@@ -92,4 +97,15 @@
|
|
296
|
+
out.push(full);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
+/**
|
|
300
|
+
+ * Whether the go tool passes over `full`: it ignores every directory and file
|
|
301
|
+
+ * whose name begins with "." or "_", and directories named "testdata" (`go help
|
|
302
|
+
+ * packages`), so nothing at or below such a name is compiled.
|
|
303
|
+
+ */
|
|
304
|
+
+function goToolIgnores(root, full) {
|
|
305
|
+
+ return node_path_1.default
|
|
306
|
+
+ .relative(root, full)
|
|
307
|
+
+ .split(node_path_1.default.sep)
|
|
308
|
+
+ .some((name) => name.startsWith(".") || name.startsWith("_") || name === "testdata");
|
|
309
|
+
+}
|
|
310
|
+
//# sourceMappingURL=collectPluginSourceFiles.js.map
|
|
311
|
+
|
|
312
|
+
diff --git a/lib/plugin/internal/source/hashPluginBuildEnvironment.d.ts b/lib/plugin/internal/source/hashPluginBuildEnvironment.d.ts
|
|
313
|
+
--- a/lib/plugin/internal/source/hashPluginBuildEnvironment.d.ts
|
|
314
|
+
+++ b/lib/plugin/internal/source/hashPluginBuildEnvironment.d.ts
|
|
315
|
+
@@ -37,6 +37,10 @@
|
|
316
|
+
* @param identities Record store that lets a new process prove the GOROOT
|
|
317
|
+
* corpus and executable bytes from their metadata (`PluginContentIdentities`,
|
|
318
|
+
* #1722); without it every process reads them.
|
|
319
|
+
+ * @param goRoots The caller's synchronous batch of SDK observations, by
|
|
320
|
+
+ * resolved GOROOT: readings passed the same map walk each SDK once and take
|
|
321
|
+
+ * its witness entries from that walk. The caller clears it at any await,
|
|
322
|
+
+ * delivery or publication boundary; without it the SDK is walked fresh.
|
|
323
|
+
* @evidence contracts/common.md#principled-implementation Fixed artifact flags, observed compiler bytes/version, selected reported-or-fallback build values, named command executables and selected SDK files enter the same framed identity used by source-state reporting. Fallback values and metadata-qualified reuse are explicit premises, not complete observation of arbitrary toolchain inputs. GOFLAGS enters without ttsc's own compiler-target tag, so the caller's environment reproduces a 7.1 load's digest; targets are separated by their overlay modules in the build key.
|
|
324
|
+
* @evidence contracts/common.md#clear-and-simple-design Private helpers separate compiler identity, Go-reported settings, external variables and SDK content while sharing one hash sink and optional pre-read witness.
|
|
325
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Cache signatures include real identity/change metadata and effective invocation context; failed SDK witnessing refuses reuse rather than accepting a VERSION-only proxy.
|
|
326
|
+
@@ -48,4 +52,18 @@
|
|
327
|
+
*/
|
|
328
|
+
export declare function hashPluginBuildEnvironment(hash: {
|
|
329
|
+
update(data: string): unknown;
|
|
330
|
+
-}, goBinary: string | undefined, directory: string, env: NodeJS.ProcessEnv, filesystem: SourceBuildFilesystemOperations, witness?: PluginBuildEnvironmentWitness.Record, identities?: PluginContentIdentities.Store): void;
|
|
331
|
+
+}, goBinary: string | undefined, directory: string, env: NodeJS.ProcessEnv, filesystem: SourceBuildFilesystemOperations, witness?: PluginBuildEnvironmentWitness.Record, identities?: PluginContentIdentities.Store, goRoots?: GoRootBatch): void;
|
|
332
|
+
+/** One synchronous batch's SDK observations, by resolved GOROOT (`hashPluginBuildEnvironment`). */
|
|
333
|
+
+export type GoRootBatch = Map<string, GoRootObservation>;
|
|
334
|
+
+/** One SDK walk: the store references it was judged against, its witness entries and its snapshot. */
|
|
335
|
+
+export interface GoRootObservation {
|
|
336
|
+
+ readonly references: ReadonlyMap<bigint, bigint> | undefined;
|
|
337
|
+
+ readonly observations: PluginBuildEnvironmentWitness.Record;
|
|
338
|
+
+ readonly snapshot: {
|
|
339
|
+
+ readonly complete: boolean;
|
|
340
|
+
+ readonly files: readonly string[];
|
|
341
|
+
+ readonly topology: readonly string[];
|
|
342
|
+
+ readonly signature: string;
|
|
343
|
+
+ readonly separable: boolean;
|
|
344
|
+
+ };
|
|
345
|
+
+}
|
|
346
|
+
diff --git a/lib/plugin/internal/source/hashPluginBuildEnvironment.js b/lib/plugin/internal/source/hashPluginBuildEnvironment.js
|
|
347
|
+
--- a/lib/plugin/internal/source/hashPluginBuildEnvironment.js
|
|
348
|
+
+++ b/lib/plugin/internal/source/hashPluginBuildEnvironment.js
|
|
349
|
+
@@ -50,6 +50,10 @@
|
|
350
|
+
* @param identities Record store that lets a new process prove the GOROOT
|
|
351
|
+
* corpus and executable bytes from their metadata (`PluginContentIdentities`,
|
|
352
|
+
* #1722); without it every process reads them.
|
|
353
|
+
+ * @param goRoots The caller's synchronous batch of SDK observations, by
|
|
354
|
+
+ * resolved GOROOT: readings passed the same map walk each SDK once and take
|
|
355
|
+
+ * its witness entries from that walk. The caller clears it at any await,
|
|
356
|
+
+ * delivery or publication boundary; without it the SDK is walked fresh.
|
|
357
|
+
* @evidence contracts/common.md#principled-implementation Fixed artifact flags, observed compiler bytes/version, selected reported-or-fallback build values, named command executables and selected SDK files enter the same framed identity used by source-state reporting. Fallback values and metadata-qualified reuse are explicit premises, not complete observation of arbitrary toolchain inputs. GOFLAGS enters without ttsc's own compiler-target tag, so the caller's environment reproduces a 7.1 load's digest; targets are separated by their overlay modules in the build key.
|
|
358
|
+
* @evidence contracts/common.md#clear-and-simple-design Private helpers separate compiler identity, Go-reported settings, external variables and SDK content while sharing one hash sink and optional pre-read witness.
|
|
359
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Cache signatures include real identity/change metadata and effective invocation context; failed SDK witnessing refuses reuse rather than accepting a VERSION-only proxy.
|
|
360
|
+
@@ -59,7 +63,7 @@
|
|
361
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Compiler memo identity includes selected path/file metadata and invocation cwd/environment; SDK aggregate reuse requires matching complete ordered metadata/topology. With a record store, a new process reuses the SDK aggregate and executable digests only while their signatures match the recorded ones and every stamp is separable from a freshly minted reference (#1722); `go version` and `go env` stay live because they report toolchain selection no file metadata shows. All of this relies on native metadata distinguishability and sequential observation premises. Physical directories expand once per selection policy while aliases retain edges; optional caller witnesses receive reached selected dependencies.
|
|
362
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Compiler, Go-environment-path and SDK maps retain historical distinct tool/context/root keys without eviction; persisted records belong to the single-file collector. SDK population/topology and full individual file reads contribute transient bytes; synchronous probes delegate process/capture lifetime to their owner and do not certify arbitrary descendants are gone. No independent entry/record/file/output byte ceiling is imposed here.
|
|
363
|
+
*/
|
|
364
|
+
-function hashPluginBuildEnvironment(hash, goBinary, directory, env, filesystem, witness, identities) {
|
|
365
|
+
+function hashPluginBuildEnvironment(hash, goBinary, directory, env, filesystem, witness, identities, goRoots) {
|
|
366
|
+
// Fixed artifact policy must invalidate binaries and reported source states
|
|
367
|
+
// together, including binaries cached before this policy was introduced.
|
|
368
|
+
hash.update(JSON.stringify(["source-build-flags", GoSourceInputs_1.GoSourceInputs.BUILD_FLAGS]));
|
|
369
|
+
@@ -69,7 +73,7 @@
|
|
370
|
+
resolveGoCompilerIdentity(goBinary, env, directory, witness, identities),
|
|
371
|
+
]));
|
|
372
|
+
}
|
|
373
|
+
- hashGoBuildEnvironment(hash, goBinary, directory, env, filesystem, witness, identities);
|
|
374
|
+
+ hashGoBuildEnvironment(hash, goBinary, directory, env, filesystem, witness, identities, goRoots);
|
|
375
|
+
hashExternalGoBuildEnvironment(hash, env);
|
|
376
|
+
}
|
|
377
|
+
// Go build environment values that can change the produced binary or decide
|
|
378
|
+
@@ -296,8 +300,8 @@
|
|
379
|
+
hash.update(node_fs_1.default.readFileSync(file));
|
|
380
|
+
return hash.digest("hex");
|
|
381
|
+
}
|
|
382
|
+
-function hashGoBuildEnvironment(hash, goBinary, cwd, env, filesystem, witness, identities) {
|
|
383
|
+
- const values = resolveGoBuildEnvironment(goBinary, cwd, env, filesystem, witness, identities);
|
|
384
|
+
+function hashGoBuildEnvironment(hash, goBinary, cwd, env, filesystem, witness, identities, goRoots) {
|
|
385
|
+
+ const values = resolveGoBuildEnvironment(goBinary, cwd, env, filesystem, witness, identities, goRoots);
|
|
386
|
+
for (const key of GO_BUILD_ENV_KEYS) {
|
|
387
|
+
const value = values.get(key);
|
|
388
|
+
if (value !== undefined && value !== "") {
|
|
389
|
+
@@ -305,7 +309,7 @@
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
-function resolveGoBuildEnvironment(goBinary, cwd, env, filesystem, witness, identities) {
|
|
394
|
+
+function resolveGoBuildEnvironment(goBinary, cwd, env, filesystem, witness, identities, goRoots) {
|
|
395
|
+
const values = new Map();
|
|
396
|
+
if (goBinary !== undefined) {
|
|
397
|
+
const parsed = GoEnvironmentReading_1.GoEnvironmentReading.read(goBinary, cwd, env, GO_BUILD_ENV_KEYS, witness, identities);
|
|
398
|
+
@@ -314,7 +318,7 @@
|
|
399
|
+
for (const key of GO_BUILD_ENV_KEYS) {
|
|
400
|
+
const raw = parsed[key];
|
|
401
|
+
if (typeof raw === "string" && raw !== "") {
|
|
402
|
+
- values.set(key, normalizeGoBuildEnvValue(key, raw, env, filesystem, witness, identities));
|
|
403
|
+
+ values.set(key, normalizeGoBuildEnvValue(key, raw, env, filesystem, witness, identities, goRoots));
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
@@ -329,19 +333,19 @@
|
|
408
|
+
continue;
|
|
409
|
+
const value = env[key];
|
|
410
|
+
if (value !== undefined && value !== "") {
|
|
411
|
+
- values.set(key, normalizeGoBuildEnvValue(key, value, env, filesystem, witness, identities));
|
|
412
|
+
+ values.set(key, normalizeGoBuildEnvValue(key, value, env, filesystem, witness, identities, goRoots));
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return values;
|
|
416
|
+
}
|
|
417
|
+
-function normalizeGoBuildEnvValue(key, value, env, filesystem, witness, identities) {
|
|
418
|
+
+function normalizeGoBuildEnvValue(key, value, env, filesystem, witness, identities, goRoots) {
|
|
419
|
+
if (key === "GOROOT") {
|
|
420
|
+
// Root/version observations also cover a missing SDK. The complete SDK
|
|
421
|
+
// manifest below witnesses contributing files and directories, including
|
|
422
|
+
// nested content changes that do not move the root or VERSION metadata.
|
|
423
|
+
PluginBuildEnvironmentWitness_1.PluginBuildEnvironmentWitness.add(witness, value);
|
|
424
|
+
PluginBuildEnvironmentWitness_1.PluginBuildEnvironmentWitness.add(witness, node_path_1.default.join(value, "VERSION"));
|
|
425
|
+
- return resolveGoRootCacheIdentity(value, filesystem, witness, identities);
|
|
426
|
+
+ return resolveGoRootCacheIdentity(value, filesystem, witness, identities, goRoots);
|
|
427
|
+
}
|
|
428
|
+
if (key === "GOFLAGS") {
|
|
429
|
+
// ttsc's compiler-target tag is not the caller's Go environment. Omitting
|
|
430
|
+
@@ -445,10 +449,12 @@
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
// GOROOT is usually stable but its selected source/tool payloads contribute to
|
|
434
|
+
-// every plugin key. Retain only the final aggregate
|
|
435
|
+
-// identity, guarded by a fresh metadata/topology manifest on every call. A
|
|
436
|
+
-// changed or incomplete manifest falls through to the record store, then to a
|
|
437
|
+
-// full content read.
|
|
438
|
+
+// every plugin key. Retain only the final aggregate identity, guarded by a
|
|
439
|
+
+// metadata/topology manifest observed once per synchronous batch: a caller's
|
|
440
|
+
+// `goRoots` map (one load between its watch deliveries, cleared at each) shares
|
|
441
|
+
+// one walk and its witness entries across the batch's readings, and a call with
|
|
442
|
+
+// no batch walks fresh. A changed or incomplete manifest falls through to the
|
|
443
|
+
+// record store, then to a full content read.
|
|
444
|
+
//
|
|
445
|
+
// WARNING (#1186, #1722): this map lives only as long as the process. #1186
|
|
446
|
+
// stopped at it, so every CLI launch, worker and bundler restart still read the
|
|
447
|
+
@@ -456,12 +462,12 @@
|
|
448
|
+
// below is what carries the identity across processes; never drop it in favor
|
|
449
|
+
// of this memo alone.
|
|
450
|
+
const goRootIdentityCache = new Map();
|
|
451
|
+
-function resolveGoRootCacheIdentity(goRoot, filesystem, witness, identities) {
|
|
452
|
+
+function resolveGoRootCacheIdentity(goRoot, filesystem, witness, identities, goRoots) {
|
|
453
|
+
const resolved = resolveRealPath(goRoot);
|
|
454
|
+
if (!node_fs_1.default.existsSync(resolved)) {
|
|
455
|
+
return `missing:${goRoot}`;
|
|
456
|
+
}
|
|
457
|
+
- const snapshot = collectGoRootIdentitySnapshot(resolved, witness, identities?.references);
|
|
458
|
+
+ const snapshot = observeGoRoot(resolved, witness, identities?.references, goRoots);
|
|
459
|
+
if (!snapshot.complete)
|
|
460
|
+
PluginBuildEnvironmentWitness_1.PluginBuildEnvironmentWitness.refuse(witness, resolved);
|
|
461
|
+
if (snapshot.complete) {
|
|
462
|
+
@@ -502,6 +508,29 @@
|
|
463
|
+
}
|
|
464
|
+
return identity;
|
|
465
|
+
}
|
|
466
|
+
+// One SDK walk per synchronous batch. A reading the batch already walked this
|
|
467
|
+
+// root for takes that walk's snapshot and its first-observed witness entries,
|
|
468
|
+
+// which a later holds() compares against current metadata as it would its own.
|
|
469
|
+
+// A different record store's references make another walk.
|
|
470
|
+
+function observeGoRoot(resolved, witness, references, goRoots) {
|
|
471
|
+
+ let observed = goRoots?.get(resolved);
|
|
472
|
+
+ if (observed === undefined || observed.references !== references) {
|
|
473
|
+
+ if (goRoots === undefined)
|
|
474
|
+
+ return collectGoRootIdentitySnapshot(resolved, witness, references);
|
|
475
|
+
+ const observations = new Map();
|
|
476
|
+
+ observed = {
|
|
477
|
+
+ observations,
|
|
478
|
+
+ references,
|
|
479
|
+
+ snapshot: collectGoRootIdentitySnapshot(resolved, observations, references),
|
|
480
|
+
+ };
|
|
481
|
+
+ goRoots.set(resolved, observed);
|
|
482
|
+
+ }
|
|
483
|
+
+ if (witness !== undefined)
|
|
484
|
+
+ for (const [key, signature] of observed.observations)
|
|
485
|
+
+ if (!witness.has(key))
|
|
486
|
+
+ witness.set(key, signature);
|
|
487
|
+
+ return observed.snapshot;
|
|
488
|
+
+}
|
|
489
|
+
function collectGoRootIdentitySnapshot(root, witness, references) {
|
|
490
|
+
const out = [];
|
|
491
|
+
const state = { complete: true, separable: references !== undefined };
|
|
163
492
|
diff --git a/lib/plugin/internal/source/inspectPluginBuildLock.js b/lib/plugin/internal/source/inspectPluginBuildLock.js
|
|
164
493
|
--- a/lib/plugin/internal/source/inspectPluginBuildLock.js
|
|
165
494
|
+++ b/lib/plugin/internal/source/inspectPluginBuildLock.js
|
|
@@ -204,6 +533,65 @@ diff --git a/lib/plugin/internal/source/inspectPluginBuildLock.js b/lib/plugin/i
|
|
|
204
533
|
/**
|
|
205
534
|
* Whether a path lookup proves absence. Permission and sharing failures are
|
|
206
535
|
* inconclusive, never evidence of a released or old abandoned generation.
|
|
536
|
+
diff --git a/lib/plugin/internal/source/pluginBuildEnvironment.d.ts b/lib/plugin/internal/source/pluginBuildEnvironment.d.ts
|
|
537
|
+
--- a/lib/plugin/internal/source/pluginBuildEnvironment.d.ts
|
|
538
|
+
+++ b/lib/plugin/internal/source/pluginBuildEnvironment.d.ts
|
|
539
|
+
@@ -1,5 +1,6 @@
|
|
540
|
+
import type { PluginBuildEnvironmentWitness } from "./PluginBuildEnvironmentWitness";
|
|
541
|
+
import type { PluginContentIdentities } from "./PluginContentIdentities";
|
|
542
|
+
+import type { GoRootBatch } from "./hashPluginBuildEnvironment";
|
|
543
|
+
/**
|
|
544
|
+
* The digest of the environment a plugin build in `directory` is keyed on: the
|
|
545
|
+
* Go compiler the build resolves there, the Go build environment `go env`
|
|
546
|
+
@@ -23,6 +24,8 @@
|
|
547
|
+
* carries (`hashPluginBuildEnvironment`).
|
|
548
|
+
* @param identities Record store that lets a new process prove the SDK and
|
|
549
|
+
* executables from metadata (#1722).
|
|
550
|
+
+ * @param goRoots The caller's synchronous batch of SDK observations
|
|
551
|
+
+ * (`hashPluginBuildEnvironment`), or `undefined` to walk the SDK fresh.
|
|
552
|
+
* @evidence contracts/common.md#principled-implementation The digest uses the same resolved compiler and environment serializer as the binary key, so reported toolchain state denotes the inputs actually used by the build.
|
|
553
|
+
* @evidence contracts/common.md#clear-and-simple-design Compiler selection, executable resolution and hashing each stay with their owning helper; this function only composes one environment reading.
|
|
554
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The result comes from real Go/environment inputs, not a fixed compiler version or a caller-specific substitute.
|
|
555
|
+
@@ -30,7 +33,7 @@
|
|
556
|
+
* @evidence contracts/portability.md#os-neutral-implementation Executable identity is resolved before probing, and Node filesystem/process boundaries implement native spelling rather than assuming Windows or POSIX paths are interchangeable.
|
|
557
|
+
* @evidence contracts/performance.md#efficient-algorithms The wrapper resolves the compiler/tool under the supplied environment before delegating full environment hashing. Native resolution/probes, SDK metadata/name/path sorting and changed-manifest full content reads contribute cost; the final hash output is fixed-width but streamed identity/input text and full-file buffers are not. No independent duplicate source-directory digest scan is added here.
|
|
558
|
+
*
|
|
559
|
+
- * @evidence contracts/performance.md#reuse-equivalent-work This is the fresh-reading boundary required by builds: the Go probes run on every call. Content digests of the SDK and executables are shared across processes only through the supplied record store's separable-signature proof; processPluginBuildEnvironment owns reuse of the whole reading when a consumer permits it.
|
|
560
|
+
+ * @evidence contracts/performance.md#reuse-equivalent-work This is the fresh-reading boundary required by builds: the Go probes run on every call. The SDK walk is fresh too, except inside the caller's synchronous batch (`goRoots`: one load between its watch deliveries, cleared at each), whose readings share one SDK observation as the witness contract allows. Content digests of the SDK and executables are shared across processes only through the supplied record store's separable-signature proof; processPluginBuildEnvironment owns reuse of the whole reading when a consumer permits it.
|
|
561
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Its digest and filesystem adapter are call-local; retained compiler/content memo ownership belongs to the hasher.
|
|
562
|
+
*/
|
|
563
|
+
-export declare function pluginBuildEnvironment(directory: string, env?: NodeJS.ProcessEnv, witness?: PluginBuildEnvironmentWitness.Record, identities?: PluginContentIdentities.Store): string;
|
|
564
|
+
+export declare function pluginBuildEnvironment(directory: string, env?: NodeJS.ProcessEnv, witness?: PluginBuildEnvironmentWitness.Record, identities?: PluginContentIdentities.Store, goRoots?: GoRootBatch): string;
|
|
565
|
+
diff --git a/lib/plugin/internal/source/pluginBuildEnvironment.js b/lib/plugin/internal/source/pluginBuildEnvironment.js
|
|
566
|
+
--- a/lib/plugin/internal/source/pluginBuildEnvironment.js
|
|
567
|
+
+++ b/lib/plugin/internal/source/pluginBuildEnvironment.js
|
|
568
|
+
@@ -32,6 +32,8 @@
|
|
569
|
+
* carries (`hashPluginBuildEnvironment`).
|
|
570
|
+
* @param identities Record store that lets a new process prove the SDK and
|
|
571
|
+
* executables from metadata (#1722).
|
|
572
|
+
+ * @param goRoots The caller's synchronous batch of SDK observations
|
|
573
|
+
+ * (`hashPluginBuildEnvironment`), or `undefined` to walk the SDK fresh.
|
|
574
|
+
* @evidence contracts/common.md#principled-implementation The digest uses the same resolved compiler and environment serializer as the binary key, so reported toolchain state denotes the inputs actually used by the build.
|
|
575
|
+
* @evidence contracts/common.md#clear-and-simple-design Compiler selection, executable resolution and hashing each stay with their owning helper; this function only composes one environment reading.
|
|
576
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The result comes from real Go/environment inputs, not a fixed compiler version or a caller-specific substitute.
|
|
577
|
+
@@ -39,13 +41,13 @@
|
|
578
|
+
* @evidence contracts/portability.md#os-neutral-implementation Executable identity is resolved before probing, and Node filesystem/process boundaries implement native spelling rather than assuming Windows or POSIX paths are interchangeable.
|
|
579
|
+
* @evidence contracts/performance.md#efficient-algorithms The wrapper resolves the compiler/tool under the supplied environment before delegating full environment hashing. Native resolution/probes, SDK metadata/name/path sorting and changed-manifest full content reads contribute cost; the final hash output is fixed-width but streamed identity/input text and full-file buffers are not. No independent duplicate source-directory digest scan is added here.
|
|
580
|
+
*
|
|
581
|
+
- * @evidence contracts/performance.md#reuse-equivalent-work This is the fresh-reading boundary required by builds: the Go probes run on every call. Content digests of the SDK and executables are shared across processes only through the supplied record store's separable-signature proof; processPluginBuildEnvironment owns reuse of the whole reading when a consumer permits it.
|
|
582
|
+
+ * @evidence contracts/performance.md#reuse-equivalent-work This is the fresh-reading boundary required by builds: the Go probes run on every call. The SDK walk is fresh too, except inside the caller's synchronous batch (`goRoots`: one load between its watch deliveries, cleared at each), whose readings share one SDK observation as the witness contract allows. Content digests of the SDK and executables are shared across processes only through the supplied record store's separable-signature proof; processPluginBuildEnvironment owns reuse of the whole reading when a consumer permits it.
|
|
583
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Its digest and filesystem adapter are call-local; retained compiler/content memo ownership belongs to the hasher.
|
|
584
|
+
*/
|
|
585
|
+
-function pluginBuildEnvironment(directory, env = process.env, witness, identities) {
|
|
586
|
+
+function pluginBuildEnvironment(directory, env = process.env, witness, identities, goRoots) {
|
|
587
|
+
const goBinary = GoToolResolution_1.GoToolResolution.resolveGoToolForBuild((0, resolveGoCompiler_1.resolveGoCompiler)(env).binary, env, directory, witness);
|
|
588
|
+
const hash = node_crypto_1.default.createHash("sha256");
|
|
589
|
+
- (0, hashPluginBuildEnvironment_1.hashPluginBuildEnvironment)(hash, goBinary, directory, env, { readFile: (location) => node_fs_1.default.readFileSync(location) }, witness, identities);
|
|
590
|
+
+ (0, hashPluginBuildEnvironment_1.hashPluginBuildEnvironment)(hash, goBinary, directory, env, { readFile: (location) => node_fs_1.default.readFileSync(location) }, witness, identities, goRoots);
|
|
591
|
+
return hash.digest("hex");
|
|
592
|
+
}
|
|
593
|
+
//# sourceMappingURL=pluginBuildEnvironment.js.map
|
|
594
|
+
|
|
207
595
|
diff --git a/lib/plugin/internal/source/waitForPluginBinary.js b/lib/plugin/internal/source/waitForPluginBinary.js
|
|
208
596
|
--- a/lib/plugin/internal/source/waitForPluginBinary.js
|
|
209
597
|
+++ b/lib/plugin/internal/source/waitForPluginBinary.js
|
|
@@ -5,6 +5,18 @@ description: >
|
|
|
5
5
|
the store cache (host store). On ephemeral runners installs a single-user Nix and restores /nix itself from the
|
|
6
6
|
actions cache: store paths and the Nix database come back as files, so no NAR is imported and no daemon is needed.
|
|
7
7
|
|
|
8
|
+
inputs:
|
|
9
|
+
records-workflow:
|
|
10
|
+
description: >
|
|
11
|
+
The workflow whose pushes keep the bounded-exec task records this job's scope starts from, for a workflow whose
|
|
12
|
+
tests are another workflow's (a release's are CI's). Blank means this workflow.
|
|
13
|
+
required: false
|
|
14
|
+
default: ''
|
|
15
|
+
records-job:
|
|
16
|
+
description: The job of that workflow. Blank means this job.
|
|
17
|
+
required: false
|
|
18
|
+
default: ''
|
|
19
|
+
|
|
8
20
|
outputs:
|
|
9
21
|
devenv-cache-hit:
|
|
10
22
|
description: Whether the devenv/direnv cache restored from the exact primary key.
|
|
@@ -84,15 +96,19 @@ runs:
|
|
|
84
96
|
# and their metadata DB together, warm across runs of the same pull
|
|
85
97
|
# request or ref and job.
|
|
86
98
|
#
|
|
87
|
-
# A
|
|
88
|
-
#
|
|
99
|
+
# A scope starts from the task records of other pushes. Each bounded-exec
|
|
100
|
+
# leaf is charged its task's last recorded memory peak
|
|
89
101
|
# (specs/cowshed/05_gateway.md, "Without mbx, every Nx run budgets
|
|
90
|
-
# itself"), and a
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
#
|
|
94
|
-
#
|
|
95
|
-
#
|
|
102
|
+
# itself"), and a task whose record the scope lacks is charged nothing, so
|
|
103
|
+
# the scope's first run of it admits the leaf on CPU tokens alone. A pull
|
|
104
|
+
# request starts from its base branch's pushes, which the same workflow and
|
|
105
|
+
# job run in the base's scope. A workflow whose tests are another
|
|
106
|
+
# workflow's (a release's are CI's) names that workflow and job in
|
|
107
|
+
# records-workflow and records-job, and starts from the pushes to its own
|
|
108
|
+
# ref there. A scope that holds no record of a task takes a copy of the
|
|
109
|
+
# last one its starting scope holds (its verdict.json, nothing beside it),
|
|
110
|
+
# and its own runs replace it. The copy is the record itself, never a
|
|
111
|
+
# second store.
|
|
96
112
|
- name: 📂 Locate the Nx cache on the shared bind
|
|
97
113
|
if: steps.runner-kind.outputs.host == 'true'
|
|
98
114
|
shell: bash
|
|
@@ -104,8 +120,14 @@ runs:
|
|
|
104
120
|
# A pull request's base branch, whose pushes run under refs/heads/<it>;
|
|
105
121
|
# empty for a push.
|
|
106
122
|
BASE_REF: ${{ github.base_ref }}
|
|
123
|
+
# The workflow and job whose pushes keep the records this scope starts
|
|
124
|
+
# from, when they are not this workflow's and job's; empty for both.
|
|
125
|
+
RECORDS_WORKFLOW: ${{ inputs.records-workflow }}
|
|
126
|
+
RECORDS_JOB: ${{ inputs.records-job }}
|
|
107
127
|
run: |
|
|
108
|
-
|
|
128
|
+
# A workflow's directory under the shared bind: its name, slugged.
|
|
129
|
+
lane_of() { printf '%s' "$1" | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9._-' '-'; }
|
|
130
|
+
lane=$(lane_of "$NX_CACHE_LANE")
|
|
109
131
|
# The cache root of the run identity SCOPE_REF names.
|
|
110
132
|
scope_root() {
|
|
111
133
|
scope=$(printf '%s\0%s\0%s\0%s\0%s' "$GITHUB_WORKFLOW" "$SCOPE_REF" "$GITHUB_JOB" "$RUNNER_OS" "$RUNNER_ARCH" | git hash-object --stdin)
|
|
@@ -113,15 +135,30 @@ runs:
|
|
|
113
135
|
}
|
|
114
136
|
NX_CACHE_ROOT=$(scope_root)
|
|
115
137
|
records="$NX_CACHE_ROOT/workspace-data/bounded-exec"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
138
|
+
# The cache root of the scope that job $2 of workflow $1 runs the pushes to ref $3 in.
|
|
139
|
+
scope_root_of() {
|
|
140
|
+
lane=$(lane_of "$1") GITHUB_WORKFLOW="$1" GITHUB_JOB="$2" SCOPE_REF="$3" scope_root
|
|
141
|
+
}
|
|
142
|
+
from_workflow=${RECORDS_WORKFLOW:-$GITHUB_WORKFLOW}
|
|
143
|
+
from_ref=${BASE_REF:+refs/heads/$BASE_REF}
|
|
144
|
+
from_ref=${from_ref:-$SCOPE_REF}
|
|
145
|
+
from=$(scope_root_of "$from_workflow" "${RECORDS_JOB:-$GITHUB_JOB}" "$from_ref")
|
|
146
|
+
if [ "$from" != "$NX_CACHE_ROOT" ]; then
|
|
147
|
+
copied=0
|
|
148
|
+
for verdict in "$from"/workspace-data/bounded-exec/*/verdict.json; do
|
|
119
149
|
[ -e "$verdict" ] || continue
|
|
120
150
|
task=$(basename "$(dirname "$verdict")")
|
|
151
|
+
[ -e "$records/$task/verdict.json" ] && continue
|
|
121
152
|
mkdir -p "$records/$task"
|
|
122
|
-
|
|
153
|
+
# A task that starts again in the scope it came from clears its record first: one gone since the
|
|
154
|
+
# listing has none to give.
|
|
155
|
+
if cp "$verdict" "$records/$task/verdict.json"; then
|
|
156
|
+
copied=$((copied + 1))
|
|
157
|
+
elif [ -e "$verdict" ]; then
|
|
158
|
+
exit 1
|
|
159
|
+
fi
|
|
123
160
|
done
|
|
124
|
-
if [
|
|
161
|
+
if [ "$copied" -gt 0 ]; then echo "task records: $copied from the $from_workflow scope of $from_ref"; fi
|
|
125
162
|
fi
|
|
126
163
|
mkdir -p "$NX_CACHE_ROOT/cache" "$NX_CACHE_ROOT/workspace-data"
|
|
127
164
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smoothbricks/nx-plugin",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./loader.js",
|
|
@@ -652,7 +652,7 @@
|
|
|
652
652
|
"@nx/js": "24.0.3",
|
|
653
653
|
"@smoothbricks/build-inputs": "0.0.2",
|
|
654
654
|
"@smoothbricks/cargo-retain": "0.0.2",
|
|
655
|
-
"@smoothbricks/cowshed": "0.4.
|
|
655
|
+
"@smoothbricks/cowshed": "0.4.6",
|
|
656
656
|
"@smoothbricks/nextest-extract": "0.0.2",
|
|
657
657
|
"jsonc-parser": "^3.3.1",
|
|
658
658
|
"minimatch": "10.2.5",
|
|
@@ -254,6 +254,14 @@ export function defineCiWorkflow(options: CiWorkflowDefinitionOptions): CiWorkfl
|
|
|
254
254
|
*/
|
|
255
255
|
export const CI_CONCURRENCY_GROUP = 'CI-${{ github.event.pull_request.number || github.ref }}';
|
|
256
256
|
|
|
257
|
+
/**
|
|
258
|
+
* The CI workflow's name and its one job's id. A workflow whose tests are CI's (a release's) hands them to the
|
|
259
|
+
* setup-devenv action as `records-workflow` and `records-job`, so a task its Nx scope holds no record of is charged what
|
|
260
|
+
* CI's pushes last recorded of it (specs/cowshed/05_gateway.md, "Without mbx, every Nx run budgets itself").
|
|
261
|
+
*/
|
|
262
|
+
export const CI_WORKFLOW_NAME = 'CI';
|
|
263
|
+
export const CI_JOB_ID = 'main';
|
|
264
|
+
|
|
257
265
|
export function renderCiWorkflowYaml(options: CiWorkflowDefinitionOptions): string {
|
|
258
266
|
const steps = defineCiWorkflow(options);
|
|
259
267
|
return [
|
|
@@ -266,7 +274,7 @@ export function renderCiWorkflowYaml(options: CiWorkflowDefinitionOptions): stri
|
|
|
266
274
|
}
|
|
267
275
|
|
|
268
276
|
function renderCiWorkflowHeader(options: CiWorkflowDefinitionOptions): string {
|
|
269
|
-
return `name:
|
|
277
|
+
return `name: ${CI_WORKFLOW_NAME}
|
|
270
278
|
|
|
271
279
|
on:
|
|
272
280
|
push:
|
|
@@ -303,7 +311,7 @@ defaults:
|
|
|
303
311
|
working-directory: tooling/direnv
|
|
304
312
|
|
|
305
313
|
jobs:
|
|
306
|
-
|
|
314
|
+
${CI_JOB_ID}:
|
|
307
315
|
name: Validate
|
|
308
316
|
${renderRunsOnLine(options.runsOn)}
|
|
309
317
|
timeout-minutes: 45
|
|
@@ -867,8 +875,8 @@ export function cargoCredentialStepLines(step: CiWorkflowStep, config: PackageCa
|
|
|
867
875
|
const mirrorUrl = new URL(origin.internalMirror);
|
|
868
876
|
const mirrorBase = `${mirrorUrl.protocol}//${mirrorUrl.host}/`.replaceAll("'", "'\\''");
|
|
869
877
|
for (const prefix of mirrorRewritePrefixes(origin)) {
|
|
870
|
-
lines.push(
|
|
871
|
-
lines.push(
|
|
878
|
+
lines.push(` echo "GIT_CONFIG_KEY_\${idx}=url.${mirrorBase}.insteadOf"`);
|
|
879
|
+
lines.push(` echo "GIT_CONFIG_VALUE_\${idx}=${prefix.replaceAll("'", "'\\''")}"`);
|
|
872
880
|
lines.push(' idx=$((idx + 1))');
|
|
873
881
|
}
|
|
874
882
|
}
|
|
@@ -17,6 +17,8 @@ import type {
|
|
|
17
17
|
import { isSmoothBricksCodebasePackageName } from '../workspace-package-policy.js';
|
|
18
18
|
import {
|
|
19
19
|
artifactStepLines,
|
|
20
|
+
CI_JOB_ID,
|
|
21
|
+
CI_WORKFLOW_NAME,
|
|
20
22
|
CiWorkflowStepKind,
|
|
21
23
|
cargoCredentialJobEnvLines,
|
|
22
24
|
cargoCredentialStepLines,
|
|
@@ -578,6 +580,16 @@ function commentLinesForStep(step: PublishWorkflowStep): string[] {
|
|
|
578
580
|
return [` # Step ${step.number}`];
|
|
579
581
|
}
|
|
580
582
|
|
|
583
|
+
/** The setup-devenv step's `uses` and the scope its task records start from: a release's tests are CI's. */
|
|
584
|
+
function setupDevenvUsesLines(): string[] {
|
|
585
|
+
return [
|
|
586
|
+
' uses: ./.github/actions/setup-devenv',
|
|
587
|
+
' with:',
|
|
588
|
+
` records-workflow: ${CI_WORKFLOW_NAME}`,
|
|
589
|
+
` records-job: ${CI_JOB_ID}`,
|
|
590
|
+
];
|
|
591
|
+
}
|
|
592
|
+
|
|
581
593
|
function yamlLinesForStep(step: PublishWorkflowStep, options: PublishWorkflowDefinitionOptions): string[] {
|
|
582
594
|
switch (step.kind) {
|
|
583
595
|
case PublishWorkflowStepKind.Checkout:
|
|
@@ -598,7 +610,7 @@ function yamlLinesForStep(step: PublishWorkflowStep, options: PublishWorkflowDef
|
|
|
598
610
|
case PublishWorkflowStepKind.CargoCredentials:
|
|
599
611
|
return cargoCredentialsStepLines(options);
|
|
600
612
|
case PublishWorkflowStepKind.SetupDevenv:
|
|
601
|
-
return [` - name: ${step.name}`, ' id: setup',
|
|
613
|
+
return [` - name: ${step.name}`, ' id: setup', ...setupDevenvUsesLines()];
|
|
602
614
|
case PublishWorkflowStepKind.ConfigureReleaseAuthor:
|
|
603
615
|
return [
|
|
604
616
|
` - name: ${step.name}`,
|
|
@@ -1145,7 +1157,7 @@ function renderMacosPlatformSteps(options: PublishWorkflowDefinitionOptions): st
|
|
|
1145
1157
|
' # anchors; update these comments if top-level steps move.',
|
|
1146
1158
|
' - name: 🧱 Setup Nix/devenv',
|
|
1147
1159
|
' id: setup',
|
|
1148
|
-
|
|
1160
|
+
...setupDevenvUsesLines(),
|
|
1149
1161
|
);
|
|
1150
1162
|
if (isSmoothBricksCodebasePackageName(options.repoName)) {
|
|
1151
1163
|
lines.push(
|
|
@@ -1279,7 +1291,7 @@ function renderFinalLinuxPublishSteps(options: PublishWorkflowDefinitionOptions)
|
|
|
1279
1291
|
' # verified artifacts are restored, so this job still needs the full',
|
|
1280
1292
|
' # toolchain even though current release publishing is prebuilt-only.',
|
|
1281
1293
|
' id: setup',
|
|
1282
|
-
|
|
1294
|
+
...setupDevenvUsesLines(),
|
|
1283
1295
|
'',
|
|
1284
1296
|
` # Step ${stepNumber++}`,
|
|
1285
1297
|
...artifactStepLines(options.actionsProvider, '📥 Download candidate artifacts', 'download', [
|