@smoothbricks/nx-plugin 0.5.7 → 0.6.1
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 +1097 -360
- package/dist/.build-inputs.json +141 -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 +22 -5
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +168 -48
- 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/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-thread.d.ts +28 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.js +20 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts +35 -38
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool.js +56 -120
- 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 +389 -239
- package/dist/executors/bounded-exec/gateway-lease.d.ts +23 -19
- package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
- package/dist/executors/bounded-exec/gateway-lease.js +102 -29
- 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 +64 -0
- package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
- package/dist/executors/bounded-exec/lease-wait.js +72 -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/mbx-pool.d.ts +31 -0
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -0
- package/dist/executors/bounded-exec/mbx-pool.js +24 -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 +10 -4
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/run-cpu-pool.js +122 -35
- 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 +48 -11
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +89 -20
- 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/emit-overrides.d.ts +14 -0
- package/dist/executors/typescript-emit/emit-overrides.d.ts.map +1 -0
- package/dist/executors/typescript-emit/emit-overrides.js +24 -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 +146 -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 +672 -214
- 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/managed-files/publish-workflow.js +14 -11
- 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 +514 -47
- 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 +16 -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 +95 -14
- 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 +173 -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/bounded-exec/bounds.ts +76 -0
- package/src/executors/bounded-exec/cpu-pool-thread.ts +43 -0
- package/src/executors/bounded-exec/cpu-pool.ts +55 -120
- package/src/executors/bounded-exec/executor.ts +442 -260
- package/src/executors/bounded-exec/gateway-lease.ts +94 -35
- package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
- package/src/executors/bounded-exec/lease-wait.ts +116 -0
- package/src/executors/bounded-exec/lock-wait.ts +141 -0
- package/src/executors/bounded-exec/mbx-pool.ts +48 -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 +129 -35
- 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 +145 -35
- 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/emit-overrides.ts +24 -0
- package/src/executors/typescript-emit/executor.ts +186 -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 +788 -224
- 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/managed-files/publish-workflow.ts +20 -15
- 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 +92 -41
- 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 +124 -99
- 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/all-verdicts/executor.test.ts +0 -135
- 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 -3321
- 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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { accessSync, constants, readFileSync, statSync } from 'node:fs';
|
|
3
|
+
import { delimiter, join, resolve } from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
5
|
+
/**
|
|
6
|
+
* A leg that runs `bun` runs the Bun its workspace declares.
|
|
7
|
+
*
|
|
8
|
+
* The root `package.json` names that Bun in `packageManager` (`bun@1.4.3`); the Bun the command gets is the first `bun`
|
|
9
|
+
* on the PATH it runs with. When the two disagree the leg is refused before it asks for anything, naming both versions
|
|
10
|
+
* and the binary. A Bun other than the declared one does not fail at startup: on Bun 1.4.2 `console.log` drops what a
|
|
11
|
+
* full pipe refuses, so a child's JSON document reaches the parent that reads it cut in the middle of a string, the
|
|
12
|
+
* child exits 0, and the leg fails three layers from the cause as `JSON Parse error: Unterminated string`. The refusal
|
|
13
|
+
* is that mismatch, said where it happens.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* `bun --version` answers in milliseconds. The bound is for a `bun` that never answers (a wrapper waiting on a lock):
|
|
17
|
+
* it refuses the leg, which would otherwise hang before its own bounds start.
|
|
18
|
+
*/
|
|
19
|
+
const VERSION_DEADLINE_MS = 120_000;
|
|
20
|
+
/**
|
|
21
|
+
* A word `bun` that the shell resolves through PATH, in command position or in a string a wrapper runs: `bun test`,
|
|
22
|
+
* `cd x && bun run y`, `FOO=1 bun a`, `sh -c 'bun test'`. A path-qualified `../runtime/bun` names its binary itself,
|
|
23
|
+
* so PATH decides nothing for it; `bunx`, `bun-runtime` and `bun.js` are other words.
|
|
24
|
+
*/
|
|
25
|
+
const BUN_COMMAND = /(?<=^|[\s;&|()'"`])bun(?=$|[\s;&|()'"`])/;
|
|
26
|
+
/** `bun@<version>` as corepack spells `packageManager`, with the content hash it may add after `+`. */
|
|
27
|
+
const BUN_DECLARATION = /^bun@(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)(?:\+.+)?$/;
|
|
28
|
+
const execFileAsync = promisify(execFile);
|
|
29
|
+
/** Whether `command` names `bun` for the shell to find on PATH: the legs this guard is for. */
|
|
30
|
+
export function runsBun(command) {
|
|
31
|
+
return BUN_COMMAND.test(command);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The first executable regular file `name` on `pathValue`, as the shell the command runs under finds it. An empty entry
|
|
35
|
+
* is the working directory, like `.`: the command starts in `cwd`, which is not the executor's.
|
|
36
|
+
*/
|
|
37
|
+
export function resolveOnPath(name, pathValue, cwd) {
|
|
38
|
+
for (const entry of (pathValue ?? '').split(delimiter)) {
|
|
39
|
+
const candidate = resolve(cwd, entry === '' ? '.' : entry, name);
|
|
40
|
+
try {
|
|
41
|
+
if (!statSync(candidate).isFile()) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
accessSync(candidate, constants.X_OK);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
return candidate;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The Bun the workspace declares, `null` when it declares none: no manifest, no `packageManager`, or another package
|
|
55
|
+
* manager's. A `packageManager` that names `bun` and no version is refused, not read as no declaration: it says a Bun
|
|
56
|
+
* is declared, and a guard that skipped it would be silent exactly where the declaration is wrong.
|
|
57
|
+
*/
|
|
58
|
+
export function declaredBun(root) {
|
|
59
|
+
const manifest = join(root, 'package.json');
|
|
60
|
+
let parsed;
|
|
61
|
+
try {
|
|
62
|
+
parsed = JSON.parse(readFileSync(manifest, 'utf8'));
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
66
|
+
return { ok: true, value: null };
|
|
67
|
+
}
|
|
68
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
69
|
+
return { ok: false, error: { code: 'unreadable-manifest', manifest, reason } };
|
|
70
|
+
}
|
|
71
|
+
const declaration = typeof parsed === 'object' && parsed !== null && 'packageManager' in parsed ? parsed.packageManager : undefined;
|
|
72
|
+
if (typeof declaration !== 'string' || !declaration.startsWith('bun@')) {
|
|
73
|
+
return { ok: true, value: null };
|
|
74
|
+
}
|
|
75
|
+
const version = BUN_DECLARATION.exec(declaration)?.[1];
|
|
76
|
+
if (version === undefined) {
|
|
77
|
+
return { ok: false, error: { code: 'malformed-declaration', manifest, declaration } };
|
|
78
|
+
}
|
|
79
|
+
return { ok: true, value: { manifest, declaration, version } };
|
|
80
|
+
}
|
|
81
|
+
/** The version `bun --version` prints in the command's own environment, which is what a wrapper reads to route. */
|
|
82
|
+
export const probeBunVersion = async (bun, env, cwd) => {
|
|
83
|
+
try {
|
|
84
|
+
const { stdout } = await execFileAsync(bun, ['--version'], {
|
|
85
|
+
env,
|
|
86
|
+
cwd,
|
|
87
|
+
encoding: 'utf8',
|
|
88
|
+
timeout: VERSION_DEADLINE_MS,
|
|
89
|
+
killSignal: 'SIGKILL',
|
|
90
|
+
maxBuffer: 64 * 1024,
|
|
91
|
+
});
|
|
92
|
+
return { ok: true, value: stdout.trim() };
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (error instanceof Error && 'killed' in error && error.killed === true) {
|
|
96
|
+
return { ok: false, error: `\`bun --version\` gave no answer within ${VERSION_DEADLINE_MS} ms` };
|
|
97
|
+
}
|
|
98
|
+
const said = error instanceof Error && 'stderr' in error && typeof error.stderr === 'string' ? error.stderr.trim() : '';
|
|
99
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
100
|
+
return { ok: false, error: `\`bun --version\` failed: ${reason}${said === '' ? '' : `: ${said}`}` };
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* The refusal that keeps a leg off a Bun its workspace does not declare, or `null` when the leg may run: it names no
|
|
105
|
+
* `bun`, the workspace declares none, PATH finds none (the shell will say so), or the one it finds is the declared
|
|
106
|
+
* version. Not checked on Windows, where the executor starts no lifecycle supervisor either.
|
|
107
|
+
*/
|
|
108
|
+
export async function checkRuntimePin(check, probe = probeBunVersion) {
|
|
109
|
+
if (process.platform === 'win32' || !runsBun(check.command)) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
const declared = declaredBun(check.root);
|
|
113
|
+
if (!declared.ok) {
|
|
114
|
+
return declared.error;
|
|
115
|
+
}
|
|
116
|
+
if (declared.value === null) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const bun = resolveOnPath('bun', check.env.PATH, check.cwd);
|
|
120
|
+
if (bun === null) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const printed = await probe(bun, check.env, check.cwd);
|
|
124
|
+
if (!printed.ok) {
|
|
125
|
+
return {
|
|
126
|
+
code: 'unreadable-version',
|
|
127
|
+
declared: declared.value,
|
|
128
|
+
bun,
|
|
129
|
+
reason: printed.error,
|
|
130
|
+
pathSource: check.pathSource,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return printed.value === declared.value.version
|
|
134
|
+
? null
|
|
135
|
+
: { code: 'mismatch', declared: declared.value, bun, version: printed.value, pathSource: check.pathSource };
|
|
136
|
+
}
|
|
137
|
+
/** What the symptom of running another Bun looks like, so a reader sees what the refusal replaces. */
|
|
138
|
+
const SYMPTOM = 'A leg on another Bun can pass its startup and fail far from the cause: on Bun 1.4.2 `console.log` drops what a ' +
|
|
139
|
+
"full pipe refuses, so a child's JSON reaches its parent cut mid-string while the child exits 0.";
|
|
140
|
+
/** The refusal as the run's stderr says it, one line per fact, naming the task when the run has one. */
|
|
141
|
+
export function describeRuntimePinRefusal(refusal, task) {
|
|
142
|
+
const refused = `${task ?? 'bounded-exec'}: refusing to run the command: `;
|
|
143
|
+
switch (refusal.code) {
|
|
144
|
+
case 'mismatch':
|
|
145
|
+
return `${[
|
|
146
|
+
`${refused}the workspace declares Bun ${refusal.declared.version}, and the \`bun\` it would run is Bun ${refusal.version}.`,
|
|
147
|
+
` declared by: packageManager "${refusal.declared.declaration}" in ${refusal.declared.manifest}`,
|
|
148
|
+
` resolved by: PATH from ${refusal.pathSource}; its first \`bun\` is ${refusal.bun}, which prints ${refusal.version}`,
|
|
149
|
+
SYMPTOM,
|
|
150
|
+
"Run the leg from the workspace's own shell, or put the declared Bun first on PATH.",
|
|
151
|
+
].join('\n')}\n`;
|
|
152
|
+
case 'unreadable-version':
|
|
153
|
+
return `${[
|
|
154
|
+
`${refused}the workspace declares Bun ${refusal.declared.version}, and the \`bun\` it would run did not say which Bun it is.`,
|
|
155
|
+
` declared by: packageManager "${refusal.declared.declaration}" in ${refusal.declared.manifest}`,
|
|
156
|
+
` resolved by: PATH from ${refusal.pathSource}; its first \`bun\` is ${refusal.bun}: ${refusal.reason}`,
|
|
157
|
+
SYMPTOM,
|
|
158
|
+
].join('\n')}\n`;
|
|
159
|
+
case 'malformed-declaration':
|
|
160
|
+
return `${[
|
|
161
|
+
`${refused}${refusal.manifest} declares packageManager "${refusal.declaration}", which names no Bun version to compare.`,
|
|
162
|
+
'Declare an exact version, `bun@<major>.<minor>.<patch>`.',
|
|
163
|
+
].join('\n')}\n`;
|
|
164
|
+
case 'unreadable-manifest':
|
|
165
|
+
return `${refused}cannot read the workspace's declaration in ${refusal.manifest}: ${refusal.reason}\n`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -28,9 +28,26 @@ export interface BoundedExecCommand {
|
|
|
28
28
|
*/
|
|
29
29
|
idleTimeoutMs?: number;
|
|
30
30
|
killAfterMs?: number;
|
|
31
|
+
/**
|
|
32
|
+
* A compiler-fixture producer for `command`: a shell command run first, in the same cwd, environment and CPU
|
|
33
|
+
* grant, whose whole life is a lifecycle build interval — the progress bound does not run during it, as it does
|
|
34
|
+
* not run during a `cargo test` build. Its failure fails the run; `command` starts only after it exits 0.
|
|
35
|
+
*
|
|
36
|
+
* It exists for warmth that lives outside Nx outputs (a compiler plugin cache, a Cargo target directory). As a
|
|
37
|
+
* separate `cache: false` prerequisite that warmth was paid even when every consumer then hit the cache, since
|
|
38
|
+
* Nx reaches a cached consumer only after its uncached dependencies; as plain text at the head of `command`
|
|
39
|
+
* its cold minutes would spend the progress bound. Inside the consumer's own task the cache decides: a hit
|
|
40
|
+
* restores the verdict and warms nothing, an execution warms first.
|
|
41
|
+
*/
|
|
42
|
+
fixtureCommand?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The fixture segment's own wall-clock ceiling: a build budget, required with `fixtureCommand`. It bounds
|
|
45
|
+
* only the fixture interval, never the command it prepares.
|
|
46
|
+
*/
|
|
47
|
+
fixtureTimeoutMs?: number;
|
|
31
48
|
/**
|
|
32
49
|
* The most threads or processes the command runs at once, which is how many CPU tokens it asks
|
|
33
|
-
* its live parent pool
|
|
50
|
+
* its live parent pool for. Absent, the runner in the command decides:
|
|
34
51
|
* nextest and cargo one per core, `bun test --parallel=N` N, anything else one. The actual grant
|
|
35
52
|
* reaches the command as `BOUNDED_EXEC_CPU_TOKENS`, with its sub-pool in `BOUNDED_EXEC_CPU_POOL`.
|
|
36
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAExE,MAAM,MAAM,iBAAiB,GACzB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAExE,MAAM,MAAM,iBAAiB,GACzB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB"}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
import type { CpuWaitRow } from './lease-wait.js';
|
|
2
|
+
import { type LockWait } from './lock-wait.js';
|
|
1
3
|
/**
|
|
2
4
|
* Why one bounded run ended, recorded per Nx task so a caller can tell a load-sensitive bound
|
|
3
5
|
* from a real failure without reading the run's output.
|
|
4
6
|
*
|
|
7
|
+
|
|
5
8
|
* - `bound`: the run hit a wall-clock bound and nothing else failed. Either the command
|
|
6
|
-
* outlived `timeoutMs` (`total`),
|
|
9
|
+
* outlived `timeoutMs` (`total`), its fixture segment outlived `fixtureTimeoutMs`
|
|
10
|
+
* (`fixture`), or every failing test in the runner's report failed on
|
|
7
11
|
* its runner's per-test timeout (`test`). A loaded host produces exactly these.
|
|
8
12
|
* - `wedged`: `idleTimeoutMs` fired: no test finished for that long during a chargeable test interval. This proves
|
|
9
13
|
* the suite's completion bound was exceeded, not that every process stopped: an expensive active fixture can
|
|
10
14
|
* exceed it too. The verdict names tests reported running but never finished and tests the report says were
|
|
11
15
|
* aborted; diagnostics distinguish a stalled wait from a progressing but oversized lifecycle.
|
|
16
|
+
* When the snapshot named a lock wait, `lockWaits` names the file the run holds on a numbered descriptor and the
|
|
17
|
+
* processes outside the run that also hold it open: open-handle evidence, not a kernel lock owner.
|
|
12
18
|
* - `no-space`: the run failed and its output said a write found no space (ENOSPC). Whatever its tests then reported,
|
|
13
19
|
* they failed on the disk, not on their own: the verdict names the line that said so and, when the task held one,
|
|
14
20
|
* its RAM temp volume as it stood when that line arrived.
|
|
@@ -19,7 +25,7 @@ export type BoundedExecVerdict = {
|
|
|
19
25
|
readonly outcome: 'passed';
|
|
20
26
|
} | {
|
|
21
27
|
readonly outcome: 'bound';
|
|
22
|
-
readonly bound: 'total';
|
|
28
|
+
readonly bound: 'total' | 'fixture';
|
|
23
29
|
readonly limitMs: number;
|
|
24
30
|
readonly elapsedMs: number;
|
|
25
31
|
} | {
|
|
@@ -31,6 +37,8 @@ export type BoundedExecVerdict = {
|
|
|
31
37
|
readonly idleMs: number;
|
|
32
38
|
readonly elapsedMs: number;
|
|
33
39
|
readonly tests: readonly string[];
|
|
40
|
+
/** Lock waits the snapshot named: holder evidence (open handles), not a kernel lock owner. */
|
|
41
|
+
readonly lockWaits: readonly LockWait[];
|
|
34
42
|
} | ({
|
|
35
43
|
readonly outcome: 'no-space';
|
|
36
44
|
readonly exitCode: number;
|
|
@@ -40,13 +48,23 @@ export type BoundedExecVerdict = {
|
|
|
40
48
|
readonly exitCode: number;
|
|
41
49
|
readonly tests: readonly string[];
|
|
42
50
|
};
|
|
43
|
-
/**
|
|
44
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The task's RAM temp volume, read when a line saying ENOSPC arrived: the writer's own lease and the space left on the
|
|
53
|
+
* volume it was taken on (`measured`), or why there was none to measure: the lease was no longer on that volume
|
|
54
|
+
* (`lost`), or the volume could not be read (`unread`).
|
|
55
|
+
*/
|
|
56
|
+
export type TempVolumeSpace = {
|
|
57
|
+
readonly kind: 'measured';
|
|
45
58
|
readonly lease: string;
|
|
46
59
|
readonly mountpoint: string;
|
|
47
60
|
readonly capacityBytes: number;
|
|
48
61
|
readonly freeBytes: number;
|
|
49
|
-
}
|
|
62
|
+
} | {
|
|
63
|
+
readonly kind: 'lost' | 'unread';
|
|
64
|
+
readonly lease: string;
|
|
65
|
+
readonly mountpoint: string;
|
|
66
|
+
readonly detail: string;
|
|
67
|
+
};
|
|
50
68
|
/** The first output line that said a write found no space, and the task's RAM temp volume then; `null` without one. */
|
|
51
69
|
export interface NoSpaceSighting {
|
|
52
70
|
readonly line: string;
|
|
@@ -58,17 +76,21 @@ export interface BoundedExecRecord {
|
|
|
58
76
|
readonly hash: string | null;
|
|
59
77
|
readonly verdict: BoundedExecVerdict;
|
|
60
78
|
/**
|
|
61
|
-
* The
|
|
62
|
-
* how long it waited. Absent when it ran
|
|
63
|
-
* never read back.
|
|
79
|
+
* The parent CPU pool's grant the run started under: tokens granted of those asked for, and
|
|
80
|
+
* how long it waited for the pool. Absent when it ran ungranted; written for the reader of a slow
|
|
81
|
+
* run, never read back.
|
|
64
82
|
*/
|
|
65
83
|
readonly cpu?: {
|
|
66
84
|
readonly tokens: number;
|
|
67
85
|
readonly want: number;
|
|
68
86
|
readonly waitedMs: number;
|
|
69
|
-
/** Set when the tokens came from an ancestor's CPU pool, not the host budget; `waitedMs` is the wait for that pool. */
|
|
70
|
-
readonly inherited?: true;
|
|
71
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* The parent CPU pool's wait that expired and refused the run: its code, bound and elapsed time, the last heartbeat
|
|
90
|
+
* sequence it read, and the pool's socket and pid (specs/cowshed/05_gateway.md, "Deadlines"). Absent when no wait
|
|
91
|
+
* expired; written for the reader of a refused run, never read back.
|
|
92
|
+
*/
|
|
93
|
+
readonly cpuWait?: CpuWaitRow;
|
|
72
94
|
}
|
|
73
95
|
/** The Nx task a run executes as. Nx gives an executor no task id, only its parts. */
|
|
74
96
|
export interface BoundedExecTask {
|
|
@@ -91,8 +113,17 @@ export interface JunitFailures {
|
|
|
91
113
|
* Retry elements (`flakyFailure`, `rerunFailure`, ...) describe attempts, not the verdict.
|
|
92
114
|
*/
|
|
93
115
|
export declare function junitFailures(xml: string): JunitFailures;
|
|
116
|
+
/** One test case of a JUnit report: nextest's binary id (its `classname`), the test's name and its seconds. */
|
|
117
|
+
export interface JunitCaseTime {
|
|
118
|
+
readonly binary: string;
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly seconds: number;
|
|
121
|
+
}
|
|
122
|
+
/** Every test case of a JUnit document with the `time` it ran for; a case without one is not timed and not listed. */
|
|
123
|
+
export declare function junitCaseTimes(xml: string): JunitCaseTime[];
|
|
94
124
|
/**
|
|
95
|
-
* The bound that ended a run. `total` is a wall-clock ceiling: it answers "is this run unbounded?". `
|
|
125
|
+
* The bound that ended a run. `total` is a wall-clock ceiling: it answers "is this run unbounded?". `fixture` is
|
|
126
|
+
* that ceiling over the run's fixture segment alone: the command it prepares never started. `idle` is the
|
|
96
127
|
* no-progress bound: it answers "is this run hung?", and carries the tests the runner reported still running.
|
|
97
128
|
*
|
|
98
129
|
* These are different questions and one number cannot answer both. A ceiling tight enough to catch a hang promptly
|
|
@@ -102,6 +133,9 @@ export declare function junitFailures(xml: string): JunitFailures;
|
|
|
102
133
|
export type ExpiredBound = {
|
|
103
134
|
readonly kind: 'total';
|
|
104
135
|
readonly limitMs: number;
|
|
136
|
+
} | {
|
|
137
|
+
readonly kind: 'fixture';
|
|
138
|
+
readonly limitMs: number;
|
|
105
139
|
} | {
|
|
106
140
|
readonly kind: 'idle';
|
|
107
141
|
readonly limitMs: number;
|
|
@@ -116,6 +150,8 @@ export interface RunEnd {
|
|
|
116
150
|
readonly report: JunitFailures | null;
|
|
117
151
|
/** The first output line that said ENOSPC, or `null` when none did. */
|
|
118
152
|
readonly noSpace: NoSpaceSighting | null;
|
|
153
|
+
/** The lock waits the expiry's snapshot named; empty when none, or when that capture did not complete. */
|
|
154
|
+
readonly lockWaits: readonly LockWait[];
|
|
119
155
|
}
|
|
120
156
|
/**
|
|
121
157
|
* Judge a run. A run that failed after its output said ENOSPC failed on the disk: that is read first, ahead of the
|
|
@@ -158,6 +194,7 @@ export declare const GO_TEST: RegExp;
|
|
|
158
194
|
* that already chose bun's reporter, is returned unchanged and judged by its exit alone.
|
|
159
195
|
*/
|
|
160
196
|
export declare function withJunitReport(command: string, directory: string): Promise<string>;
|
|
197
|
+
export declare function shellQuote(value: string): string;
|
|
161
198
|
/** Remove a previous run's verdict and report, so neither can be read as this run's. */
|
|
162
199
|
export declare function clearTaskDirectory(directory: string): Promise<void>;
|
|
163
200
|
export declare function writeRecord(directory: string, record: BoundedExecRecord): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/verdict.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/verdict.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAmB,KAAK,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,GAC9B;IACE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,GACD;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;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BAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CA6BrG;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAyBnE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAgBjE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import { describeHolders } from './lock-wait.js';
|
|
3
4
|
/** The environment variable naming the absolute path a command writes its JUnit report to. */
|
|
4
5
|
export const JUNIT_REPORT_ENV = 'BOUNDED_EXEC_JUNIT';
|
|
5
6
|
/**
|
|
@@ -68,6 +69,21 @@ export function junitFailures(xml) {
|
|
|
68
69
|
close();
|
|
69
70
|
return { timedOut, cancelled, failed };
|
|
70
71
|
}
|
|
72
|
+
/** Every test case of a JUnit document with the `time` it ran for; a case without one is not timed and not listed. */
|
|
73
|
+
export function junitCaseTimes(xml) {
|
|
74
|
+
const text = xml.replace(/<!\[CDATA\[[\s\S]*?\]\]>/g, '').replace(/<!--[\s\S]*?-->/g, '');
|
|
75
|
+
const cases = [];
|
|
76
|
+
for (const [, attributes = ''] of text.matchAll(/<testcase\b((?:[^>"']|"[^"]*"|'[^']*')*?)\/?>/g)) {
|
|
77
|
+
const time = attribute(attributes, 'time');
|
|
78
|
+
const seconds = time === null ? Number.NaN : Number(time);
|
|
79
|
+
const name = attribute(attributes, 'name');
|
|
80
|
+
if (name === null || !Number.isFinite(seconds)) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
cases.push({ binary: attribute(attributes, 'classname') ?? '', name, seconds });
|
|
84
|
+
}
|
|
85
|
+
return cases;
|
|
86
|
+
}
|
|
71
87
|
function attribute(attributes, name) {
|
|
72
88
|
const match = new RegExp(`(?:^|\\s)${name}\\s*=\\s*("([^"]*)"|'([^']*)')`).exec(attributes);
|
|
73
89
|
if (match === null) {
|
|
@@ -108,7 +124,7 @@ export function judgeRun(run) {
|
|
|
108
124
|
}
|
|
109
125
|
if (run.expiry?.kind === 'idle') {
|
|
110
126
|
const tests = [...new Set([...run.expiry.tests, ...(run.report?.cancelled ?? [])])];
|
|
111
|
-
return { outcome: 'wedged', idleMs: run.expiry.limitMs, elapsedMs: run.elapsedMs, tests };
|
|
127
|
+
return { outcome: 'wedged', idleMs: run.expiry.limitMs, elapsedMs: run.elapsedMs, tests, lockWaits: run.lockWaits };
|
|
112
128
|
}
|
|
113
129
|
if (run.report !== null && run.report.failed.length > 0) {
|
|
114
130
|
return { outcome: 'failed', exitCode: run.exitCode, tests: run.report.failed };
|
|
@@ -116,8 +132,8 @@ export function judgeRun(run) {
|
|
|
116
132
|
// The tests the runner aborted when the ceiling's SIGTERM reached it are the bound's casualties: they are in the
|
|
117
133
|
// report as failures, but nothing about them failed. Aborted with no total bound to explain it, they are failures,
|
|
118
134
|
// whatever else the run shows: a zero exit or a per-test timeout does not excuse a test someone else stopped.
|
|
119
|
-
if (run.expiry?.kind === 'total') {
|
|
120
|
-
return { outcome: 'bound', bound:
|
|
135
|
+
if (run.expiry?.kind === 'total' || run.expiry?.kind === 'fixture') {
|
|
136
|
+
return { outcome: 'bound', bound: run.expiry.kind, limitMs: run.expiry.limitMs, elapsedMs: run.elapsedMs };
|
|
121
137
|
}
|
|
122
138
|
if (run.report !== null && run.report.cancelled.length > 0) {
|
|
123
139
|
return { outcome: 'failed', exitCode: run.exitCode, tests: run.report.cancelled };
|
|
@@ -183,7 +199,7 @@ export async function withJunitReport(command, directory) {
|
|
|
183
199
|
await writeFile(config, `[profile.default.junit]\npath = ${JSON.stringify(report)}\n`);
|
|
184
200
|
return command.replace(NEXTEST_RUN, () => `nextest run --tool-config-file ${shellQuote(`smoo-report:${config}`)}`);
|
|
185
201
|
}
|
|
186
|
-
function shellQuote(value) {
|
|
202
|
+
export function shellQuote(value) {
|
|
187
203
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
188
204
|
}
|
|
189
205
|
/** Remove a previous run's verdict and report, so neither can be read as this run's. */
|
|
@@ -241,18 +257,26 @@ function parseVerdict(value) {
|
|
|
241
257
|
case 'passed':
|
|
242
258
|
return { outcome: 'passed' };
|
|
243
259
|
case 'bound':
|
|
244
|
-
if (value.bound === 'total'
|
|
245
|
-
|
|
260
|
+
if ((value.bound === 'total' || value.bound === 'fixture') &&
|
|
261
|
+
typeof value.limitMs === 'number' &&
|
|
262
|
+
typeof value.elapsedMs === 'number') {
|
|
263
|
+
return { outcome: 'bound', bound: value.bound, limitMs: value.limitMs, elapsedMs: value.elapsedMs };
|
|
246
264
|
}
|
|
247
265
|
if (value.bound === 'test' && isStrings(value.tests)) {
|
|
248
266
|
return { outcome: 'bound', bound: 'test', tests: value.tests };
|
|
249
267
|
}
|
|
250
268
|
break;
|
|
251
|
-
case 'wedged':
|
|
252
|
-
|
|
253
|
-
|
|
269
|
+
case 'wedged': {
|
|
270
|
+
// A record written before lock waits were named carries none.
|
|
271
|
+
const lockWaits = value.lockWaits === undefined ? [] : parseLockWaits(value.lockWaits);
|
|
272
|
+
if (typeof value.idleMs === 'number' &&
|
|
273
|
+
typeof value.elapsedMs === 'number' &&
|
|
274
|
+
isStrings(value.tests) &&
|
|
275
|
+
lockWaits !== null) {
|
|
276
|
+
return { outcome: 'wedged', idleMs: value.idleMs, elapsedMs: value.elapsedMs, tests: value.tests, lockWaits };
|
|
254
277
|
}
|
|
255
278
|
break;
|
|
279
|
+
}
|
|
256
280
|
case 'no-space': {
|
|
257
281
|
const volume = parseTempVolumeSpace(value.volume);
|
|
258
282
|
if (typeof value.exitCode === 'number' && isStrings(value.tests) && typeof value.line === 'string' && volume) {
|
|
@@ -275,18 +299,51 @@ function parseVerdict(value) {
|
|
|
275
299
|
}
|
|
276
300
|
throw new Error(`not a bounded-exec verdict: ${JSON.stringify(value)}`);
|
|
277
301
|
}
|
|
302
|
+
/** A process id as the census writes it: a positive safe integer. */
|
|
303
|
+
function isPid(value) {
|
|
304
|
+
return typeof value === 'number' && Number.isSafeInteger(value) && value > 0;
|
|
305
|
+
}
|
|
306
|
+
function isPids(value) {
|
|
307
|
+
return Array.isArray(value) && value.every(isPid);
|
|
308
|
+
}
|
|
309
|
+
/** Lock waits as recorded, or `null` when any part of them is malformed. */
|
|
310
|
+
function parseLockWaits(value) {
|
|
311
|
+
if (!Array.isArray(value))
|
|
312
|
+
return null;
|
|
313
|
+
const waits = [];
|
|
314
|
+
for (const wait of value) {
|
|
315
|
+
if (!isObject(wait) || typeof wait.path !== 'string' || !isPids(wait.waiters) || !Array.isArray(wait.holders)) {
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
const holders = [];
|
|
319
|
+
for (const holder of wait.holders) {
|
|
320
|
+
if (!isObject(holder) || !isPid(holder.pid) || typeof holder.command !== 'string')
|
|
321
|
+
return null;
|
|
322
|
+
holders.push({ pid: holder.pid, command: holder.command });
|
|
323
|
+
}
|
|
324
|
+
waits.push({ path: wait.path, waiters: wait.waiters, holders });
|
|
325
|
+
}
|
|
326
|
+
return waits;
|
|
327
|
+
}
|
|
278
328
|
/** A recorded volume, wrapped so a well-formed `null` (no RAM volume) differs from a malformed one (`undefined`). */
|
|
279
329
|
function parseTempVolumeSpace(value) {
|
|
280
330
|
if (value === null) {
|
|
281
331
|
return { value: null };
|
|
282
332
|
}
|
|
283
|
-
if (isObject(value)
|
|
284
|
-
|
|
285
|
-
|
|
333
|
+
if (!isObject(value) || typeof value.lease !== 'string' || typeof value.mountpoint !== 'string') {
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
336
|
+
const { lease, mountpoint } = value;
|
|
337
|
+
// A record written before the kinds were named measured whatever filesystem held the mountpoint then.
|
|
338
|
+
if ((value.kind === 'measured' || value.kind === undefined) &&
|
|
286
339
|
typeof value.capacityBytes === 'number' &&
|
|
287
340
|
typeof value.freeBytes === 'number') {
|
|
288
|
-
|
|
289
|
-
|
|
341
|
+
return {
|
|
342
|
+
value: { kind: 'measured', lease, mountpoint, capacityBytes: value.capacityBytes, freeBytes: value.freeBytes },
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
if ((value.kind === 'lost' || value.kind === 'unread') && typeof value.detail === 'string') {
|
|
346
|
+
return { value: { kind: value.kind, lease, mountpoint, detail: value.detail } };
|
|
290
347
|
}
|
|
291
348
|
return undefined;
|
|
292
349
|
}
|
|
@@ -339,13 +396,17 @@ export function describeVerdict(verdict) {
|
|
|
339
396
|
case 'passed':
|
|
340
397
|
return 'passed';
|
|
341
398
|
case 'bound':
|
|
342
|
-
return verdict.bound === '
|
|
343
|
-
? `
|
|
344
|
-
:
|
|
399
|
+
return verdict.bound === 'test'
|
|
400
|
+
? `per-test timeout only: ${verdict.tests.join(', ')}`
|
|
401
|
+
: verdict.bound === 'fixture'
|
|
402
|
+
? `its fixture outlived its ${verdict.limitMs}ms bound (${verdict.elapsedMs}ms)`
|
|
403
|
+
: `outlived its ${verdict.limitMs}ms bound (${verdict.elapsedMs}ms)`;
|
|
345
404
|
case 'wedged':
|
|
346
405
|
return `wedged: no test finished for ${verdict.idleMs}ms after ${verdict.elapsedMs}ms; ${verdict.tests.length > 0
|
|
347
406
|
? `still running: ${verdict.tests.join(', ')}`
|
|
348
|
-
: 'the runner named no test still running'}
|
|
407
|
+
: 'the runner named no test still running'}${verdict.lockWaits
|
|
408
|
+
.map((wait) => `; waiting on a lock: ${wait.path} held open by ${describeHolders(wait.holders)}`)
|
|
409
|
+
.join('')}`;
|
|
349
410
|
case 'no-space':
|
|
350
411
|
return `${describeNoSpace(verdict)}${verdict.tests.length > 0 ? `; the tests that then failed: ${verdict.tests.join(', ')}` : ''}`;
|
|
351
412
|
case 'failed':
|
|
@@ -365,6 +426,14 @@ export function describeNoSpace(sighting) {
|
|
|
365
426
|
if (volume === null) {
|
|
366
427
|
return `${said}; it held no RAM temp volume, so the full disk is the one that line's writer wrote to`;
|
|
367
428
|
}
|
|
368
|
-
|
|
369
|
-
|
|
429
|
+
switch (volume.kind) {
|
|
430
|
+
case 'measured': {
|
|
431
|
+
const mib = (bytes) => (bytes / (1024 * 1024)).toFixed(1);
|
|
432
|
+
return `${said}; its TMPDIR ${volume.lease} is on the RAM temp volume ${volume.mountpoint}, which had ${mib(volume.freeBytes)} MiB free of ${mib(volume.capacityBytes)} MiB when that line arrived`;
|
|
433
|
+
}
|
|
434
|
+
case 'lost':
|
|
435
|
+
return `${said}; its TMPDIR ${volume.lease} was no longer on the RAM temp volume at ${volume.mountpoint} when that line arrived, so no free space of that volume was read: ${volume.detail}`;
|
|
436
|
+
case 'unread':
|
|
437
|
+
return `${said}; its TMPDIR ${volume.lease} is on the RAM temp volume ${volume.mountpoint}, whose space could not be read when that line arrived: ${volume.detail}`;
|
|
438
|
+
}
|
|
370
439
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type BuildInputProducer, type BuildInputRecord } from '@smoothbricks/build-inputs';
|
|
2
|
+
import { type Result } from '@smoothbricks/cargo-retain';
|
|
1
3
|
import type { CargoZigbuildOptions } from './schema.js';
|
|
2
4
|
interface CargoZigbuildContext {
|
|
3
5
|
root: string;
|
|
@@ -53,6 +55,25 @@ export declare function zigbuildEnv(env: NodeJS.ProcessEnv, target: string): Nod
|
|
|
53
55
|
* about anything else. `manifestPath` must be canonical, as cargo reports it.
|
|
54
56
|
*/
|
|
55
57
|
export declare function artifactFile(line: string, manifestPath: string, artifact: ZigbuildArtifact): string | null;
|
|
58
|
+
/**
|
|
59
|
+
* The dep-info file cargo uplifts beside an artifact, which lists every source rustc read for it: the artifact's file
|
|
60
|
+
* name with any extension replaced by `.d`. The static CLI `cowshed` has none (`cowshed.d`); the addon
|
|
61
|
+
* `libcowshed_napi.so` loses its `.so`.
|
|
62
|
+
*/
|
|
63
|
+
export declare function depInfoPath(built: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* The input record (build-inputs.ts) of the build that wrote `built`, or why none can be made: the record
|
|
66
|
+
* `smoo-nx-build-inputs` writes after a macOS build, from the dep-info beside the artifact, so one link check judges
|
|
67
|
+
* both. `cargoRoot` is the Cargo workspace root, whose manifest and lock the record names as well. `producer` is the
|
|
68
|
+
* Nx task running the build, which the executor reads from its environment.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildInputsOf(built: string, manifestPath: string, cargoRoot: string, producer?: BuildInputProducer): Result<BuildInputRecord, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Writes the artifact and its input record into the directory `output` is in, which the target declares as its Nx
|
|
73
|
+
* output (`{options.output}/../`), so a cache hit restores both. The artifact is copied then renamed, so the output
|
|
74
|
+
* path never holds a partial file, and the record follows it.
|
|
75
|
+
*/
|
|
76
|
+
export declare function publishArtifact(built: string, output: string, artifact: ZigbuildArtifact, inputs: BuildInputRecord): Promise<void>;
|
|
56
77
|
export default function cargoZigbuildExecutor(options: CargoZigbuildOptions, context: CargoZigbuildContext): Promise<{
|
|
57
78
|
success: boolean;
|
|
58
79
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/cargo-zigbuild/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/cargo-zigbuild/executor.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAKtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAA0C,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGjG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAA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