@smoothbricks/nx-plugin 0.7.17 → 0.7.19
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 +315 -114
- package/dist/.build-inputs.json +47 -38
- package/dist/built-output-packages.js +1 -1
- package/dist/bun-lock-scope.d.ts +128 -20
- package/dist/bun-lock-scope.d.ts.map +1 -1
- package/dist/bun-lock-scope.js +267 -44
- package/dist/cargo-closure-input.d.ts +8 -6
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +15 -12
- package/dist/cargo-source-hash.d.ts +26 -25
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +84 -105
- package/dist/cargo-toolchain-paths.d.ts +2 -2
- package/dist/cargo-toolchain-paths.js +2 -2
- package/dist/cargo-workspace.d.ts +20 -2
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +43 -22
- package/dist/ensure-built-receipt.d.ts +3 -2
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +3 -2
- package/dist/eslint-config-closure.d.ts +8 -3
- package/dist/eslint-config-closure.d.ts.map +1 -1
- package/dist/eslint-config-closure.js +24 -5
- package/dist/executors/bounded-exec/admission-queue.d.ts +3 -1
- package/dist/executors/bounded-exec/admission-queue.d.ts.map +1 -1
- package/dist/executors/bounded-exec/admission-queue.js +9 -10
- package/dist/executors/bounded-exec/awake-clock.d.ts +5 -0
- package/dist/executors/bounded-exec/awake-clock.d.ts.map +1 -0
- package/dist/executors/bounded-exec/awake-clock.js +22 -0
- package/dist/executors/bounded-exec/bounds.d.ts +19 -6
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -1
- package/dist/executors/bounded-exec/bounds.js +22 -15
- package/dist/executors/bounded-exec/case-gate.d.ts +114 -0
- package/dist/executors/bounded-exec/case-gate.d.ts.map +1 -0
- package/dist/executors/bounded-exec/case-gate.js +342 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.d.ts +1 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool-thread.js +2 -2
- package/dist/executors/bounded-exec/cpu-pool.d.ts +28 -1
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool.js +102 -16
- package/dist/executors/bounded-exec/cpu-rise.d.ts +73 -0
- package/dist/executors/bounded-exec/cpu-rise.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-rise.js +111 -0
- package/dist/executors/bounded-exec/endpoint-life.d.ts +146 -0
- package/dist/executors/bounded-exec/endpoint-life.d.ts.map +1 -0
- package/dist/executors/bounded-exec/endpoint-life.js +228 -0
- package/dist/executors/bounded-exec/executor.d.ts +1 -1
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +256 -86
- package/dist/executors/bounded-exec/gateway-lease.d.ts +1 -1
- package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
- package/dist/executors/bounded-exec/gateway-lease.js +8 -1
- package/dist/executors/bounded-exec/go-run-summary.d.ts +51 -0
- package/dist/executors/bounded-exec/go-run-summary.d.ts.map +1 -0
- package/dist/executors/bounded-exec/go-run-summary.js +98 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +11 -3
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
- package/dist/executors/bounded-exec/hang-diagnostics.js +125 -47
- package/dist/executors/bounded-exec/lease-wait.d.ts +1 -0
- package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -1
- package/dist/executors/bounded-exec/lease-wait.js +1 -0
- package/dist/executors/bounded-exec/mbx-pool.d.ts +42 -7
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-pool.js +45 -8
- package/dist/executors/bounded-exec/mbx-reservations.d.ts +12 -6
- package/dist/executors/bounded-exec/mbx-reservations.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-reservations.js +190 -284
- package/dist/executors/bounded-exec/parent-grant.d.ts +2 -0
- package/dist/executors/bounded-exec/parent-grant.d.ts.map +1 -1
- package/dist/executors/bounded-exec/parent-grant.js +1 -0
- package/dist/executors/bounded-exec/pool-admission.d.ts +29 -3
- package/dist/executors/bounded-exec/pool-admission.d.ts.map +1 -1
- package/dist/executors/bounded-exec/pool-admission.js +47 -1
- package/dist/executors/bounded-exec/progress-channel.d.ts +38 -0
- package/dist/executors/bounded-exec/progress-channel.d.ts.map +1 -0
- package/dist/executors/bounded-exec/progress-channel.js +113 -0
- package/dist/executors/bounded-exec/progress.d.ts +5 -1
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/progress.js +31 -1
- package/dist/executors/bounded-exec/ram-temp.d.ts +24 -1
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.js +123 -16
- package/dist/executors/bounded-exec/reservation-connection.d.ts +90 -0
- package/dist/executors/bounded-exec/reservation-connection.d.ts.map +1 -0
- package/dist/executors/bounded-exec/reservation-connection.js +248 -0
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/run-cpu-pool.js +3 -0
- package/dist/executors/bounded-exec/runner-sizing.d.ts +9 -5
- package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -1
- package/dist/executors/bounded-exec/runner-sizing.js +13 -9
- package/dist/executors/bounded-exec/schema.d.ts +7 -2
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/schema.js +17 -1
- package/dist/executors/bounded-exec/suite-minimum.d.ts +21 -0
- package/dist/executors/bounded-exec/suite-minimum.d.ts.map +1 -0
- package/dist/executors/bounded-exec/suite-minimum.js +85 -0
- package/dist/executors/bounded-exec/test-result-writer.d.ts +2 -0
- package/dist/executors/bounded-exec/test-result-writer.d.ts.map +1 -1
- package/dist/executors/bounded-exec/test-result-writer.js +1 -0
- package/dist/executors/bounded-exec/test-results.d.ts +5 -0
- package/dist/executors/bounded-exec/test-results.d.ts.map +1 -1
- package/dist/executors/bounded-exec/test-results.js +2 -2
- package/dist/executors/bounded-exec/verdict.d.ts +39 -10
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +60 -14
- package/dist/executors/cargo-zigbuild/executor.d.ts +10 -8
- package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
- package/dist/executors/cargo-zigbuild/executor.js +32 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +294 -152
- package/dist/managed-files/ci-workflow.d.ts +4 -1
- package/dist/managed-files/ci-workflow.d.ts.map +1 -1
- package/dist/managed-files/ci-workflow.js +9 -14
- package/dist/managed-files/files.d.ts +3 -3
- package/dist/managed-files/files.js +3 -3
- package/dist/managed-files/generator.d.ts +5 -1
- package/dist/managed-files/generator.d.ts.map +1 -1
- package/dist/managed-files/generator.js +22 -7
- package/dist/managed-files/render-memo.d.ts +13 -0
- package/dist/managed-files/render-memo.d.ts.map +1 -0
- package/dist/managed-files/render-memo.js +94 -0
- package/dist/task-results.js +2 -1
- package/dist/test-program.d.ts +11 -6
- package/dist/test-program.d.ts.map +1 -1
- package/dist/test-program.js +39 -35
- package/dist/tool-bins.d.ts +12 -0
- package/dist/tool-bins.d.ts.map +1 -1
- package/dist/tool-bins.js +31 -6
- package/dist/typecheck-test-policy.d.ts +10 -1
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +40 -24
- package/dist/workspace-config-policy.d.ts.map +1 -1
- package/dist/workspace-config-policy.js +135 -42
- package/dist/workspace-index.d.ts +14 -1
- package/dist/workspace-index.d.ts.map +1 -1
- package/dist/workspace-index.js +36 -4
- package/executors.json +2 -0
- package/managed/raw/envrc +24 -0
- package/managed/raw/patches/nx@24.0.3.patch +1851 -221
- package/managed/raw/patches/ttsc@0.37.1.patch +1055 -0
- package/managed/raw/tooling/direnv/developer-links.ts +122 -14
- package/managed/raw/tooling/direnv/devenv.smoo.nix +20 -19
- package/managed/templates/github/actions/save-nix-devenv/action.yml +19 -1
- package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
- package/package.json +68 -11
- package/runtime/nx-publish/.build-inputs.json +2 -2
- package/runtime/nx-publish/cache_adapter.js +293 -3
- package/runtime/nx-publish/nx_publish.js +36 -14
- package/src/built-output-packages.ts +1 -1
- package/src/bun-lock-scope.ts +293 -40
- package/src/cargo-closure-input.ts +20 -12
- package/src/cargo-source-hash.ts +119 -145
- package/src/cargo-toolchain-paths.ts +2 -2
- package/src/cargo-workspace.ts +59 -21
- package/src/ensure-built-receipt.ts +3 -2
- package/src/eslint-config-closure.ts +27 -6
- package/src/executors/bounded-exec/admission-queue.ts +11 -10
- package/src/executors/bounded-exec/awake-clock.ts +20 -0
- package/src/executors/bounded-exec/bounds.ts +41 -19
- package/src/executors/bounded-exec/case-gate.ts +365 -0
- package/src/executors/bounded-exec/cpu-pool-thread.ts +3 -3
- package/src/executors/bounded-exec/cpu-pool.ts +139 -12
- package/src/executors/bounded-exec/cpu-rise.ts +156 -0
- package/src/executors/bounded-exec/endpoint-life.ts +279 -0
- package/src/executors/bounded-exec/executor.ts +341 -123
- package/src/executors/bounded-exec/gateway-lease.ts +6 -0
- package/src/executors/bounded-exec/go-run-summary.ts +137 -0
- package/src/executors/bounded-exec/hang-diagnostics.ts +150 -50
- package/src/executors/bounded-exec/lease-wait.ts +1 -0
- package/src/executors/bounded-exec/mbx-pool.ts +57 -9
- package/src/executors/bounded-exec/mbx-reservations.ts +216 -183
- package/src/executors/bounded-exec/parent-grant.ts +3 -0
- package/src/executors/bounded-exec/pool-admission.ts +59 -2
- package/src/executors/bounded-exec/progress-channel.ts +129 -0
- package/src/executors/bounded-exec/progress.ts +39 -3
- package/src/executors/bounded-exec/ram-temp.ts +137 -17
- package/src/executors/bounded-exec/reservation-connection.ts +221 -0
- package/src/executors/bounded-exec/run-cpu-pool.ts +2 -0
- package/src/executors/bounded-exec/runner-sizing.ts +13 -8
- package/src/executors/bounded-exec/schema.json +1 -1
- package/src/executors/bounded-exec/schema.ts +21 -2
- package/src/executors/bounded-exec/suite-minimum.ts +81 -0
- package/src/executors/bounded-exec/test-result-writer.ts +3 -0
- package/src/executors/bounded-exec/test-results.ts +5 -0
- package/src/executors/bounded-exec/verdict.ts +83 -22
- package/src/executors/cargo-zigbuild/executor.ts +30 -19
- package/src/index.ts +357 -166
- package/src/managed-files/ci-workflow.ts +13 -17
- package/src/managed-files/files.ts +3 -3
- package/src/managed-files/generator.ts +21 -6
- package/src/managed-files/render-memo.ts +135 -0
- package/src/test-program.ts +36 -41
- package/src/tool-bins.ts +35 -6
- package/src/typecheck-test-policy.ts +49 -24
- package/src/workspace-config-policy.ts +161 -43
- package/src/workspace-index.ts +40 -5
- package/test-timings.json +157 -141
- package/managed/raw/patches/ttsc@0.36.3.patch +0 -1660
|
@@ -11,9 +11,11 @@ import {
|
|
|
11
11
|
gitWorkspaceRoot,
|
|
12
12
|
writeBuildInputs,
|
|
13
13
|
} from '@smoothbricks/build-inputs';
|
|
14
|
-
import {
|
|
14
|
+
import type { CargoLockResolve } from '@smoothbricks/build-inputs/cargo-closure';
|
|
15
|
+
import type { Result } from '@smoothbricks/cargo-retain';
|
|
15
16
|
import typia from 'typia';
|
|
16
17
|
|
|
18
|
+
import { CargoMetadataError, readCargoResolve } from '../../cargo-source-hash.js';
|
|
17
19
|
import type { CargoZigbuildOptions } from './schema.js';
|
|
18
20
|
|
|
19
21
|
interface CargoZigbuildContext {
|
|
@@ -75,22 +77,21 @@ export function cargoTriple(target: string): string {
|
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
/**
|
|
78
|
-
* The remedy for a failed build of `target
|
|
79
|
-
*
|
|
80
|
-
*
|
|
80
|
+
* The remedy for a failed build of `target`, when rustc has no standard library for its triple: every managed shell
|
|
81
|
+
* carries the whole Linux rust-std set, so that rustc is not the one the checkout's shell provides. A build outside it
|
|
82
|
+
* fails in rustc, which names the missing target but not the shell. `libdir` is what
|
|
81
83
|
* `rustc --print target-libdir --target <triple>` printed, or null when rustc could not answer.
|
|
82
84
|
*/
|
|
83
85
|
export function missingRustStdRemedy(
|
|
84
86
|
command: string,
|
|
85
87
|
target: string,
|
|
86
|
-
platform: NodeJS.Platform,
|
|
87
88
|
libdir: { readonly path: string; readonly exists: boolean } | null,
|
|
88
89
|
): string | null {
|
|
89
|
-
if (
|
|
90
|
+
if (libdir === null || libdir.exists) return null;
|
|
90
91
|
return (
|
|
91
|
-
`${command}: rustc has no standard library for ${cargoTriple(target)} (${libdir.path} is absent).
|
|
92
|
-
"Linux rust-std set
|
|
93
|
-
'
|
|
92
|
+
`${command}: rustc has no standard library for ${cargoTriple(target)} (${libdir.path} is absent). Every managed ` +
|
|
93
|
+
"shell carries the Linux rust-std set, so this rustc is not the checkout's shell's: enter it (direnv reload) and " +
|
|
94
|
+
'run nx run <project>:<target> again'
|
|
94
95
|
);
|
|
95
96
|
}
|
|
96
97
|
|
|
@@ -173,13 +174,14 @@ export function depInfoPath(built: string): string {
|
|
|
173
174
|
/**
|
|
174
175
|
* The input record (build-inputs.ts) of the build that wrote `built`, or why none can be made: the record
|
|
175
176
|
* `smoo-nx-build-inputs` writes after a macOS build, from the dep-info beside the artifact, so one link check judges
|
|
176
|
-
* both. `
|
|
177
|
-
* Nx task running the build, which the executor reads from its
|
|
177
|
+
* both. `cargo` is the resolve Cargo reports for the build's manifest, which names the workspace manifest and the
|
|
178
|
+
* lockfile closure the record states. `producer` is the Nx task running the build, which the executor reads from its
|
|
179
|
+
* environment.
|
|
178
180
|
*/
|
|
179
181
|
export function buildInputsOf(
|
|
180
182
|
built: string,
|
|
181
183
|
manifestPath: string,
|
|
182
|
-
|
|
184
|
+
cargo: CargoLockResolve,
|
|
183
185
|
producer?: BuildInputProducer,
|
|
184
186
|
): Result<BuildInputRecord, string> {
|
|
185
187
|
const directory = path.dirname(manifestPath);
|
|
@@ -191,7 +193,12 @@ export function buildInputsOf(
|
|
|
191
193
|
if (!existsSync(depInfo)) {
|
|
192
194
|
return { ok: false, error: `${depInfo} does not exist: cargo wrote no dep-info beside ${built}` };
|
|
193
195
|
}
|
|
194
|
-
|
|
196
|
+
let record: BuildInputRecord | null;
|
|
197
|
+
try {
|
|
198
|
+
record = cargoBuildInputs(workspaceRoot, readFileSync(depInfo, 'utf8'), cargo, producer);
|
|
199
|
+
} catch (error) {
|
|
200
|
+
return { ok: false, error: `${depInfo}: ${error instanceof Error ? error.message : String(error)}` };
|
|
201
|
+
}
|
|
195
202
|
if (record === null) return { ok: false, error: `${depInfo} names no file of ${workspaceRoot}` };
|
|
196
203
|
return { ok: true, value: record };
|
|
197
204
|
}
|
|
@@ -262,7 +269,7 @@ export default async function cargoZigbuildExecutor(
|
|
|
262
269
|
}
|
|
263
270
|
if (status.code !== 0) {
|
|
264
271
|
console.error(`${command}: exited with ${status.signal ?? `status ${status.code}`}`);
|
|
265
|
-
const remedy = missingRustStdRemedy(command, options.target,
|
|
272
|
+
const remedy = missingRustStdRemedy(command, options.target, await rustLibdir(options.target));
|
|
266
273
|
if (remedy !== null) console.error(remedy);
|
|
267
274
|
return { success: false };
|
|
268
275
|
}
|
|
@@ -273,13 +280,17 @@ export default async function cargoZigbuildExecutor(
|
|
|
273
280
|
}
|
|
274
281
|
|
|
275
282
|
// From the dep-info cargo just wrote, before the artifact is copied: a build whose inputs cannot be named leaves the
|
|
276
|
-
// output as it was, and a source edited while the artifact is copied is not recorded with its new bytes.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
283
|
+
// output as it was, and a source edited while the artifact is copied is not recorded with its new bytes. The resolve
|
|
284
|
+
// is the one the task's key was computed from (readCargoResolve), so the record states the key's lockfile closure.
|
|
285
|
+
let cargo: CargoLockResolve;
|
|
286
|
+
try {
|
|
287
|
+
cargo = await readCargoResolve(manifestPath, context.root);
|
|
288
|
+
} catch (error) {
|
|
289
|
+
if (!(error instanceof CargoMetadataError)) throw error;
|
|
290
|
+
console.error(`${command}: ${error.message}`);
|
|
280
291
|
return { success: false };
|
|
281
292
|
}
|
|
282
|
-
const inputs = buildInputsOf(built, manifestPath, cargo
|
|
293
|
+
const inputs = buildInputsOf(built, manifestPath, cargo, producer);
|
|
283
294
|
if (!inputs.ok) {
|
|
284
295
|
console.error(`${command}: ${inputs.error}`);
|
|
285
296
|
return { success: false };
|