@smoothbricks/nx-plugin 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1095 -360
- package/dist/.build-inputs.json +138 -0
- package/dist/bin/smoo-nx-cargo-toolchain.d.ts +3 -0
- package/dist/bin/smoo-nx-cargo-toolchain.d.ts.map +1 -0
- package/dist/bin/smoo-nx-cargo-toolchain.js +8 -0
- package/dist/bin/smoo-nx-forbidden-spellings.d.ts +3 -0
- package/dist/bin/smoo-nx-forbidden-spellings.d.ts.map +1 -0
- package/dist/bin/smoo-nx-forbidden-spellings.js +32 -0
- package/dist/bin/smoo-nx-nextest-timings.d.ts +3 -0
- package/dist/bin/smoo-nx-nextest-timings.d.ts.map +1 -0
- package/dist/bin/smoo-nx-nextest-timings.js +28 -0
- package/dist/bounded-test-policy.d.ts +1 -1
- package/dist/bounded-test-policy.d.ts.map +1 -1
- package/dist/bounded-test-policy.js +14 -15
- package/dist/build-state-output-policy.d.ts +95 -1
- package/dist/build-state-output-policy.d.ts.map +1 -1
- package/dist/build-state-output-policy.js +368 -30
- package/dist/bun-lock-scope.d.ts +44 -0
- package/dist/bun-lock-scope.d.ts.map +1 -0
- package/dist/bun-lock-scope.js +97 -0
- package/dist/cargo-build-script-env.d.ts +49 -0
- package/dist/cargo-build-script-env.d.ts.map +1 -0
- package/dist/cargo-build-script-env.js +324 -0
- package/dist/cargo-closure-input.d.ts +31 -4
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +66 -6
- package/dist/cargo-retention-hook.d.ts +17 -0
- package/dist/cargo-retention-hook.d.ts.map +1 -0
- package/dist/cargo-retention-hook.js +85 -0
- package/dist/cargo-source-hash.d.ts +25 -7
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +108 -43
- package/dist/cargo-toolchain-paths.d.ts +40 -0
- package/dist/cargo-toolchain-paths.d.ts.map +1 -0
- package/dist/cargo-toolchain-paths.js +84 -0
- package/dist/cargo-toolchain-policy.d.ts +25 -8
- package/dist/cargo-toolchain-policy.d.ts.map +1 -1
- package/dist/cargo-toolchain-policy.js +39 -5
- package/dist/cargo-workspace.d.ts +10 -4
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +65 -95
- package/dist/cross-check-policy.d.ts +9 -9
- package/dist/cross-check-policy.d.ts.map +1 -1
- package/dist/cross-check-policy.js +11 -11
- package/dist/disk-command-policy.d.ts.map +1 -1
- package/dist/disk-command-policy.js +1 -0
- package/dist/ensure-built-receipt.d.ts +13 -5
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +126 -47
- package/dist/ensure-built-witness.d.ts +27 -8
- package/dist/ensure-built-witness.d.ts.map +1 -1
- package/dist/ensure-built-witness.js +45 -15
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +9 -1
- package/dist/eslint-config-closure.d.ts +7 -0
- package/dist/eslint-config-closure.d.ts.map +1 -0
- package/dist/eslint-config-closure.js +346 -0
- package/dist/executors/all-verdicts/executor.d.ts +35 -0
- package/dist/executors/all-verdicts/executor.d.ts.map +1 -0
- package/dist/executors/all-verdicts/executor.js +133 -0
- package/dist/executors/all-verdicts/schema.d.ts +10 -0
- package/dist/executors/all-verdicts/schema.d.ts.map +1 -0
- package/dist/executors/all-verdicts/schema.js +2 -0
- package/dist/executors/bounded-exec/bounds.d.ts +56 -0
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -0
- package/dist/executors/bounded-exec/bounds.js +43 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts +33 -36
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool.js +54 -119
- package/dist/executors/bounded-exec/executor.d.ts +19 -12
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +371 -239
- package/dist/executors/bounded-exec/gateway-lease.d.ts +22 -19
- package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
- package/dist/executors/bounded-exec/gateway-lease.js +81 -28
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +18 -1
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
- package/dist/executors/bounded-exec/hang-diagnostics.js +148 -30
- package/dist/executors/bounded-exec/lease-wait.d.ts +43 -0
- package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
- package/dist/executors/bounded-exec/lease-wait.js +68 -0
- package/dist/executors/bounded-exec/lock-wait.d.ts +51 -0
- package/dist/executors/bounded-exec/lock-wait.d.ts.map +1 -0
- package/dist/executors/bounded-exec/lock-wait.js +108 -0
- package/dist/executors/bounded-exec/owned-subtree.d.ts +84 -0
- package/dist/executors/bounded-exec/owned-subtree.d.ts.map +1 -0
- package/dist/executors/bounded-exec/owned-subtree.js +178 -0
- package/dist/executors/bounded-exec/progress.d.ts +4 -1
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/progress.js +5 -2
- package/dist/executors/bounded-exec/ram-attach.d.ts +19 -0
- package/dist/executors/bounded-exec/ram-attach.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-attach.js +207 -0
- package/dist/executors/bounded-exec/ram-detach.d.ts +25 -0
- package/dist/executors/bounded-exec/ram-detach.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-detach.js +207 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +76 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp-fixtures.js +296 -0
- package/dist/executors/bounded-exec/ram-temp.d.ts +388 -88
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.js +1213 -399
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts +4 -4
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/run-cpu-pool.js +20 -30
- package/dist/executors/bounded-exec/runner-hook.js +14 -5
- package/dist/executors/bounded-exec/runner-lifecycle.d.ts +14 -1
- package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -1
- package/dist/executors/bounded-exec/runner-lifecycle.js +27 -6
- package/dist/executors/bounded-exec/{cpu-tokens.d.ts → runner-sizing.d.ts} +14 -42
- package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -0
- package/dist/executors/bounded-exec/{cpu-tokens.js → runner-sizing.js} +5 -35
- package/dist/executors/bounded-exec/runtime-pin.d.ts +73 -0
- package/dist/executors/bounded-exec/runtime-pin.d.ts.map +1 -0
- package/dist/executors/bounded-exec/runtime-pin.js +167 -0
- package/dist/executors/bounded-exec/schema.d.ts +18 -1
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.d.ts +40 -11
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +88 -19
- package/dist/executors/cargo-zigbuild/executor.d.ts +21 -0
- package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
- package/dist/executors/cargo-zigbuild/executor.js +67 -12
- package/dist/executors/clean-outputs/executor.js +1 -0
- package/dist/executors/scriptc-native/executor.d.ts +79 -0
- package/dist/executors/scriptc-native/executor.d.ts.map +1 -0
- package/dist/executors/scriptc-native/executor.js +367 -0
- package/dist/executors/scriptc-native/ffi-paths.d.ts +9 -0
- package/dist/executors/scriptc-native/ffi-paths.d.ts.map +1 -0
- package/dist/executors/scriptc-native/ffi-paths.js +25 -0
- package/dist/executors/scriptc-native/schema.d.ts +34 -0
- package/dist/executors/scriptc-native/schema.d.ts.map +1 -0
- package/dist/executors/scriptc-native/schema.js +1 -0
- package/dist/executors/typescript-emit/executor.d.ts +3 -1
- package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
- package/dist/executors/typescript-emit/executor.js +164 -33
- package/dist/forbidden-spelling-policy.d.ts +56 -0
- package/dist/forbidden-spelling-policy.d.ts.map +1 -0
- package/dist/forbidden-spelling-policy.js +176 -0
- package/dist/generators/create-package/generator.d.ts.map +1 -1
- package/dist/generators/create-package/generator.js +3 -4
- package/dist/graph-input-contract.d.ts +14 -0
- package/dist/graph-input-contract.d.ts.map +1 -1
- package/dist/graph-input-contract.js +67 -2
- package/dist/index.d.ts +23 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +676 -215
- package/dist/managed-assets.d.ts +2 -0
- package/dist/managed-assets.d.ts.map +1 -1
- package/dist/managed-files/files.d.ts +3 -3
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +28 -3
- package/dist/managed-files/managed-format.d.ts.map +1 -1
- package/dist/managed-files/managed-format.js +1 -0
- package/dist/nextest-code-bound.js +1 -0
- package/dist/nextest-timings.d.ts +35 -0
- package/dist/nextest-timings.d.ts.map +1 -0
- package/dist/nextest-timings.js +168 -0
- package/dist/owned-installation.d.ts +6 -5
- package/dist/owned-installation.d.ts.map +1 -1
- package/dist/owned-installation.js +150 -26
- package/dist/package-target-policy.d.ts.map +1 -1
- package/dist/package-target-policy.js +2 -3
- package/dist/process-children.d.ts +7 -0
- package/dist/process-children.d.ts.map +1 -0
- package/dist/process-children.darwin.d.ts +7 -0
- package/dist/process-children.darwin.d.ts.map +1 -0
- package/dist/process-children.darwin.js +13 -0
- package/dist/process-children.js +14 -0
- package/dist/process-children.linux.d.ts +8 -0
- package/dist/process-children.linux.d.ts.map +1 -0
- package/dist/process-children.linux.js +25 -0
- package/dist/process-group.d.ts +108 -0
- package/dist/process-group.d.ts.map +1 -0
- package/dist/process-group.js +171 -0
- package/dist/process-listing.d.ts +7 -0
- package/dist/process-listing.d.ts.map +1 -0
- package/dist/process-listing.js +51 -0
- package/dist/producer-receipts.d.ts +8 -2
- package/dist/producer-receipts.d.ts.map +1 -1
- package/dist/producer-receipts.js +75 -48
- package/dist/task-graph-policy.d.ts +21 -0
- package/dist/task-graph-policy.d.ts.map +1 -0
- package/dist/task-graph-policy.js +91 -0
- package/dist/test-timings.js +4 -4
- package/dist/test-walk-policy.d.ts +14 -5
- package/dist/test-walk-policy.d.ts.map +1 -1
- package/dist/test-walk-policy.js +8 -2
- package/dist/testing.d.ts +73 -28
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +217 -223
- package/dist/tool-bins.d.ts +33 -0
- package/dist/tool-bins.d.ts.map +1 -0
- package/dist/tool-bins.js +72 -0
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +3 -4
- package/dist/wait-why-policy.d.ts +28 -0
- package/dist/wait-why-policy.d.ts.map +1 -0
- package/dist/wait-why-policy.js +223 -0
- package/dist/workspace-config-policy.d.ts +14 -8
- package/dist/workspace-config-policy.d.ts.map +1 -1
- package/dist/workspace-config-policy.js +60 -16
- package/dist/workspace-manifest.d.ts +41 -6
- package/dist/workspace-manifest.d.ts.map +1 -1
- package/dist/workspace-manifest.js +57 -0
- package/executors.json +21 -1
- package/loader.js +2 -0
- package/managed/raw/envrc +11 -0
- package/managed/raw/patches/nx@23.2.1.patch +2840 -199
- package/managed/raw/patches/ttsc@0.34.1.patch +119 -0
- package/managed/raw/tooling/direnv/cargo-fetch-bound.ts +245 -0
- package/managed/raw/tooling/direnv/cargo-fetch-run.ts +299 -0
- package/managed/raw/tooling/direnv/compiler-variables.sh +42 -0
- package/managed/raw/tooling/direnv/developer-links.ts +464 -25
- package/managed/raw/tooling/direnv/devenv.smoo.nix +78 -38
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -12
- package/managed/raw/tooling/direnv/installed-bun-links.ts +308 -0
- package/managed/raw/tooling/direnv/linked-snapshots.ts +62 -3
- package/managed/raw/tooling/direnv/nx-socket-dir.sh +56 -17
- package/managed/raw/tooling/direnv/repo-path +68 -6
- package/managed/raw/tooling/direnv/secret-references.ts +13 -4
- package/managed/raw/tooling/direnv/setup-environment.ts +128 -537
- package/managed/raw/tooling/direnv/toolchain-stamp.ts +4 -2
- package/managed/raw/tooling/direnv/ttsc-env.sh +9 -0
- package/managed/raw/tooling/direnv/uv-relocation.ts +227 -0
- package/managed/raw/tooling/git-hooks/commit-msg.sh +2 -1
- package/managed/raw/tooling/git-hooks/pre-commit.sh +2 -1
- package/managed/raw/tooling/git-hooks/pre-push.sh +2 -1
- package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +85 -7
- package/managed/templates/github/actions/save-nix-devenv/action.yml +12 -2
- package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
- package/package.json +77 -13
- package/src/bin/smoo-nx-cargo-toolchain.ts +11 -0
- package/src/bin/smoo-nx-forbidden-spellings.ts +33 -0
- package/src/bin/smoo-nx-nextest-timings.ts +31 -0
- package/src/bounded-test-policy.ts +12 -14
- package/src/build-state-output-policy.ts +458 -34
- package/src/bun-lock-scope.ts +108 -0
- package/src/cargo-build-script-env.ts +265 -0
- package/src/cargo-closure-input.ts +74 -7
- package/src/cargo-retention-hook.ts +94 -0
- package/src/cargo-source-hash.ts +138 -41
- package/src/cargo-toolchain-paths.ts +95 -0
- package/src/cargo-toolchain-policy.ts +49 -5
- package/src/cargo-workspace.ts +72 -123
- package/src/cross-check-policy.ts +12 -10
- package/src/disk-command-policy.ts +1 -0
- package/src/ensure-built-receipt.ts +132 -39
- package/src/ensure-built-witness.ts +62 -10
- package/src/ensure-built.ts +11 -1
- package/src/eslint-config-closure.ts +357 -0
- package/src/executors/all-verdicts/executor.ts +164 -0
- package/src/executors/all-verdicts/schema.json +22 -0
- package/src/executors/all-verdicts/schema.ts +10 -0
- package/src/executors/bounded-exec/bounds.ts +76 -0
- package/src/executors/bounded-exec/cpu-pool.ts +51 -117
- package/src/executors/bounded-exec/executor.ts +423 -259
- package/src/executors/bounded-exec/gateway-lease.ts +82 -33
- package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
- package/src/executors/bounded-exec/lease-wait.ts +89 -0
- package/src/executors/bounded-exec/lock-wait.ts +141 -0
- package/src/executors/bounded-exec/owned-subtree.ts +235 -0
- package/src/executors/bounded-exec/progress.ts +9 -3
- package/src/executors/bounded-exec/ram-attach.ts +238 -0
- package/src/executors/bounded-exec/ram-detach.ts +226 -0
- package/src/executors/bounded-exec/ram-temp-fixtures.ts +358 -0
- package/src/executors/bounded-exec/ram-temp-registry.txt +440 -0
- package/src/executors/bounded-exec/ram-temp.ts +1497 -460
- package/src/executors/bounded-exec/run-cpu-pool.ts +22 -30
- package/src/executors/bounded-exec/runner-hook.ts +14 -6
- package/src/executors/bounded-exec/runner-lifecycle.ts +31 -8
- package/src/executors/bounded-exec/{cpu-tokens.ts → runner-sizing.ts} +13 -59
- package/src/executors/bounded-exec/runtime-pin.ts +232 -0
- package/src/executors/bounded-exec/schema.json +11 -2
- package/src/executors/bounded-exec/schema.ts +19 -1
- package/src/executors/bounded-exec/verdict.ts +137 -34
- package/src/executors/cargo-zigbuild/executor.ts +82 -8
- package/src/executors/clean-outputs/executor.ts +1 -0
- package/src/executors/scriptc-native/executor.ts +394 -0
- package/src/executors/scriptc-native/ffi-paths.ts +29 -0
- package/src/executors/scriptc-native/schema.json +60 -0
- package/src/executors/scriptc-native/schema.ts +34 -0
- package/src/executors/typescript-emit/executor.ts +205 -38
- package/src/forbidden-spelling-policy.ts +226 -0
- package/src/generators/create-package/generator.ts +7 -7
- package/src/graph-input-contract.ts +61 -2
- package/src/index.ts +792 -225
- package/src/managed-assets.ts +3 -0
- package/src/managed-files/files.ts +28 -3
- package/src/managed-files/managed-format.ts +1 -0
- package/src/nextest-code-bound.ts +1 -0
- package/src/nextest-timings.ts +106 -0
- package/src/owned-installation.ts +150 -23
- package/src/package-target-policy.ts +2 -3
- package/src/process-children.darwin.ts +14 -0
- package/src/process-children.linux.ts +33 -0
- package/src/process-children.ts +22 -0
- package/src/process-group.ts +209 -0
- package/src/process-listing.ts +54 -0
- package/src/producer-receipts.ts +68 -45
- package/src/task-graph-policy.ts +98 -0
- package/src/test-walk-policy.ts +23 -8
- package/src/testing.ts +240 -232
- package/src/tool-bins.ts +108 -0
- package/src/typecheck-test-policy.ts +2 -3
- package/src/wait-why-policy.ts +226 -0
- package/src/workspace-config-policy.ts +63 -15
- package/src/workspace-manifest.ts +89 -6
- package/test-timings.json +123 -98
- package/dist/bin/smoo-nx-failures.d.ts +0 -3
- package/dist/bin/smoo-nx-failures.d.ts.map +0 -1
- package/dist/bin/smoo-nx-failures.js +0 -3
- package/dist/bin/smoo-nx-nextest-extract.d.ts +0 -3
- package/dist/bin/smoo-nx-nextest-extract.d.ts.map +0 -1
- package/dist/bin/smoo-nx-nextest-extract.js +0 -42
- package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +0 -1
- package/dist/failure-summary.d.ts +0 -5
- package/dist/failure-summary.d.ts.map +0 -1
- package/dist/failure-summary.js +0 -118
- package/dist/nextest-extraction.d.ts +0 -117
- package/dist/nextest-extraction.d.ts.map +0 -1
- package/dist/nextest-extraction.js +0 -303
- package/managed/raw/patches/ttsc@0.30.4.patch +0 -2255
- package/src/__tests__/cargo-closure-filesets.ts +0 -94
- package/src/__tests__/cargo-closure-fixture.ts +0 -113
- package/src/__tests__/counted-cargo-process.ts +0 -286
- package/src/__tests__/counted-cargo.ts +0 -713
- package/src/__tests__/directory-change.ts +0 -27
- package/src/__tests__/fixture-cargo-home.ts +0 -36
- package/src/__tests__/fixture-nx-env.ts +0 -193
- package/src/__tests__/owned-installation.ts +0 -13
- package/src/__tests__/past-tick.ts +0 -12
- package/src/__tests__/progress-clock.ts +0 -43
- package/src/__tests__/runtime-input.ts +0 -23
- package/src/bin/smoo-nx-bound-failures.test.ts +0 -127
- package/src/bin/smoo-nx-failures.ts +0 -4
- package/src/bin/smoo-nx-nextest-extract.ts +0 -44
- package/src/bounded-test-policy.test.ts +0 -1029
- package/src/build-state-output-policy.test.ts +0 -115
- package/src/bun-bootstrap.test.ts +0 -102
- package/src/bun-file-packages.test.ts +0 -47
- package/src/cargo-closure-filesets.test.ts +0 -63
- package/src/cargo-closure-input.property.test.ts +0 -50
- package/src/cargo-closure-input.test.ts +0 -506
- package/src/cargo-closure-key.test.ts +0 -240
- package/src/cargo-resolve-cache.test.ts +0 -1181
- package/src/cargo-source-hash.test.ts +0 -707
- package/src/cargo-workspace.test.ts +0 -615
- package/src/cross-check-policy.test.ts +0 -316
- package/src/disk-command-policy.test.ts +0 -61
- package/src/ensure-built-receipt.test.ts +0 -279
- package/src/ensure-built-witness.test.ts +0 -688
- package/src/ensure-built.test.ts +0 -1462
- package/src/executors/bounded-exec/cargo-progress-host.test.ts +0 -332
- package/src/executors/bounded-exec/cpu-pool.test.ts +0 -684
- package/src/executors/bounded-exec/cpu-tokens.test.ts +0 -519
- package/src/executors/bounded-exec/disk-lease.test.ts +0 -219
- package/src/executors/bounded-exec/executor-host.test.ts +0 -800
- package/src/executors/bounded-exec/executor.test.ts +0 -1819
- package/src/executors/bounded-exec/go-progress-host.test.ts +0 -171
- package/src/executors/bounded-exec/hang-diagnostics.test.ts +0 -291
- package/src/executors/bounded-exec/progress.test.ts +0 -139
- package/src/executors/bounded-exec/ram-temp-held.test.ts +0 -264
- package/src/executors/bounded-exec/ram-temp-host.test.ts +0 -635
- package/src/executors/bounded-exec/ram-temp.test.ts +0 -750
- package/src/executors/bounded-exec/run-cpu-pool.test.ts +0 -79
- package/src/executors/bounded-exec/runner-hook.test.ts +0 -193
- package/src/executors/bounded-exec/runner-lifecycle.test.ts +0 -82
- package/src/executors/bounded-exec/verdict.test.ts +0 -545
- package/src/executors/cargo-zigbuild/executor.test.ts +0 -129
- package/src/executors/clean-outputs/executor.test.ts +0 -20
- package/src/executors/typescript-emit/executor.test.ts +0 -83
- package/src/failure-summary.ts +0 -119
- package/src/generators/bounded-test-targets/generator.test.ts +0 -138
- package/src/generators/bun-test-tracing/generator.test.ts +0 -250
- package/src/generators/create-package/generator.test.ts +0 -190
- package/src/generators/make-public/generator.test.ts +0 -137
- package/src/graph-input-contract.test.ts +0 -379
- package/src/host-controller-wiring.test.ts +0 -31
- package/src/index.test.ts +0 -3319
- package/src/linked-snapshots.nx.test.ts +0 -254
- package/src/managed-files/forgejo-artifact.test.ts +0 -395
- package/src/managed-files/generator.test.ts +0 -243
- package/src/managed-files/github-host-cache-isolation.test.ts +0 -86
- package/src/managed-files/json-edit.test.ts +0 -216
- package/src/managed-files/managed-content.test.ts +0 -166
- package/src/managed-files/managed-format-json.test.ts +0 -308
- package/src/managed-files/repo-path.test.ts +0 -172
- package/src/managed-files/setup-devenv-free-disk.test.ts +0 -95
- package/src/managed-files/trace-db-artifact.test.ts +0 -7
- package/src/managed-files/tree-permissions.test.ts +0 -109
- package/src/managed-files/tree.test.ts +0 -123
- package/src/manifest-hash.test.ts +0 -219
- package/src/nextest-code-bound.test.ts +0 -161
- package/src/nextest-extraction.test.ts +0 -216
- package/src/nextest-extraction.ts +0 -371
- package/src/nextest-partitions.test.ts +0 -501
- package/src/nx-cache-bound.test.ts +0 -109
- package/src/nx-cache-restore-mtime.test.ts +0 -170
- package/src/nx-daemon-claim.test.ts +0 -279
- package/src/nx-daemon-idle-cpu.test.ts +0 -80
- package/src/nx-daemon-idle-policy.test.ts +0 -111
- package/src/nx-daemon-ignore-files.test.ts +0 -210
- package/src/nx-daemon-root-normalization.test.ts +0 -105
- package/src/nx-daemon-start-never.test.ts +0 -292
- package/src/nx-daemon-validity.test.ts +0 -1055
- package/src/nx-dot-input-policy.test.ts +0 -353
- package/src/nx-failure-life-cycles.test.ts +0 -207
- package/src/nx-files-archive-racy.test.ts +0 -97
- package/src/nx-foreign-workspace-env.test.ts +0 -329
- package/src/nx-incomplete-run-summary.test.ts +0 -70
- package/src/nx-plugin-load-errors.test.ts +0 -120
- package/src/nx-project-graph-errors.test.ts +0 -70
- package/src/nx-project-resolution-cache.test.ts +0 -176
- package/src/nx-raw-inputs.test.ts +0 -166
- package/src/nx-resident-graph-workers.test.ts +0 -112
- package/src/nx-run-information.test.ts +0 -118
- package/src/nx-skipped-task-exit.test.ts +0 -180
- package/src/nx-state-location.test.ts +0 -63
- package/src/nx-store-resolution.test.ts +0 -81
- package/src/nx-task-graph-cycles.test.ts +0 -148
- package/src/nx-task-output-lease.test.ts +0 -550
- package/src/nx-use-local.test.ts +0 -105
- package/src/owned-installation.test.ts +0 -105
- package/src/package-target-policy.test.ts +0 -1014
- package/src/producer-receipts.test.ts +0 -285
- package/src/release-config-policy.test.ts +0 -311
- package/src/runtime-input.test.ts +0 -393
- package/src/serial-group-wiring.test.ts +0 -326
- package/src/task-history-namespace.test.ts +0 -181
- package/src/task-results.test.ts +0 -228
- package/src/test-clock-policy.test.ts +0 -338
- package/src/test-program.test.ts +0 -303
- package/src/test-timings.test.ts +0 -240
- package/src/test-walk-policy.test.ts +0 -620
- package/src/testing.test.ts +0 -509
- package/src/typecheck-test-policy.test.ts +0 -1468
- package/src/typescript-resolution.test.ts +0 -76
- package/src/version-actions.test.ts +0 -80
- package/src/workspace-config-policy.test.ts +0 -737
|
@@ -8,7 +8,7 @@ import { runtimeInput, shellWord } from './runtime-input.js';
|
|
|
8
8
|
* The DECLARED pin, hashed as an ordinary file. devenv resolves this lock into
|
|
9
9
|
* the rustc, cargo, linker, C toolchain and SDK that every cargo command
|
|
10
10
|
* inherits, so a bump here is exactly the event that must invalidate a cached
|
|
11
|
-
* artifact — and it is the
|
|
11
|
+
* artifact — and it is the half of the identity that a file can state portably.
|
|
12
12
|
*
|
|
13
13
|
* This replaces a runtime input that dumped the ambient cargo environment
|
|
14
14
|
* (every `CARGO_`, `RUST`, `CC`, `CXX`, `AR`, `SDKROOT`, `LIBCLANG_PATH`,
|
|
@@ -44,14 +44,31 @@ export const CARGO_TOOLCHAIN_PIN_INPUTS = [
|
|
|
44
44
|
'{workspaceRoot}/tooling/direnv/devenv.lock',
|
|
45
45
|
];
|
|
46
46
|
/**
|
|
47
|
-
* The
|
|
48
|
-
*
|
|
47
|
+
* The runtime input naming the programs the shell declares for Cargo to compile and link with, by Nix store object:
|
|
48
|
+
* the other half of the identity, which no file states (cargo-toolchain-paths.ts says what it names, and why). Nx runs
|
|
49
|
+
* a runtime input from the workspace root, so the command names the plugin as the workspace's `node_modules` links it.
|
|
50
|
+
*/
|
|
51
|
+
const CARGO_TOOLCHAIN_PATHS_COMMAND = 'node node_modules/@smoothbricks/nx-plugin/dist/bin/smoo-nx-cargo-toolchain.js';
|
|
52
|
+
/** The runtime input of the programs the shell declares, a fresh value for each caller. */
|
|
53
|
+
export function cargoToolchainPathsInput() {
|
|
54
|
+
return runtimeInput(CARGO_TOOLCHAIN_PATHS_COMMAND);
|
|
55
|
+
}
|
|
56
|
+
/** Every input a cargo task's key names of its toolchain: the pin files, then the programs the shell declares. */
|
|
57
|
+
export function cargoToolchainInputs() {
|
|
58
|
+
return [...CARGO_TOOLCHAIN_PIN_INPUTS, cargoToolchainPathsInput()];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The name a repository's own `inputs` declaration uses to reach the whole
|
|
62
|
+
* toolchain identity without restating it.
|
|
49
63
|
*
|
|
50
64
|
* A declared target REPLACES the inferred input list, pin included, so a
|
|
51
65
|
* hand-written `inputs` array silently drops the toolchain identity and the
|
|
52
66
|
* target stops seeing a toolchain bump at all. Inference defines this named
|
|
53
67
|
* input on every project that has cargo targets so a declaration can name one
|
|
54
68
|
* token that cannot drift from what the plugin attaches.
|
|
69
|
+
*
|
|
70
|
+
* The identity holds an input no fileset can state, so a declaration names this
|
|
71
|
+
* rather than restating the lock.
|
|
55
72
|
*/
|
|
56
73
|
export const CARGO_TOOLCHAIN_NAMED_INPUT = 'cargoToolchain';
|
|
57
74
|
/** The toolchain versions `command` prints, from the directory whose rust-toolchain selects them. */
|
|
@@ -59,12 +76,29 @@ export function cargoRuntimeInput(projectRoot, command) {
|
|
|
59
76
|
return runtimeInput(`sh -c ${shellWord(`cd "$0" && ${command}`)} ${shellWord(projectRoot)}`);
|
|
60
77
|
}
|
|
61
78
|
/**
|
|
62
|
-
* Does one resolved input string
|
|
79
|
+
* Does one resolved input string hold a toolchain lock?
|
|
63
80
|
*
|
|
64
81
|
* Resolved: named inputs already expanded. The check is by suffix rather than
|
|
65
82
|
* by exact path because a repository may keep its lock at a location this list
|
|
66
83
|
* does not name; what matters is that a devenv lock is hashed, not which one.
|
|
67
84
|
*/
|
|
68
|
-
|
|
85
|
+
function isCargoToolchainLock(input) {
|
|
69
86
|
return !input.startsWith('!') && input.endsWith('/devenv.lock');
|
|
70
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Does a resolved input list carry the toolchain identity?
|
|
90
|
+
*
|
|
91
|
+
* `reached` is what a declaration's inputs hold once their named inputs are resolved. The inference-owned
|
|
92
|
+
* `cargoToolchain`, left unresolved, stands for the whole identity. Otherwise the list must hold both halves itself: a
|
|
93
|
+
* devenv lock that nothing in the list excludes, and the programs runtime input exactly as inference spells it. A lock
|
|
94
|
+
* restated without the programs is refused, however it is reached: no fileset can state the programs the shell
|
|
95
|
+
* declares, so a list that stops at the lock misses a change to the linker.
|
|
96
|
+
*/
|
|
97
|
+
export function carriesCargoToolchain(reached) {
|
|
98
|
+
if (reached.includes(CARGO_TOOLCHAIN_NAMED_INPUT))
|
|
99
|
+
return true;
|
|
100
|
+
const excluded = new Set(reached.flatMap((input) => (typeof input === 'string' && input.startsWith('!') ? [input.slice(1)] : [])));
|
|
101
|
+
const hasLock = reached.some((input) => typeof input === 'string' && isCargoToolchainLock(input) && !excluded.has(input));
|
|
102
|
+
const programs = cargoToolchainPathsInput().runtime;
|
|
103
|
+
return hasLock && reached.some((input) => typeof input === 'object' && input.runtime === programs);
|
|
104
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TomlTable } from 'smol-toml';
|
|
2
|
-
import { type CompiledCargoInput } from './cargo-source-hash.js';
|
|
2
|
+
import { type CargoResolve, type CompiledCargoInput } from './cargo-source-hash.js';
|
|
3
3
|
export interface CargoWorkspacePackage {
|
|
4
4
|
name: string;
|
|
5
5
|
dir: string;
|
|
@@ -38,6 +38,8 @@ export interface CargoPackageTestInputsOptions {
|
|
|
38
38
|
/** The cargo workspace root holding the top-level `Cargo.toml`. */
|
|
39
39
|
absoluteProjectRoot: string;
|
|
40
40
|
memberDir: string;
|
|
41
|
+
/** Cargo's locked resolve of that workspace, which decides the crates the member's tests build. */
|
|
42
|
+
cargo: CargoResolve;
|
|
41
43
|
/** Shared across every call of one graph computation; see {@link createCargoInputsCache}. */
|
|
42
44
|
cache?: CargoInputsCache;
|
|
43
45
|
}
|
|
@@ -58,14 +60,18 @@ export interface CargoInputsCache {
|
|
|
58
60
|
}
|
|
59
61
|
export declare function createCargoInputsCache(): CargoInputsCache;
|
|
60
62
|
export declare function cargoPackageTestInputs(options: CargoPackageTestInputsOptions): Promise<string[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Refuses inputs outside the Nx workspace that `nx.json` gives no `externalRustCrates` runtime hash for: no fileset
|
|
65
|
+
* can hash them, and a key without them would replay a verdict across their edits. `external` maps each input's name
|
|
66
|
+
* to its path.
|
|
67
|
+
*/
|
|
68
|
+
export declare function requireExternalRustCratesInput(workspaceRoot: string, manifest: string, external: ReadonlyMap<string, string>): void;
|
|
61
69
|
/**
|
|
62
70
|
* The aggregate that actually runs a cargo workspace's tests. Named here because
|
|
63
71
|
* both target inference and the policy that verifies `test` reaches it need the
|
|
64
72
|
* same string, and a drifted copy would make the policy vacuous.
|
|
65
73
|
*/
|
|
66
74
|
export declare const CARGO_TEST_TARGET = "cargo-test";
|
|
67
|
-
/** Prerequisite that compiles the workspace; not a per-crate runner. */
|
|
68
|
-
export declare const CARGO_TEST_COMPILE_TARGET = "cargo-test-compile";
|
|
69
75
|
/**
|
|
70
76
|
* The one workspace-wide `cargo nextest archive` every per-crate runner
|
|
71
77
|
* executes from. Named here beside the other cargo target names so the policy
|
|
@@ -256,7 +262,7 @@ export declare const PLUGIN_NEXTEST_CONFIG_PATH = "node_modules/@smoothbricks/nx
|
|
|
256
262
|
* contain spaces.
|
|
257
263
|
*
|
|
258
264
|
* The file is named through the workspace root's `node_modules` link, as
|
|
259
|
-
*
|
|
265
|
+
* tool package CLIs are (tool-bins.ts), never through where the plugin really lives: a
|
|
260
266
|
* plugin linked from a checkout outside the workspace sits a different number
|
|
261
267
|
* of `../` away from each workspace depending on how deep that workspace is,
|
|
262
268
|
* and that count re-keyed every target of every Cargo project — and every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cargo-workspace.d.ts","sourceRoot":"","sources":["../src/cargo-workspace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"cargo-workspace.d.ts","sourceRoot":"","sources":["../src/cargo-workspace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,kBAAkB,EAAmB,MAAM,wBAAwB,CAAC;AAEnH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,+BAAgC,SAAQ,qBAAqB;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,0BAA0B,CAAC,mBAAmB,EAAE,MAAM,GAAG,qBAAqB,EAAE,CAkF/F;AA0ED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,SAAS,qBAAqB,EAAE,EAC1C,QAAQ,EAAE,SAAS,qBAAqB,EAAE,GACzC,+BAA+B,EAAE,CAgBnC;AAED;;;;;;GAMG;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;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAMhE;AAmKD,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,yBAAyB,CAAC"}
|
package/dist/cargo-workspace.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
-
import { dirname, isAbsolute, join,
|
|
2
|
+
import { readFile, realpath } from 'node:fs/promises';
|
|
3
|
+
import { dirname, isAbsolute, join, posix, relative, resolve, sep } from 'node:path';
|
|
4
4
|
import { readNxJson } from 'nx/src/config/nx-json.js';
|
|
5
5
|
import { parse as parseToml } from 'smol-toml';
|
|
6
|
-
import { compiledInFiles } from './cargo-source-hash.js';
|
|
6
|
+
import { buildClosure, compiledInFiles } from './cargo-source-hash.js';
|
|
7
7
|
export function listCargoWorkspacePackages(absoluteProjectRoot) {
|
|
8
8
|
const workspaceTomlPath = join(absoluteProjectRoot, 'Cargo.toml');
|
|
9
9
|
if (!existsSync(workspaceTomlPath)) {
|
|
@@ -183,7 +183,7 @@ export function cargoPackageTestInputs(options) {
|
|
|
183
183
|
cache.results.set(key, derived);
|
|
184
184
|
return derived;
|
|
185
185
|
}
|
|
186
|
-
async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot, memberDir }, cache) {
|
|
186
|
+
async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot, memberDir, cargo }, cache) {
|
|
187
187
|
// Every fileset is anchored at `{workspaceRoot}`, never `{projectRoot}`: Nx
|
|
188
188
|
// hashes a `{projectRoot}` glob against only the files its project OWNS, and
|
|
189
189
|
// a nested Nx project owns the crates under it. A repository-root cargo
|
|
@@ -200,98 +200,61 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
|
|
|
200
200
|
cache.manifests.set(normalized, parsed);
|
|
201
201
|
return parsed;
|
|
202
202
|
};
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
// Cargo reports canonical paths, so every path below is related to the canonical roots.
|
|
204
|
+
const [nxRoot, cargoRoot, crateDirectory] = await Promise.all([
|
|
205
|
+
realpath(workspaceRoot),
|
|
206
|
+
realpath(absoluteProjectRoot),
|
|
207
|
+
realpath(join(absoluteProjectRoot, memberDir)),
|
|
208
|
+
]);
|
|
209
|
+
const crate = cargo.local.find((pkg) => pkg.directory === crateDirectory);
|
|
210
|
+
if (crate === undefined) {
|
|
211
|
+
throw new Error(`Cargo's resolve of ${join(absoluteProjectRoot, 'Cargo.toml')} holds no package at ${memberDir}`);
|
|
212
|
+
}
|
|
213
|
+
// Exactly the crates Cargo builds for this crate's tests, read from Cargo's
|
|
214
|
+
// own resolve: the crate's normal, build and dev dependencies, and below it
|
|
215
|
+
// only normal and build ones (`buildClosure`), with the workspace's patches
|
|
216
|
+
// and replacements already applied. The closure, not the direct edge set: a
|
|
205
217
|
// test binary links every crate beneath it, and the chained cargo-test
|
|
206
|
-
// targets order runs without contributing to each other's hash
|
|
207
|
-
// dependency
|
|
208
|
-
//
|
|
218
|
+
// targets order runs without contributing to each other's hash. A
|
|
219
|
+
// dependency's own dev-dependencies never compile into this crate's test
|
|
220
|
+
// binaries, so an edit to one leaves this key alone.
|
|
221
|
+
const closure = buildClosure(cargo, [crate.id]);
|
|
209
222
|
const dirs = new Set();
|
|
210
223
|
const external = new Map();
|
|
211
|
-
const pending = [normalize(memberDir).split(sep).join('/')];
|
|
212
224
|
const declaredSources = new Set();
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
for (const replacements of Object.values(rootManifest.patch)) {
|
|
216
|
-
enqueuePathDependencies({ dependencies: replacements }, '.', new Map(), pending, external, absoluteProjectRoot, workspaceRoot);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (isRecord(rootManifest.replace)) {
|
|
220
|
-
enqueuePathDependencies({ dependencies: rootManifest.replace }, '.', new Map(), pending, external, absoluteProjectRoot, workspaceRoot);
|
|
221
|
-
}
|
|
222
|
-
while (pending.length > 0) {
|
|
223
|
-
const dir = pending.pop();
|
|
224
|
-
if (dir === undefined || dirs.has(dir)) {
|
|
225
|
+
for (const pkg of cargo.local) {
|
|
226
|
+
if (!closure.has(pkg.id))
|
|
225
227
|
continue;
|
|
228
|
+
if (isOutsideRoot(relative(nxRoot, pkg.directory))) {
|
|
229
|
+
external.set(pkg.name, pkg.directory);
|
|
226
230
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
if (!existsSync(crateTomlPath)) {
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
const crateParsed = await loadManifest(crateTomlPath);
|
|
233
|
-
if (!isRecord(crateParsed)) {
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
let owner = resolve(absoluteProjectRoot, dir);
|
|
237
|
-
if (isRecord(crateParsed.package) && typeof crateParsed.package.workspace === 'string') {
|
|
238
|
-
owner = resolve(owner, crateParsed.package.workspace);
|
|
239
|
-
if (isOutsideRoot(relative(workspaceRoot, owner))) {
|
|
240
|
-
external.set(`${dir} workspace`, owner);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
let workspacePathDeps = new Map();
|
|
244
|
-
while (!isOutsideRoot(relative(workspaceRoot, owner))) {
|
|
245
|
-
const manifestPath = join(owner, 'Cargo.toml');
|
|
246
|
-
if (existsSync(manifestPath)) {
|
|
247
|
-
const manifest = await loadManifest(manifestPath);
|
|
248
|
-
if (isRecord(manifest.workspace)) {
|
|
249
|
-
workspacePathDeps = workspacePathDependencies(manifest, owner);
|
|
250
|
-
declaredSources.add(manifestPath);
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
const parent = dirname(owner);
|
|
255
|
-
if (parent === owner)
|
|
256
|
-
break;
|
|
257
|
-
owner = parent;
|
|
258
|
-
}
|
|
259
|
-
enqueuePathDependencies(crateParsed, dir, workspacePathDeps, pending, external, absoluteProjectRoot, workspaceRoot);
|
|
260
|
-
// All cfg variants can affect a compiled target; do not evaluate Cargo cfg here.
|
|
261
|
-
if (isRecord(crateParsed.target)) {
|
|
262
|
-
for (const target of Object.values(crateParsed.target)) {
|
|
263
|
-
if (isRecord(target)) {
|
|
264
|
-
enqueuePathDependencies(target, dir, workspacePathDeps, pending, external, absoluteProjectRoot, workspaceRoot);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
231
|
+
else {
|
|
232
|
+
dirs.add(relative(cargoRoot, pkg.directory).split(sep).join('/') || '.');
|
|
267
233
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
for (const target of Array.isArray(targets) ? targets : [targets]) {
|
|
274
|
-
if (isRecord(target) && typeof target.path === 'string') {
|
|
275
|
-
declaredSources.add(resolve(absoluteProjectRoot, dir, target.path));
|
|
276
|
-
}
|
|
277
|
-
}
|
|
234
|
+
// Target sources outside the package's directory (a shared build script, a `[lib] path`), and its governing
|
|
235
|
+
// manifest.
|
|
236
|
+
for (const source of [...pkg.sources, pkg.governingManifest]) {
|
|
237
|
+
if (isOutsideRoot(relative(pkg.directory, source)))
|
|
238
|
+
declaredSources.add(source);
|
|
278
239
|
}
|
|
279
240
|
}
|
|
280
241
|
const inputPath = (absolutePath) => {
|
|
281
|
-
const cargoRelative = relative(
|
|
242
|
+
const cargoRelative = relative(cargoRoot, absolutePath).split(sep).join('/');
|
|
282
243
|
return isOutsideRoot(cargoRelative)
|
|
283
|
-
? posix.join('{workspaceRoot}', relative(
|
|
244
|
+
? posix.join('{workspaceRoot}', relative(nxRoot, absolutePath).split(sep).join('/'))
|
|
284
245
|
: posix.join(inputRoot, cargoRelative);
|
|
285
246
|
};
|
|
286
|
-
|
|
247
|
+
// Cargo.lock is not a fileset here: the runner names the crate's lock-scope
|
|
248
|
+
// node, the lock entries its closure reaches (cargo-closure-input.ts).
|
|
249
|
+
const inputs = new Set([`${inputRoot}/Cargo.toml`]);
|
|
287
250
|
const exclusions = new Set();
|
|
288
251
|
for (const dir of [...dirs].sort()) {
|
|
289
|
-
const absoluteDir = resolve(
|
|
252
|
+
const absoluteDir = resolve(cargoRoot, dir);
|
|
290
253
|
// Cargo packages can compile include_bytes!, headers, schemas and build.rs,
|
|
291
254
|
// not only Rust sources. Nested packages are separate source owners.
|
|
292
255
|
inputs.add(`${inputPath(absoluteDir)}/**/*`);
|
|
293
256
|
for (const child of nestedCrateDirs(absoluteDir, cache)) {
|
|
294
|
-
const childDir = relative(
|
|
257
|
+
const childDir = relative(cargoRoot, child).split(sep).join('/');
|
|
295
258
|
if (!dirs.has(childDir))
|
|
296
259
|
exclusions.add(`!${inputPath(child)}/**`);
|
|
297
260
|
}
|
|
@@ -304,7 +267,7 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
|
|
|
304
267
|
}
|
|
305
268
|
}
|
|
306
269
|
for (const source of [...declaredSources].sort()) {
|
|
307
|
-
const sourceRelative = relative(
|
|
270
|
+
const sourceRelative = relative(nxRoot, source);
|
|
308
271
|
if (isOutsideRoot(sourceRelative)) {
|
|
309
272
|
external.set(source, source);
|
|
310
273
|
}
|
|
@@ -314,7 +277,7 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
|
|
|
314
277
|
}
|
|
315
278
|
// Cargo/rustup search from the command's working directory upwards. Do not
|
|
316
279
|
// hash unrelated descendant configuration or generated Cargo target caches.
|
|
317
|
-
for (let current =
|
|
280
|
+
for (let current = cargoRoot;; current = dirname(current)) {
|
|
318
281
|
for (const config of [
|
|
319
282
|
'.cargo/config',
|
|
320
283
|
'.cargo/config.toml',
|
|
@@ -332,14 +295,14 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
|
|
|
332
295
|
const cargoConfig = await loadManifest(configPath);
|
|
333
296
|
if (isRecord(cargoConfig.build) && typeof cargoConfig.build['target-dir'] === 'string') {
|
|
334
297
|
const targetDir = resolve(current, cargoConfig.build['target-dir']);
|
|
335
|
-
if (!isOutsideRoot(relative(
|
|
298
|
+
if (!isOutsideRoot(relative(nxRoot, targetDir))) {
|
|
336
299
|
exclusions.add(`!${inputPath(targetDir)}/**`);
|
|
337
300
|
}
|
|
338
301
|
}
|
|
339
302
|
}
|
|
340
303
|
}
|
|
341
304
|
}
|
|
342
|
-
if (current ===
|
|
305
|
+
if (current === nxRoot || dirname(current) === current)
|
|
343
306
|
break;
|
|
344
307
|
}
|
|
345
308
|
inputs.add(`${inputRoot}/.config/nextest.toml`);
|
|
@@ -353,19 +316,27 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
|
|
|
353
316
|
// Arbitrary build-script reads outside package trees, custom output trees,
|
|
354
317
|
// and ambient tools/environment require explicit target or named inputs.
|
|
355
318
|
if (external.size > 0) {
|
|
356
|
-
|
|
357
|
-
const listed = [...external]
|
|
358
|
-
.sort(([left], [right]) => left.localeCompare(right))
|
|
359
|
-
.map(([name, dir]) => `${name} -> ${dir}`)
|
|
360
|
-
.join(', ');
|
|
361
|
-
throw new Error(`${memberDir}/Cargo.toml references inputs outside the Nx workspace (${listed}) that no fileset can hash; ` +
|
|
362
|
-
`declare namedInputs.${EXTERNAL_RUST_CRATES_INPUT} in ${join(workspaceRoot, 'nx.json')} ` +
|
|
363
|
-
'with runtime inputs that hash those external sources and configuration');
|
|
364
|
-
}
|
|
319
|
+
requireExternalRustCratesInput(workspaceRoot, `${memberDir}/Cargo.toml`, external);
|
|
365
320
|
inputs.add(EXTERNAL_RUST_CRATES_INPUT);
|
|
366
321
|
}
|
|
367
322
|
return [...inputs];
|
|
368
323
|
}
|
|
324
|
+
/**
|
|
325
|
+
* Refuses inputs outside the Nx workspace that `nx.json` gives no `externalRustCrates` runtime hash for: no fileset
|
|
326
|
+
* can hash them, and a key without them would replay a verdict across their edits. `external` maps each input's name
|
|
327
|
+
* to its path.
|
|
328
|
+
*/
|
|
329
|
+
export function requireExternalRustCratesInput(workspaceRoot, manifest, external) {
|
|
330
|
+
if (readNxJson(workspaceRoot).namedInputs?.[EXTERNAL_RUST_CRATES_INPUT] !== undefined)
|
|
331
|
+
return;
|
|
332
|
+
const listed = [...external]
|
|
333
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
334
|
+
.map(([name, dir]) => `${name} -> ${dir}`)
|
|
335
|
+
.join(', ');
|
|
336
|
+
throw new Error(`${manifest} references inputs outside the Nx workspace (${listed}) that no fileset can hash; ` +
|
|
337
|
+
`declare namedInputs.${EXTERNAL_RUST_CRATES_INPUT} in ${join(workspaceRoot, 'nx.json')} ` +
|
|
338
|
+
'with runtime inputs that hash those external sources and configuration');
|
|
339
|
+
}
|
|
369
340
|
/** Every directory beneath `root` that holds its own `Cargo.toml`, the walk stopping at each. */
|
|
370
341
|
function nestedCrateDirs(root, cache) {
|
|
371
342
|
const cached = cache.nestedCrateDirs.get(root);
|
|
@@ -476,7 +447,9 @@ function isRecord(value) {
|
|
|
476
447
|
* exact partition of whatever the crate currently contains.
|
|
477
448
|
*
|
|
478
449
|
* It is declared rather than inferred because the only honest input is how long
|
|
479
|
-
* the suite takes, which target inference cannot measure.
|
|
450
|
+
* the suite takes, which target inference cannot measure. Measured time places a
|
|
451
|
+
* crate's slow tests instead of the hash once `.config/nextest-timings.json` names
|
|
452
|
+
* them (nextest-timings.ts). Defaulting to 1 keeps
|
|
480
453
|
* small crates on a single target without paying another Cargo freshness check.
|
|
481
454
|
*/
|
|
482
455
|
function readTestShards(cratePackage, crateTomlPath) {
|
|
@@ -498,8 +471,6 @@ function readTestShards(cratePackage, crateTomlPath) {
|
|
|
498
471
|
* same string, and a drifted copy would make the policy vacuous.
|
|
499
472
|
*/
|
|
500
473
|
export const CARGO_TEST_TARGET = 'cargo-test';
|
|
501
|
-
/** Prerequisite that compiles the workspace; not a per-crate runner. */
|
|
502
|
-
export const CARGO_TEST_COMPILE_TARGET = 'cargo-test-compile';
|
|
503
474
|
/**
|
|
504
475
|
* The one workspace-wide `cargo nextest archive` every per-crate runner
|
|
505
476
|
* executes from. Named here beside the other cargo target names so the policy
|
|
@@ -616,7 +587,6 @@ export function cargoTestGroupTargetName(group) {
|
|
|
616
587
|
*/
|
|
617
588
|
export function packageNameFromCargoTestTarget(targetName) {
|
|
618
589
|
if (!targetName.startsWith('cargo-test-') ||
|
|
619
|
-
targetName === CARGO_TEST_COMPILE_TARGET ||
|
|
620
590
|
targetName === CARGO_TEST_ARCHIVE_TARGET ||
|
|
621
591
|
targetName.startsWith(CARGO_TEST_GROUP_PREFIX)) {
|
|
622
592
|
return null;
|
|
@@ -927,7 +897,7 @@ export const PLUGIN_NEXTEST_CONFIG_PATH = 'node_modules/@smoothbricks/nx-plugin/
|
|
|
927
897
|
* contain spaces.
|
|
928
898
|
*
|
|
929
899
|
* The file is named through the workspace root's `node_modules` link, as
|
|
930
|
-
*
|
|
900
|
+
* tool package CLIs are (tool-bins.ts), never through where the plugin really lives: a
|
|
931
901
|
* plugin linked from a checkout outside the workspace sits a different number
|
|
932
902
|
* of `../` away from each workspace depending on how deep that workspace is,
|
|
933
903
|
* and that count re-keyed every target of every Cargo project — and every
|
|
@@ -144,15 +144,15 @@ export declare const CARGO_DENY_WARNINGS = "--config 'build.warnings=\"deny\"'";
|
|
|
144
144
|
*/
|
|
145
145
|
export declare const CARGO_CROSS_LINT_COMMAND = "command -v cargo-zigbuild >/dev/null || { echo 'cargo-lint-cross needs cargo-zigbuild from the linux-cross toolchain; run: 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
146
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
147
|
+
* `target/cargo-lint`: clippy writes a directory of its own, as the cross lint
|
|
148
|
+
* does. Cargo flocks one build directory per invocation, and a workspace-wide
|
|
149
|
+
* check is the longest Cargo invocation in a gate, so in the dev build's
|
|
150
|
+
* `target/` it would queue the test archive and every dev build behind its lock.
|
|
151
|
+
* The price is that clippy compiles its own host units (build scripts,
|
|
152
|
+
* proc-macros) once per directory; cargo retention passes it as a nested root of
|
|
153
|
+
* the target directory, reclaiming its superseded generations but not its
|
|
154
|
+
* `incremental/`. A plain `cargo clippy --workspace --all-targets
|
|
155
|
+
* --target-dir target/cargo-lint` checks exactly these units.
|
|
156
156
|
*/
|
|
157
157
|
export declare const CARGO_LINT_CLIPPY_COMMAND: string;
|
|
158
158
|
/** Root `package.json` script name, in the repo's `verb:qualifier` style. */
|
|
@@ -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;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,mGAC6D,CAAC;AAInG;;;;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,k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AC7E,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B,2EAAiG,CAAC;AAEzI;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
@@ -158,17 +158,17 @@ export const CARGO_DENY_WARNINGS = `--config 'build.warnings="deny"'`;
|
|
|
158
158
|
*/
|
|
159
159
|
export const CARGO_CROSS_LINT_COMMAND = `${CARGO_CROSS_LINT_GUARD}; ${CARGO_ZIGBUILD_CLIPPY_FROZEN_PREFIX}--workspace --all-targets --target ${CARGO_LINUX_TRIPLE} --target-dir target/cargo-lint-cross ${CARGO_DENY_WARNINGS}`;
|
|
160
160
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*/
|
|
171
|
-
export const CARGO_LINT_CLIPPY_COMMAND = cargoFrozen(`clippy --workspace --all-targets ${CARGO_DENY_WARNINGS}`);
|
|
161
|
+
* `target/cargo-lint`: clippy writes a directory of its own, as the cross lint
|
|
162
|
+
* does. Cargo flocks one build directory per invocation, and a workspace-wide
|
|
163
|
+
* check is the longest Cargo invocation in a gate, so in the dev build's
|
|
164
|
+
* `target/` it would queue the test archive and every dev build behind its lock.
|
|
165
|
+
* The price is that clippy compiles its own host units (build scripts,
|
|
166
|
+
* proc-macros) once per directory; cargo retention passes it as a nested root of
|
|
167
|
+
* the target directory, reclaiming its superseded generations but not its
|
|
168
|
+
* `incremental/`. A plain `cargo clippy --workspace --all-targets
|
|
169
|
+
* --target-dir target/cargo-lint` checks exactly these units.
|
|
170
|
+
*/
|
|
171
|
+
export const CARGO_LINT_CLIPPY_COMMAND = cargoFrozen(`clippy --workspace --all-targets --target-dir target/cargo-lint ${CARGO_DENY_WARNINGS}`);
|
|
172
172
|
/** Root `package.json` script name, in the repo's `verb:qualifier` style. */
|
|
173
173
|
export const CROSS_CHECK_SCRIPT_NAME = 'check:linux';
|
|
174
174
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disk-command-policy.d.ts","sourceRoot":"","sources":["../src/disk-command-policy.ts"],"names":[],"mappings":"AAKA,0GAA0G;AAC1G,eAAO,MAAM,mBAAmB,+EAA+E,CAAC;AAEhH,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,EAAE,CA8CtE;AAED,kGAAkG;AAClG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"disk-command-policy.d.ts","sourceRoot":"","sources":["../src/disk-command-policy.ts"],"names":[],"mappings":"AAKA,0GAA0G;AAC1G,eAAO,MAAM,mBAAmB,+EAA+E,CAAC;AAEhH,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,EAAE,CA8CtE;AAED,kGAAkG;AAClG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAsC/D"}
|
|
@@ -47,6 +47,7 @@ export function directDiskCommands(source, path = '') {
|
|
|
47
47
|
}
|
|
48
48
|
/** Scan tracked code, tests and scripts, never build output, prose or recorded benchmark data. */
|
|
49
49
|
export function checkDiskCommandBoundary(root) {
|
|
50
|
+
// eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: a local git file listing whose length is its own read of this repository: it asks no remote, and a held index.lock fails it at once rather than waiting, so only the operator's interrupt ends a hung one
|
|
50
51
|
const files = execFileSync('git', ['ls-files', '-z', '--cached', '--others', '--exclude-standard'], {
|
|
51
52
|
cwd: root,
|
|
52
53
|
encoding: 'utf8',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Task } from 'nx/src/config/task-graph';
|
|
2
2
|
import type { expandOutputs, HashInputs } from 'nx/src/native';
|
|
3
3
|
import type { EnsureBuiltOutputReceipt, EnsureBuiltProbeFailure, EnsureBuiltProducerFileInput, EnsureBuiltProducerReceipt, EnsureBuiltReceipt } from './ensure-built.js';
|
|
4
|
-
import { type NodeWitness, type StampFields } from './ensure-built-witness.js';
|
|
4
|
+
import { type CensusRead, type NodeWitness, type StampFields } from './ensure-built-witness.js';
|
|
5
5
|
export type ReceiptEvidence<T> = {
|
|
6
6
|
readonly ok: true;
|
|
7
7
|
readonly value: T;
|
|
@@ -39,14 +39,22 @@ export declare function receiptGit(root: string, args: string[]): ReceiptEvidenc
|
|
|
39
39
|
export declare function dirtyProviderPaths(status: string): string[];
|
|
40
40
|
/**
|
|
41
41
|
* One independently read node; absolute paths also serve tool/package closures. A census records the node's stamp as
|
|
42
|
-
* of its `start` (recordedStamp); a re-read against a record records none.
|
|
42
|
+
* of its `start` (recordedStamp); a re-read against a record records none. `known` is what a census of the same capture
|
|
43
|
+
* already read of the node ({@link CensusRead}): its stat, listing and start stand for this read, so a capture stats a
|
|
44
|
+
* node once; the stability check after execution reads it again.
|
|
43
45
|
*/
|
|
44
46
|
export declare function receiptNode(path: string, name: string, census?: {
|
|
45
47
|
readonly start: bigint;
|
|
46
48
|
readonly observed: NodeWitness[];
|
|
47
|
-
}, recorded?: (path: string, stats: StampFields) => string | undefined): EnsureBuiltOutputReceipt;
|
|
48
|
-
/**
|
|
49
|
+
}, recorded?: (path: string, stats: StampFields) => string | undefined, known?: CensusRead): EnsureBuiltOutputReceipt;
|
|
50
|
+
/**
|
|
51
|
+
* Capture every tracked source byte at pre. Unrelated untracked files are not source basis. A tracked public output is
|
|
52
|
+
* source while it holds HEAD's bytes, so a later task can read it as a FILE input; one that differs from HEAD is the
|
|
53
|
+
* run's to write, and no input binds to it.
|
|
54
|
+
*/
|
|
49
55
|
export declare function captureProducerSource(root: string, outputs: readonly string[]): ReceiptEvidence<ProducerSourceWitness>;
|
|
56
|
+
/** Share Git and tracked-byte acquisition, never one target's output exemption with another. */
|
|
57
|
+
export declare function captureProducerSources(root: string, targets: ReadonlyMap<string, readonly string[]>): ReceiptEvidence<ReadonlyMap<string, ProducerSourceWitness>>;
|
|
50
58
|
export declare function producerSourceUnchanged(root: string, before: ProducerSourceWitness): ReceiptEvidence<true>;
|
|
51
59
|
/** Enumerate exact public nodes; never exempt a broad directory of tracked source. */
|
|
52
60
|
export declare function producerOutputPaths(root: string, tasks: readonly Task[], expand: typeof expandOutputs): string[];
|
|
@@ -54,6 +62,6 @@ export declare function providerReceipt(root: string, taskId: string, tasks: rea
|
|
|
54
62
|
readonly disposition: 'hit';
|
|
55
63
|
readonly receipt: EnsureBuiltReceipt;
|
|
56
64
|
} | EnsureBuiltProbeFailure;
|
|
57
|
-
/** Admit only
|
|
65
|
+
/** Admit only the recipes emitted by the owning generator: the version recipes, the declared-programs one, and declared toolchain pins. */
|
|
58
66
|
export declare function boundedReceiptRuntimes(inputs: Readonly<Record<string, HashInputs>>, directories: readonly string[], files: readonly string[], installationProved: boolean): ProviderInputProof['runtimeSource'];
|
|
59
67
|
//# sourceMappingURL=ensure-built-receipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-built-receipt.d.ts","sourceRoot":"","sources":["../src/ensure-built-receipt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ensure-built-receipt.d.ts","sourceRoot":"","sources":["../src/ensure-built-receipt.ts"],"names":[],"mapp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