@smoothbricks/nx-plugin 0.7.2 → 0.7.3
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 +118 -118
- package/dist/.build-inputs.json +18 -18
- package/dist/cargo-toolchain-paths.d.ts +1 -1
- package/dist/cargo-toolchain-paths.js +1 -1
- package/dist/cargo-toolchain-policy.d.ts +2 -2
- package/dist/cargo-toolchain-policy.js +2 -2
- package/dist/cross-check-policy.d.ts +25 -30
- package/dist/cross-check-policy.d.ts.map +1 -1
- package/dist/cross-check-policy.js +27 -31
- package/dist/ensure-built-witness.js +727 -450
- package/dist/ensure-built.js +2 -2
- package/dist/executors/bounded-exec/bounds.d.ts +6 -3
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -1
- package/dist/executors/bounded-exec/bounds.js +9 -2
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +24 -19
- package/dist/executors/bounded-exec/mbx-pool.d.ts +13 -16
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-pool.js +24 -28
- package/dist/executors/bounded-exec/runner-lifecycle.d.ts +2 -0
- package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -1
- package/dist/executors/bounded-exec/runner-lifecycle.js +9 -5
- package/dist/executors/bounded-exec/runner-sizing.d.ts +6 -1
- package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -1
- package/dist/executors/bounded-exec/runner-sizing.js +7 -2
- package/dist/executors/bounded-exec/schema.d.ts +12 -3
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/cargo-zigbuild/executor.d.ts +10 -0
- package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
- package/dist/executors/cargo-zigbuild/executor.js +36 -2
- package/dist/index.js +9 -7
- package/dist/managed-files/files.d.ts +4 -4
- package/dist/managed-files/files.js +4 -4
- package/dist/owned-installation.d.ts.map +1 -1
- package/dist/owned-installation.js +4 -2
- package/dist/producer-receipts.js +476 -402
- package/dist/task-graph-policy.js +1 -1
- package/dist/testing.d.ts +8 -0
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +15 -0
- package/dist/workspace-config-policy.d.ts +1 -1
- package/dist/workspace-config-policy.js +1 -1
- package/dist/workspace-manifest.d.ts +5 -0
- package/dist/workspace-manifest.d.ts.map +1 -1
- package/managed/raw/patches/{nx@23.2.1.patch → nx@24.0.3.patch} +1397 -2174
- package/managed/raw/tooling/direnv/devenv.smoo.nix +30 -31
- package/managed/raw/tooling/git-hooks/pre-push.sh +21 -21
- package/managed/templates/github/actions/setup-devenv/action.yml +20 -5
- package/package.json +4 -3
- package/runtime/nx-publish/.build-inputs.json +2 -2
- package/runtime/nx-publish/cache_adapter.js +24 -11
- package/runtime/nx-publish/nx_publish.js +2 -1
- package/runtime-input.sh +1 -1
- package/src/cargo-toolchain-paths.ts +1 -1
- package/src/cargo-toolchain-policy.ts +2 -2
- package/src/cross-check-policy.ts +29 -32
- package/src/ensure-built.ts +2 -2
- package/src/executors/bounded-exec/bounds.ts +13 -4
- package/src/executors/bounded-exec/executor.ts +27 -29
- package/src/executors/bounded-exec/mbx-pool.ts +36 -30
- package/src/executors/bounded-exec/runner-lifecycle.ts +13 -6
- package/src/executors/bounded-exec/runner-sizing.ts +8 -2
- package/src/executors/bounded-exec/schema.json +5 -1
- package/src/executors/bounded-exec/schema.ts +12 -3
- package/src/executors/cargo-zigbuild/executor.ts +42 -2
- package/src/index.ts +9 -5
- package/src/managed-files/files.ts +4 -4
- package/src/owned-installation.ts +4 -2
- package/src/task-graph-policy.ts +1 -1
- package/src/testing.ts +13 -0
- package/src/workspace-config-policy.ts +1 -1
- package/src/workspace-manifest.ts +5 -0
- package/test-timings.json +2 -0
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* compiles is invisible to every check a macOS host can run: a full local lint
|
|
6
6
|
* passes and CI still goes red on unused imports, unresolved names and dead code
|
|
7
7
|
* inside the `not(target_os = "macos")` branch. Closing that needs three pieces
|
|
8
|
-
* to agree
|
|
9
|
-
*
|
|
10
|
-
* the triple, and a root script that runs
|
|
11
|
-
* live here together because the plugin infers the target while the CLI
|
|
8
|
+
* to agree: a shell carrying the Linux toolchain (zig, cargo-zigbuild and the
|
|
9
|
+
* x86_64-unknown-linux-gnu rust-std, every managed devenv shell's), an Nx target
|
|
10
|
+
* per Cargo workspace that asks for the triple, and a root script that runs it.
|
|
11
|
+
* They live here together because the plugin infers the target while the CLI
|
|
12
12
|
* installs the script and reports a project missing it; kept apart, the three
|
|
13
13
|
* spellings drift and the gate silently stops gating.
|
|
14
14
|
*/
|
|
@@ -17,13 +17,6 @@
|
|
|
17
17
|
* `languages.rust.targets` in the managed devenv module installs its rust-std.
|
|
18
18
|
*/
|
|
19
19
|
export declare const CARGO_LINUX_TRIPLE = "x86_64-unknown-linux-gnu";
|
|
20
|
-
/**
|
|
21
|
-
* The devenv profile carrying the Linux toolchain — zig, cargo-zigbuild and the
|
|
22
|
-
* Linux rust-std set — defined in the managed `tooling/direnv/devenv.smoo.nix`.
|
|
23
|
-
* Opt-in on macOS because zig alone is a 380 MiB closure that nothing but a
|
|
24
|
-
* Linux artifact or this check uses.
|
|
25
|
-
*/
|
|
26
|
-
export declare const DEVENV_CROSS_PROFILE = "linux-cross";
|
|
27
20
|
/**
|
|
28
21
|
* Nx target name. No colons, per the repo's target-naming rule.
|
|
29
22
|
*
|
|
@@ -37,12 +30,18 @@ export declare const DEVENV_CROSS_PROFILE = "linux-cross";
|
|
|
37
30
|
*/
|
|
38
31
|
export declare const CARGO_CROSS_LINT_TARGET = "cargo-lint-cross";
|
|
39
32
|
/**
|
|
40
|
-
* What the cross lint prints when it
|
|
41
|
-
*
|
|
42
|
-
* key missed. The
|
|
43
|
-
*
|
|
33
|
+
* What the cross lint prints when it is asked to replay and not compile: on a
|
|
34
|
+
* Darwin cache miss under the managed pre-push probe this line, and only this
|
|
35
|
+
* line, means the key missed. The hook reads its output for exactly this text to
|
|
36
|
+
* tell a miss from any other Nx failure.
|
|
37
|
+
*/
|
|
38
|
+
export declare const CARGO_CROSS_LINT_REFUSAL = "cargo-lint-cross is not cached for this tree; run: bun run check:linux";
|
|
39
|
+
/**
|
|
40
|
+
* Set to `1` by the managed pre-push probe, which asks Nx for the cross target's
|
|
41
|
+
* cached verdict and must never start the clippy itself. Nx hashes no
|
|
42
|
+
* environment a target does not declare, so the probe's key is the gate's.
|
|
44
43
|
*/
|
|
45
|
-
export declare const
|
|
44
|
+
export declare const CARGO_CROSS_LINT_REPLAY_ONLY_ENV = "SMOO_CROSS_LINT_REPLAY_ONLY";
|
|
46
45
|
/**
|
|
47
46
|
* The prefix `cargoFrozen` writes. Exported so target inference can recognize
|
|
48
47
|
* the commands whose precondition `CARGO_FETCH_TARGET` supplies without
|
|
@@ -119,9 +118,9 @@ export declare const CARGO_DENY_WARNINGS = "--config 'build.warnings=\"deny\"'";
|
|
|
119
118
|
* cross test target; it could only recompile these crates to produce a harness it
|
|
120
119
|
* must then refuse to launch.
|
|
121
120
|
*
|
|
122
|
-
* `--target` is explicit rather than inherited from
|
|
123
|
-
*
|
|
124
|
-
*
|
|
121
|
+
* `--target` is explicit rather than inherited from an ambient CARGO_BUILD_TARGET,
|
|
122
|
+
* so the triple belongs to this target and a host lint can never pass for a cross
|
|
123
|
+
* one.
|
|
125
124
|
*
|
|
126
125
|
* cargo-zigbuild rather than plain cargo because ring compiles C for the target
|
|
127
126
|
* from its build script, and build scripts run even under clippy: zig is the
|
|
@@ -142,7 +141,7 @@ export declare const CARGO_DENY_WARNINGS = "--config 'build.warnings=\"deny\"'";
|
|
|
142
141
|
* are distinct anyway, and its own lock keeps the cross check from queueing
|
|
143
142
|
* behind host builds.
|
|
144
143
|
*/
|
|
145
|
-
export declare const CARGO_CROSS_LINT_COMMAND = "command -v cargo-zigbuild >/dev/null || { echo
|
|
144
|
+
export declare const CARGO_CROSS_LINT_COMMAND = "[ \"${SMOO_CROSS_LINT_REPLAY_ONLY:-}\" != 1 ] || { echo 'cargo-lint-cross is not cached for this tree; run: bun run check:linux' >&2; exit 2; }; command -v cargo-zigbuild >/dev/null || { echo \"cargo-lint-cross needs cargo-zigbuild, which every managed devenv shell carries; run it in the checkout's shell: bun run check:linux\" >&2; exit 2; }; cargo-zigbuild clippy --frozen --workspace --all-targets --target x86_64-unknown-linux-gnu --target-dir target/cargo-lint-cross --config 'build.warnings=\"deny\"'";
|
|
146
145
|
/**
|
|
147
146
|
* `target/cargo-lint`: clippy writes a directory of its own, as the cross lint
|
|
148
147
|
* does. Cargo flocks one build directory per invocation, and a workspace-wide
|
|
@@ -159,19 +158,15 @@ export declare const CARGO_LINT_CLIPPY_COMMAND: string;
|
|
|
159
158
|
export declare const CROSS_CHECK_SCRIPT_NAME = "check:linux";
|
|
160
159
|
/**
|
|
161
160
|
* The developer entry point: one command on macOS that reports what CI's Linux
|
|
162
|
-
* job would.
|
|
163
|
-
*
|
|
161
|
+
* job would. A plain Nx run, because every managed devenv shell carries the
|
|
162
|
+
* cross toolchain; the land gate's Nx graph holds the same target.
|
|
164
163
|
*
|
|
165
164
|
* Deliberately NOT `--quiet`. The pre-push gate is a probe: it consults the Nx
|
|
166
|
-
* cache and refuses a push that has no hit, never
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* adds about 0.9 GiB (zig plus three rust-std targets) and the clippy behind it
|
|
170
|
-
* is unbounded, so a silent terminal is indistinguishable from a hang.
|
|
171
|
-
* Suppressing that output only paid while a hook ran this for you and nobody
|
|
172
|
-
* read it.
|
|
165
|
+
* cache and refuses a push that has no hit, never starting a compile of its own.
|
|
166
|
+
* The clippy behind this script is unbounded, so a silent terminal is
|
|
167
|
+
* indistinguishable from a hang.
|
|
173
168
|
*/
|
|
174
|
-
export declare const CROSS_CHECK_SCRIPT_COMMAND = "
|
|
169
|
+
export declare const CROSS_CHECK_SCRIPT_COMMAND = "nx run-many -t cargo-lint-cross";
|
|
175
170
|
/**
|
|
176
171
|
* A cross-built test archive and the target that EXECUTES it, per foreign
|
|
177
172
|
* target triple the cargo workspace declares in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-check-policy.d.ts","sourceRoot":"","sources":["../src/cross-check-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"cross-check-policy.d.ts","sourceRoot":"","sources":["../src/cross-check-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,2EAA2E,CAAC;AAEjH;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,gCAAgC,CAAC;AAO9E;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAYrD,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,uCAAqC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,wBAAwB,ggBAA0L,CAAC;AAEhO;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,QAErC,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,oCAA8C,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,6DAA6D;AAC7D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhE;AAID,iFAAiF;AACjF,wBAAgB,qCAAqC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKvF"}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* compiles is invisible to every check a macOS host can run: a full local lint
|
|
6
6
|
* passes and CI still goes red on unused imports, unresolved names and dead code
|
|
7
7
|
* inside the `not(target_os = "macos")` branch. Closing that needs three pieces
|
|
8
|
-
* to agree
|
|
9
|
-
*
|
|
10
|
-
* the triple, and a root script that runs
|
|
11
|
-
* live here together because the plugin infers the target while the CLI
|
|
8
|
+
* to agree: a shell carrying the Linux toolchain (zig, cargo-zigbuild and the
|
|
9
|
+
* x86_64-unknown-linux-gnu rust-std, every managed devenv shell's), an Nx target
|
|
10
|
+
* per Cargo workspace that asks for the triple, and a root script that runs it.
|
|
11
|
+
* They live here together because the plugin infers the target while the CLI
|
|
12
12
|
* installs the script and reports a project missing it; kept apart, the three
|
|
13
13
|
* spellings drift and the gate silently stops gating.
|
|
14
14
|
*/
|
|
@@ -17,13 +17,6 @@
|
|
|
17
17
|
* `languages.rust.targets` in the managed devenv module installs its rust-std.
|
|
18
18
|
*/
|
|
19
19
|
export const CARGO_LINUX_TRIPLE = 'x86_64-unknown-linux-gnu';
|
|
20
|
-
/**
|
|
21
|
-
* The devenv profile carrying the Linux toolchain — zig, cargo-zigbuild and the
|
|
22
|
-
* Linux rust-std set — defined in the managed `tooling/direnv/devenv.smoo.nix`.
|
|
23
|
-
* Opt-in on macOS because zig alone is a 380 MiB closure that nothing but a
|
|
24
|
-
* Linux artifact or this check uses.
|
|
25
|
-
*/
|
|
26
|
-
export const DEVENV_CROSS_PROFILE = 'linux-cross';
|
|
27
20
|
/**
|
|
28
21
|
* Nx target name. No colons, per the repo's target-naming rule.
|
|
29
22
|
*
|
|
@@ -37,13 +30,20 @@ export const DEVENV_CROSS_PROFILE = 'linux-cross';
|
|
|
37
30
|
*/
|
|
38
31
|
export const CARGO_CROSS_LINT_TARGET = 'cargo-lint-cross';
|
|
39
32
|
/**
|
|
40
|
-
* What the cross lint prints when it
|
|
41
|
-
*
|
|
42
|
-
* key missed. The
|
|
43
|
-
*
|
|
33
|
+
* What the cross lint prints when it is asked to replay and not compile: on a
|
|
34
|
+
* Darwin cache miss under the managed pre-push probe this line, and only this
|
|
35
|
+
* line, means the key missed. The hook reads its output for exactly this text to
|
|
36
|
+
* tell a miss from any other Nx failure.
|
|
44
37
|
*/
|
|
45
|
-
export const CARGO_CROSS_LINT_REFUSAL = 'cargo-lint-cross
|
|
46
|
-
|
|
38
|
+
export const CARGO_CROSS_LINT_REFUSAL = 'cargo-lint-cross is not cached for this tree; run: bun run check:linux';
|
|
39
|
+
/**
|
|
40
|
+
* Set to `1` by the managed pre-push probe, which asks Nx for the cross target's
|
|
41
|
+
* cached verdict and must never start the clippy itself. Nx hashes no
|
|
42
|
+
* environment a target does not declare, so the probe's key is the gate's.
|
|
43
|
+
*/
|
|
44
|
+
export const CARGO_CROSS_LINT_REPLAY_ONLY_ENV = 'SMOO_CROSS_LINT_REPLAY_ONLY';
|
|
45
|
+
const CARGO_CROSS_LINT_MISSING_TOOL = "cargo-lint-cross needs cargo-zigbuild, which every managed devenv shell carries; run it in the checkout's shell: bun run check:linux";
|
|
46
|
+
const CARGO_CROSS_LINT_GUARD = `[ "\${${CARGO_CROSS_LINT_REPLAY_ONLY_ENV}:-}" != 1 ] || { echo '${CARGO_CROSS_LINT_REFUSAL}' >&2; exit 2; }; command -v cargo-zigbuild >/dev/null || { echo "${CARGO_CROSS_LINT_MISSING_TOOL}" >&2; exit 2; }`;
|
|
47
47
|
/**
|
|
48
48
|
* The prefix `cargoFrozen` writes. Exported so target inference can recognize
|
|
49
49
|
* the commands whose precondition `CARGO_FETCH_TARGET` supplies without
|
|
@@ -133,9 +133,9 @@ export const CARGO_DENY_WARNINGS = `--config 'build.warnings="deny"'`;
|
|
|
133
133
|
* cross test target; it could only recompile these crates to produce a harness it
|
|
134
134
|
* must then refuse to launch.
|
|
135
135
|
*
|
|
136
|
-
* `--target` is explicit rather than inherited from
|
|
137
|
-
*
|
|
138
|
-
*
|
|
136
|
+
* `--target` is explicit rather than inherited from an ambient CARGO_BUILD_TARGET,
|
|
137
|
+
* so the triple belongs to this target and a host lint can never pass for a cross
|
|
138
|
+
* one.
|
|
139
139
|
*
|
|
140
140
|
* cargo-zigbuild rather than plain cargo because ring compiles C for the target
|
|
141
141
|
* from its build script, and build scripts run even under clippy: zig is the
|
|
@@ -173,19 +173,15 @@ export const CARGO_LINT_CLIPPY_COMMAND = cargoFrozen(`clippy --workspace --all-t
|
|
|
173
173
|
export const CROSS_CHECK_SCRIPT_NAME = 'check:linux';
|
|
174
174
|
/**
|
|
175
175
|
* The developer entry point: one command on macOS that reports what CI's Linux
|
|
176
|
-
* job would.
|
|
177
|
-
*
|
|
176
|
+
* job would. A plain Nx run, because every managed devenv shell carries the
|
|
177
|
+
* cross toolchain; the land gate's Nx graph holds the same target.
|
|
178
178
|
*
|
|
179
179
|
* Deliberately NOT `--quiet`. The pre-push gate is a probe: it consults the Nx
|
|
180
|
-
* cache and refuses a push that has no hit, never
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
* Suppressing that output only paid while a hook ran this for you and nobody
|
|
186
|
-
* read it.
|
|
187
|
-
*/
|
|
188
|
-
export const CROSS_CHECK_SCRIPT_COMMAND = `tooling/devenv -P ${DEVENV_CROSS_PROFILE} shell -- nx run-many -t ${CARGO_CROSS_LINT_TARGET}`;
|
|
180
|
+
* cache and refuses a push that has no hit, never starting a compile of its own.
|
|
181
|
+
* The clippy behind this script is unbounded, so a silent terminal is
|
|
182
|
+
* indistinguishable from a hang.
|
|
183
|
+
*/
|
|
184
|
+
export const CROSS_CHECK_SCRIPT_COMMAND = `nx run-many -t ${CARGO_CROSS_LINT_TARGET}`;
|
|
189
185
|
/**
|
|
190
186
|
* A cross-built test archive and the target that EXECUTES it, per foreign
|
|
191
187
|
* target triple the cargo workspace declares in
|