@smoothbricks/nx-plugin 0.4.27 → 0.4.29
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 +203 -83
- package/dist/bounded-test-policy.d.ts +10 -3
- package/dist/bounded-test-policy.d.ts.map +1 -1
- package/dist/bounded-test-policy.js +19 -25
- package/dist/cargo-closure-input.d.ts +12 -0
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +29 -7
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +42 -19
- package/dist/ensure-built-receipt.d.ts +34 -6
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +265 -159
- package/dist/ensure-built-witness.d.ts +27 -2
- package/dist/ensure-built-witness.d.ts.map +1 -1
- package/dist/ensure-built-witness.js +2176 -15
- package/dist/ensure-built.d.ts +99 -1
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +34 -53
- package/dist/executors/bounded-exec/cpu-pool.d.ts +16 -5
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool.js +43 -19
- package/dist/executors/bounded-exec/executor.d.ts +11 -2
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +139 -39
- package/dist/executors/bounded-exec/ram-temp.d.ts +17 -11
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.js +27 -13
- package/dist/generators/bun-test-tracing/generator.js +2 -2
- package/dist/graph-input-contract.d.ts +98 -0
- package/dist/graph-input-contract.d.ts.map +1 -0
- package/dist/graph-input-contract.js +624 -0
- package/dist/index.d.ts +12 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -3
- package/dist/managed-files/ci-workflow.d.ts.map +1 -1
- package/dist/managed-files/ci-workflow.js +5 -2
- package/dist/managed-files/publish-workflow.d.ts +11 -1
- package/dist/managed-files/publish-workflow.d.ts.map +1 -1
- package/dist/producer-receipts.d.ts +19 -0
- package/dist/producer-receipts.d.ts.map +1 -0
- package/dist/producer-receipts.js +921 -0
- package/dist/testing.d.ts +8 -0
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +58 -0
- package/managed/raw/patches/nx@23.2.1.patch +328 -50
- package/managed/raw/tooling/direnv/developer-links.ts +147 -21
- package/managed/raw/tooling/direnv/devenv.smoo.nix +7 -7
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -5
- package/managed/raw/tooling/direnv/linked-snapshots.ts +206 -40
- package/managed/raw/tooling/direnv/repo-path +15 -2
- package/managed/raw/tooling/direnv/setup-environment.ts +363 -125
- package/managed/templates/github/actions/cache-node-modules/action.yml +9 -0
- package/managed/templates/github/actions/setup-devenv/action.yml +63 -7
- package/nextest.toml +1 -1
- package/package.json +11 -6
- package/src/__tests__/fixture-nx-env.ts +7 -0
- package/src/__tests__/owned-installation.ts +174 -0
- package/src/bin/smoo-nx-bound-failures.test.ts +1 -1
- package/src/bounded-test-policy.test.ts +36 -22
- package/src/bounded-test-policy.ts +19 -27
- package/src/bun-bootstrap.test.ts +1 -1
- package/src/cargo-closure-input.test.ts +60 -11
- package/src/cargo-closure-input.ts +28 -6
- package/src/cargo-resolve-cache.test.ts +140 -25
- package/src/cargo-source-hash.test.ts +78 -3
- package/src/cargo-source-hash.ts +48 -30
- package/src/cross-check-policy.test.ts +2 -2
- package/src/ensure-built-receipt.test.ts +111 -16
- package/src/ensure-built-receipt.ts +251 -149
- package/src/ensure-built-witness.test.ts +197 -13
- package/src/ensure-built-witness.ts +187 -15
- package/src/ensure-built.test.ts +156 -102
- package/src/ensure-built.ts +114 -64
- package/src/executors/bounded-exec/cpu-pool.test.ts +116 -32
- package/src/executors/bounded-exec/cpu-pool.ts +55 -17
- package/src/executors/bounded-exec/cpu-tokens.test.ts +2 -2
- package/src/executors/bounded-exec/executor-host.test.ts +51 -41
- package/src/executors/bounded-exec/executor.test.ts +155 -35
- package/src/executors/bounded-exec/executor.ts +156 -45
- package/src/executors/bounded-exec/progress.test.ts +1 -1
- package/src/executors/bounded-exec/ram-temp-host.test.ts +46 -17
- package/src/executors/bounded-exec/ram-temp.test.ts +65 -3
- package/src/executors/bounded-exec/ram-temp.ts +32 -16
- package/src/executors/bounded-exec/verdict.test.ts +17 -12
- package/src/generators/bounded-test-targets/generator.test.ts +1 -3
- package/src/generators/bun-test-tracing/generator.test.ts +2 -2
- package/src/generators/bun-test-tracing/generator.ts +2 -2
- package/src/graph-input-contract.test.ts +371 -0
- package/src/graph-input-contract.ts +605 -0
- package/src/index.test.ts +3 -3
- package/src/index.ts +24 -3
- package/src/linked-snapshots.nx.test.ts +112 -30
- package/src/managed-files/ci-workflow.ts +5 -2
- package/src/managed-files/publish-workflow.ts +12 -1
- package/src/managed-files/repo-path.test.ts +44 -1
- package/src/managed-files/setup-devenv-free-disk.test.ts +95 -0
- package/src/nextest-code-bound.test.ts +23 -17
- package/src/nextest-partitions.test.ts +7 -1
- package/src/nx-cache-restore-mtime.test.ts +2 -2
- package/src/nx-daemon-claim.test.ts +5 -5
- package/src/nx-daemon-idle-cpu.test.ts +0 -1
- package/src/nx-daemon-idle-policy.test.ts +56 -0
- package/src/nx-daemon-ignore-files.test.ts +2 -2
- package/src/nx-daemon-validity.test.ts +31 -9
- package/src/nx-dot-input-policy.test.ts +5 -5
- package/src/nx-files-archive-racy.test.ts +1 -1
- package/src/nx-incomplete-run-summary.test.ts +1 -1
- package/src/nx-plugin-load-errors.test.ts +2 -2
- package/src/nx-project-graph-errors.test.ts +70 -0
- package/src/nx-skipped-task-exit.test.ts +2 -2
- package/src/nx-store-resolution.test.ts +7 -25
- package/src/nx-task-output-lease.test.ts +3 -3
- package/src/nx-use-local.test.ts +7 -5
- package/src/producer-receipts.test.ts +164 -0
- package/src/producer-receipts.ts +631 -0
- package/src/runtime-input.test.ts +1 -1
- package/src/serial-group-wiring.test.ts +4 -4
- package/src/task-results.test.ts +18 -16
- package/src/test-timings.test.ts +2 -2
- package/src/testing.test.ts +5 -5
- package/src/testing.ts +59 -0
- package/src/typecheck-test-policy.test.ts +1 -1
- package/src/typescript-resolution.test.ts +76 -0
- package/test-timings.json +5 -0
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
*
|
|
27
27
|
* Unlinking a package means removing its link, and the next install puts the
|
|
28
28
|
* lockfile's version there. A dangling link is removed before the install,
|
|
29
|
-
* with a warning.
|
|
29
|
+
* with a warning. A link whose target this process may not read (EPERM in a
|
|
30
|
+
* cowshed sandbox that grants no read of it, EACCES under a directory's mode)
|
|
31
|
+
* is not wrong, only unreadable here: it is kept like a live link, never
|
|
32
|
+
* taken for a dangling one, and said. Links this owner creates for declarations also have a receipt
|
|
30
33
|
* in node_modules/.smoo-declared-links: their alias, declaration and exact link
|
|
31
34
|
* text. A changed declaration can replace that link only while its text still
|
|
32
35
|
* matches the receipt. Unrecorded links and manual retargets stay the developer's.
|
|
@@ -69,8 +72,14 @@
|
|
|
69
72
|
* provider's own builds, lands and installs never change a file a running
|
|
70
73
|
* consumer task resolves (linked-snapshots.ts). The snapshot is taken here, at
|
|
71
74
|
* the install and shell-entry boundary, and only when the provider's Nx
|
|
72
|
-
* targets vouch for every copied byte; otherwise the refusal is said and
|
|
73
|
-
* alias keeps its
|
|
75
|
+
* targets vouch for every copied byte; otherwise the refusal is said and each
|
|
76
|
+
* alias keeps the sealed snapshot its receipt records. An install has re-pointed
|
|
77
|
+
* the alias at the lockfile's version before this file runs as its postinstall,
|
|
78
|
+
* so "keeps" means binding that recorded snapshot again; an alias with none
|
|
79
|
+
* keeps the installed version, and the refusal counts it. The plugin that
|
|
80
|
+
* vouches is the one the declarations bind: a declared @smoothbricks/nx-plugin
|
|
81
|
+
* is probed from its checkout, since every `bun install` has put the published
|
|
82
|
+
* plugin back at its alias before this file runs as the postinstall.
|
|
74
83
|
*
|
|
75
84
|
* Declarations are applied at the end of every install. smoo's root script
|
|
76
85
|
* policy makes the root's `postinstall` run this file, and bun runs the
|
|
@@ -108,7 +117,13 @@ import {
|
|
|
108
117
|
} from 'node:fs';
|
|
109
118
|
import path from 'node:path';
|
|
110
119
|
import type { KeepDeveloperLinksOptions } from '@smoothbricks/nx-plugin/managed-assets';
|
|
111
|
-
import {
|
|
120
|
+
import {
|
|
121
|
+
pluginProbe,
|
|
122
|
+
recordedSnapshot,
|
|
123
|
+
type SealedSnapshot,
|
|
124
|
+
type SnapshotDeclaration,
|
|
125
|
+
snapshotBinding,
|
|
126
|
+
} from './linked-snapshots.ts';
|
|
112
127
|
|
|
113
128
|
interface DeveloperLink {
|
|
114
129
|
/** Where the link is, relative to the project root. */
|
|
@@ -118,9 +133,15 @@ interface DeveloperLink {
|
|
|
118
133
|
}
|
|
119
134
|
|
|
120
135
|
interface DeveloperLinks {
|
|
136
|
+
/** Links kept across an install: every link whose target is not known to be gone, unreadable ones included. */
|
|
121
137
|
readonly live: readonly DeveloperLink[];
|
|
122
138
|
/** Links whose target no longer exists. */
|
|
123
139
|
readonly dangling: readonly DeveloperLink[];
|
|
140
|
+
/**
|
|
141
|
+
* The live links whose target this process may not read, with the error that said so: a sandbox's EPERM or a
|
|
142
|
+
* directory mode's EACCES. Such a link is not wrong, only unreadable here, so it is kept as made and said once.
|
|
143
|
+
*/
|
|
144
|
+
readonly unreadable: readonly (DeveloperLink & { readonly code: string })[];
|
|
124
145
|
}
|
|
125
146
|
|
|
126
147
|
interface DeclaredLinkReceipt extends DeveloperLink {
|
|
@@ -140,7 +161,7 @@ export async function keepDeveloperLinks<T>(
|
|
|
140
161
|
install: () => Promise<T>,
|
|
141
162
|
options?: KeepDeveloperLinksOptions,
|
|
142
163
|
): Promise<T> {
|
|
143
|
-
const { live, dangling } = findDeveloperLinks(root);
|
|
164
|
+
const { live, dangling, unreadable } = findDeveloperLinks(root);
|
|
144
165
|
const recorded = readDeclaredRecord(root);
|
|
145
166
|
const undeclared = new Set<string>();
|
|
146
167
|
if (recorded.size > 0) {
|
|
@@ -200,7 +221,7 @@ export async function keepDeveloperLinks<T>(
|
|
|
200
221
|
if (options !== undefined || (succeeded && undeclared.size > 0)) {
|
|
201
222
|
reportDeveloperLinks(root);
|
|
202
223
|
} else {
|
|
203
|
-
describeDeveloperLinks(root, live);
|
|
224
|
+
describeDeveloperLinks(root, { live, unreadable });
|
|
204
225
|
}
|
|
205
226
|
}
|
|
206
227
|
}
|
|
@@ -211,10 +232,11 @@ export async function keepDeveloperLinks<T>(
|
|
|
211
232
|
* entry that installs nothing. The entry that installs gets the same line
|
|
212
233
|
* from `keepDeveloperLinks`, but devenv's direnv integration runs that entry
|
|
213
234
|
* where its output is not shown. A dangling link is left for the next
|
|
214
|
-
* install to remove.
|
|
235
|
+
* install to remove. A link whose target this process may not read gets a
|
|
236
|
+
* line of its own.
|
|
215
237
|
*/
|
|
216
238
|
export function reportDeveloperLinks(root: string): void {
|
|
217
|
-
describeDeveloperLinks(root, findDeveloperLinks(root)
|
|
239
|
+
describeDeveloperLinks(root, findDeveloperLinks(root));
|
|
218
240
|
}
|
|
219
241
|
|
|
220
242
|
/**
|
|
@@ -226,18 +248,31 @@ export function hasStaleDeveloperLinks(root: string, relink: readonly string[] =
|
|
|
226
248
|
return dangling.length > 0 || live.some((link) => relink.includes(packageName(link)));
|
|
227
249
|
}
|
|
228
250
|
|
|
251
|
+
/**
|
|
252
|
+
* The developer links whose target this process may not read, as absolute paths: kept as made and said, but no
|
|
253
|
+
* process here can check what they point at, so an install's admission leaves them to the developer.
|
|
254
|
+
*/
|
|
255
|
+
export function unreadableDeveloperLinks(root: string): string[] {
|
|
256
|
+
return findDeveloperLinks(root).unreadable.map((link) => path.join(root, link.path));
|
|
257
|
+
}
|
|
258
|
+
|
|
229
259
|
/** The package a link stands for in its tree: `name` or `@scope/name`. */
|
|
230
260
|
function packageName(link: DeveloperLink): string {
|
|
231
261
|
return link.path.slice(link.path.lastIndexOf('node_modules/') + 'node_modules/'.length);
|
|
232
262
|
}
|
|
233
263
|
|
|
234
|
-
/** A package linked from many members is named once, with its count. */
|
|
235
|
-
function describeDeveloperLinks(root: string,
|
|
236
|
-
|
|
264
|
+
/** A package linked from many members is named once, with its count; each unreadable link is named on its own. */
|
|
265
|
+
function describeDeveloperLinks(root: string, { live, unreadable }: Omit<DeveloperLinks, 'dangling'>): void {
|
|
266
|
+
for (const link of unreadable) {
|
|
267
|
+
console.error(
|
|
268
|
+
`! developer link ${link.path} -> ${resolvedTarget(root, link)}: its target cannot be read here (${link.code}); kept as it is`,
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
if (live.length === 0) {
|
|
237
272
|
return;
|
|
238
273
|
}
|
|
239
274
|
const counts = new Map<string, number>();
|
|
240
|
-
for (const link of
|
|
275
|
+
for (const link of live) {
|
|
241
276
|
const named = `${packageName(link)} -> ${resolvedTarget(root, link)}`;
|
|
242
277
|
counts.set(named, (counts.get(named) ?? 0) + 1);
|
|
243
278
|
}
|
|
@@ -248,17 +283,25 @@ function describeDeveloperLinks(root: string, links: readonly DeveloperLink[]):
|
|
|
248
283
|
function findDeveloperLinks(root: string): DeveloperLinks {
|
|
249
284
|
const live: DeveloperLink[] = [];
|
|
250
285
|
const dangling: DeveloperLink[] = [];
|
|
286
|
+
const unreadable: (DeveloperLink & { readonly code: string })[] = [];
|
|
251
287
|
for (const tree of nodeModulesTrees(root)) {
|
|
252
288
|
for (const entry of packageLinks(root, tree)) {
|
|
253
289
|
const link: DeveloperLink = { path: entry, target: readlinkSync(path.join(root, entry)) };
|
|
254
290
|
const target = resolvedTarget(root, link);
|
|
255
291
|
const relative = path.relative(root, target);
|
|
256
292
|
if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
257
|
-
|
|
293
|
+
try {
|
|
294
|
+
(statSync(target, { throwIfNoEntry: false }) === undefined ? dangling : live).push(link);
|
|
295
|
+
} catch (error) {
|
|
296
|
+
const code = error instanceof Error && 'code' in error ? error.code : undefined;
|
|
297
|
+
if (code !== 'EPERM' && code !== 'EACCES') throw error;
|
|
298
|
+
live.push(link);
|
|
299
|
+
unreadable.push({ ...link, code });
|
|
300
|
+
}
|
|
258
301
|
}
|
|
259
302
|
}
|
|
260
303
|
}
|
|
261
|
-
return { live, dangling };
|
|
304
|
+
return { live, dangling, unreadable };
|
|
262
305
|
}
|
|
263
306
|
|
|
264
307
|
/**
|
|
@@ -352,12 +395,21 @@ export interface DeclaredLinkChange {
|
|
|
352
395
|
|
|
353
396
|
/**
|
|
354
397
|
* A declaration this machine cannot honour now: its checkout directory is not there to link to (the installed
|
|
355
|
-
* version stays), no snapshot of it can be made
|
|
356
|
-
*
|
|
398
|
+
* version stays), no snapshot of it can be made, or an alias still links the live checkout without a receipt, which a
|
|
399
|
+
* declaration never claims retroactively. A refused snapshot names what its aliases keep: the sealed snapshots their
|
|
400
|
+
* receipts record (`kept`), and the count of aliases that had none and so keep the version the install left
|
|
401
|
+
* (`installed`).
|
|
357
402
|
*/
|
|
358
403
|
export type UnavailableDeclaredLink =
|
|
359
404
|
| { readonly kind: 'absent'; readonly name: string; readonly target: string; readonly reason: string }
|
|
360
|
-
| {
|
|
405
|
+
| {
|
|
406
|
+
readonly kind: 'snapshot-refused';
|
|
407
|
+
readonly name: string;
|
|
408
|
+
readonly source: string;
|
|
409
|
+
readonly reason: string;
|
|
410
|
+
readonly kept: readonly string[];
|
|
411
|
+
readonly installed: number;
|
|
412
|
+
}
|
|
361
413
|
| { readonly kind: 'snapshot-unclaimed'; readonly name: string; readonly path: string; readonly source: string };
|
|
362
414
|
|
|
363
415
|
export interface DeclaredLinksPlan {
|
|
@@ -389,6 +441,7 @@ export async function planDeclaredLinks(root: string): Promise<DeclaredLinksPlan
|
|
|
389
441
|
const canonicalRoot = realpathSync(root);
|
|
390
442
|
const trees = nodeModulesTrees(root);
|
|
391
443
|
const recorded = readDeclaredRecord(root);
|
|
444
|
+
const probe = pluginProbe(snapshotPluginRoot(root, anchor, declared));
|
|
392
445
|
const changes: DeclaredLinkChange[] = [];
|
|
393
446
|
const unavailable: UnavailableDeclaredLink[] = [];
|
|
394
447
|
for (const { name, directory: relative, snapshot } of declared) {
|
|
@@ -405,9 +458,11 @@ export async function planDeclaredLinks(root: string): Promise<DeclaredLinksPlan
|
|
|
405
458
|
}
|
|
406
459
|
let binding: DeclaredBinding = { kind: 'checkout', target: source };
|
|
407
460
|
if (snapshot !== undefined) {
|
|
408
|
-
const outcome = await snapshotBinding(root, name, source, snapshot);
|
|
461
|
+
const outcome = await snapshotBinding(root, name, source, snapshot, probe);
|
|
409
462
|
if (outcome.kind === 'refused') {
|
|
410
|
-
|
|
463
|
+
const kept = keptSnapshots(root, trees, name, recorded);
|
|
464
|
+
changes.push(...kept.changes);
|
|
465
|
+
unavailable.push({ kind: 'snapshot-refused', name, source, reason: outcome.reason, ...kept.said });
|
|
411
466
|
continue;
|
|
412
467
|
}
|
|
413
468
|
binding = { kind: 'snapshot', target: outcome.directory, id: outcome.id };
|
|
@@ -446,6 +501,68 @@ export async function planDeclaredLinks(root: string): Promise<DeclaredLinksPlan
|
|
|
446
501
|
return { changes, unavailable };
|
|
447
502
|
}
|
|
448
503
|
|
|
504
|
+
/**
|
|
505
|
+
* What the aliases of `name` keep when no snapshot of it can be made: each the sealed snapshot its receipt records.
|
|
506
|
+
* An install re-points every alias at the lockfile's version before its postinstall plans this, so the binding an
|
|
507
|
+
* alias had is its receipt's, never what it links now. An alias still on its receipt is left alone, unsaid: its
|
|
508
|
+
* current binding stays. An alias whose receipt names no snapshot left in the store keeps what the install left, and
|
|
509
|
+
* is counted so the refusal says so. A developer's own link out of the checkout stays theirs.
|
|
510
|
+
*/
|
|
511
|
+
function keptSnapshots(
|
|
512
|
+
root: string,
|
|
513
|
+
trees: readonly string[],
|
|
514
|
+
name: string,
|
|
515
|
+
recorded: ReadonlyMap<string, DeclaredLinkReceipt>,
|
|
516
|
+
): {
|
|
517
|
+
readonly changes: readonly DeclaredLinkChange[];
|
|
518
|
+
readonly said: { readonly kept: readonly string[]; readonly installed: number };
|
|
519
|
+
} {
|
|
520
|
+
const changes: DeclaredLinkChange[] = [];
|
|
521
|
+
const kept = new Set<string>();
|
|
522
|
+
// One verification per sealed snapshot, however many trees alias it.
|
|
523
|
+
const verified = new Map<string, SealedSnapshot | null>();
|
|
524
|
+
let installed = 0;
|
|
525
|
+
for (const tree of trees) {
|
|
526
|
+
const entry = path.join(tree, name);
|
|
527
|
+
const at = path.join(root, entry);
|
|
528
|
+
const stats = lstatSync(at, { throwIfNoEntry: false });
|
|
529
|
+
if (stats === undefined) continue;
|
|
530
|
+
const text = stats.isSymbolicLink() ? readlinkSync(at) : null;
|
|
531
|
+
const receipt = recorded.get(entry);
|
|
532
|
+
if (text !== null && text === receipt?.target) continue;
|
|
533
|
+
if (text !== null && !containsPath(path.resolve(root), resolvedTarget(root, { path: entry, target: text })))
|
|
534
|
+
continue;
|
|
535
|
+
let binding: SealedSnapshot | null = null;
|
|
536
|
+
if (receipt !== undefined) {
|
|
537
|
+
const target = resolvedTarget(root, receipt);
|
|
538
|
+
binding = verified.has(target)
|
|
539
|
+
? (verified.get(target) ?? null)
|
|
540
|
+
: recordedSnapshot(root, entry, name, receipt.target);
|
|
541
|
+
verified.set(target, binding);
|
|
542
|
+
}
|
|
543
|
+
if (binding === null) {
|
|
544
|
+
installed += 1;
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
547
|
+
kept.add(binding.id);
|
|
548
|
+
changes.push({ path: entry, binding: { kind: 'snapshot', target: binding.directory, id: binding.id } });
|
|
549
|
+
}
|
|
550
|
+
return { changes, said: { kept: [...kept], installed } };
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Where the @smoothbricks/nx-plugin that vouches for snapshots resolves from: the checkout its declaration links when
|
|
555
|
+
* this machine has it, else the root's install, which is then what its aliases keep. Never the root's install over
|
|
556
|
+
* a declaration: an install re-points the plugin alias at the lockfile's published version before this runs, and
|
|
557
|
+
* that version cannot read a producer receipt only the declared checkout's plugin writes.
|
|
558
|
+
*/
|
|
559
|
+
function snapshotPluginRoot(root: string, anchor: string, declared: readonly DeclaredLink[]): string {
|
|
560
|
+
const plugin = declared.find(({ name }) => name === '@smoothbricks/nx-plugin');
|
|
561
|
+
if (plugin === undefined) return root;
|
|
562
|
+
const source = declaredTarget(root, anchor, plugin.directory);
|
|
563
|
+
return unavailableReason(source) === null ? source : root;
|
|
564
|
+
}
|
|
565
|
+
|
|
449
566
|
/**
|
|
450
567
|
* A contained declaration whose directory is absent here must not keep the binding it inherited from the
|
|
451
568
|
* main checkout: restoring it is this checkout's job, never a borrowed sibling's.
|
|
@@ -476,11 +593,20 @@ export function applyDeclaredLinks(root: string, plan: DeclaredLinksPlan): void
|
|
|
476
593
|
`! smoo.developerLinks ${unavailable.name}: ${unavailable.target} ${unavailable.reason}; the installed version stays`,
|
|
477
594
|
);
|
|
478
595
|
break;
|
|
479
|
-
case 'snapshot-refused':
|
|
596
|
+
case 'snapshot-refused': {
|
|
597
|
+
const keeps = [
|
|
598
|
+
...unavailable.kept.map((id) => `its aliases stay bound to snapshot ${id}`),
|
|
599
|
+
...(unavailable.installed === 0
|
|
600
|
+
? []
|
|
601
|
+
: [
|
|
602
|
+
`${unavailable.installed} ${unavailable.installed === 1 ? 'alias with no recorded snapshot keeps' : 'aliases with no recorded snapshot keep'} the installed version`,
|
|
603
|
+
]),
|
|
604
|
+
];
|
|
480
605
|
console.error(
|
|
481
|
-
`! smoo.developerLinks ${unavailable.name}: no snapshot of ${unavailable.source}: ${unavailable.reason}; its current binding stays`,
|
|
606
|
+
`! smoo.developerLinks ${unavailable.name}: no snapshot of ${unavailable.source}: ${unavailable.reason}; ${keeps.length === 0 ? 'its current binding stays' : keeps.join('; ')}`,
|
|
482
607
|
);
|
|
483
608
|
break;
|
|
609
|
+
}
|
|
484
610
|
case 'snapshot-unclaimed':
|
|
485
611
|
console.error(
|
|
486
612
|
`! smoo.developerLinks ${unavailable.name}: ${unavailable.path} links the live checkout ${unavailable.source} without a receipt, so it is not bound to a snapshot; remove that link and run the install once to bind it`,
|
|
@@ -320,13 +320,13 @@ in {
|
|
|
320
320
|
# before it is packed. A lean publish shell removes those tools silently, from
|
|
321
321
|
# the one step that exists to refuse a bad artifact.
|
|
322
322
|
#
|
|
323
|
-
# And it would not even pay: the Actions
|
|
324
|
-
#
|
|
325
|
-
#
|
|
326
|
-
#
|
|
327
|
-
#
|
|
328
|
-
#
|
|
329
|
-
#
|
|
323
|
+
# And it would not even pay: the Actions store cache is keyed on os+arch and
|
|
324
|
+
# the devenv files and is blind to the profile, so a restore ships the whole
|
|
325
|
+
# store regardless, while the save keeps the closure that job realized. A lean
|
|
326
|
+
# publish job that won that immutable key would hand the CI workflow a store
|
|
327
|
+
# with no toolchain in it. On any run where repair has work the saving is zero
|
|
328
|
+
# anyway, because repair realizes the historical default shell inside the
|
|
329
|
+
# same job.
|
|
330
330
|
|
|
331
331
|
# One Go for every repository, same reasoning as the Rust toolchain: a compiler
|
|
332
332
|
# is part of a cache key, so two of them mean two caches.
|
|
@@ -18,11 +18,20 @@ add_repo_paths() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
# The CLI that evaluates the shell must be the commit whose modules the shell is
|
|
21
|
-
# locked to
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
21
|
+
# locked to, so this installs the commit devenv.lock's `devenv` node names and
|
|
22
|
+
# nothing here restates it. `smoo monorepo check` holds that node to a release:
|
|
23
|
+
# its `original.ref` is `latest` or a tag from v2.0.4 on, which devenv.yaml
|
|
24
|
+
# declares as `github:cachix/devenv/v2.3.1?dir=src/modules`. devenv.cachix.org
|
|
25
|
+
# has pinned the aarch64-darwin, aarch64-linux and x86_64-linux builds of every
|
|
26
|
+
# release from v2.0.4 on for good, so on those three systems the install
|
|
27
|
+
# substitutes rather than compiles. From v2.2 on devenv builds nothing for
|
|
28
|
+
# x86_64-darwin, so on an Intel macOS runner installing such a release fails
|
|
29
|
+
# rather than compiles; there only v2.0.4 to v2.1.2 are pinned. Some older tags,
|
|
30
|
+
# such as v2.0.3, have no pin, and their builds are already gone. An input
|
|
31
|
+
# nobody declared locks devenv's main as it was that minute, and the cache drops
|
|
32
|
+
# such a build after about six weeks, after which every cold runner compiles
|
|
33
|
+
# devenv from source (a build of main commit 4ed83c00, which reported 2.1.3 but
|
|
34
|
+
# was never tagged, was pushed on 2026-07-15 and was gone by 2026-10-13).
|
|
26
35
|
#
|
|
27
36
|
# An unpinned `github:cachix/devenv` instead installs whatever HEAD is on the day
|
|
28
37
|
# a cold runner misses the store cache — a version that moves with no commit
|