@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.
Files changed (440) hide show
  1. package/README.md +1095 -360
  2. package/dist/.build-inputs.json +138 -0
  3. package/dist/bin/smoo-nx-cargo-toolchain.d.ts +3 -0
  4. package/dist/bin/smoo-nx-cargo-toolchain.d.ts.map +1 -0
  5. package/dist/bin/smoo-nx-cargo-toolchain.js +8 -0
  6. package/dist/bin/smoo-nx-forbidden-spellings.d.ts +3 -0
  7. package/dist/bin/smoo-nx-forbidden-spellings.d.ts.map +1 -0
  8. package/dist/bin/smoo-nx-forbidden-spellings.js +32 -0
  9. package/dist/bin/smoo-nx-nextest-timings.d.ts +3 -0
  10. package/dist/bin/smoo-nx-nextest-timings.d.ts.map +1 -0
  11. package/dist/bin/smoo-nx-nextest-timings.js +28 -0
  12. package/dist/bounded-test-policy.d.ts +1 -1
  13. package/dist/bounded-test-policy.d.ts.map +1 -1
  14. package/dist/bounded-test-policy.js +14 -15
  15. package/dist/build-state-output-policy.d.ts +95 -1
  16. package/dist/build-state-output-policy.d.ts.map +1 -1
  17. package/dist/build-state-output-policy.js +368 -30
  18. package/dist/bun-lock-scope.d.ts +44 -0
  19. package/dist/bun-lock-scope.d.ts.map +1 -0
  20. package/dist/bun-lock-scope.js +97 -0
  21. package/dist/cargo-build-script-env.d.ts +49 -0
  22. package/dist/cargo-build-script-env.d.ts.map +1 -0
  23. package/dist/cargo-build-script-env.js +324 -0
  24. package/dist/cargo-closure-input.d.ts +31 -4
  25. package/dist/cargo-closure-input.d.ts.map +1 -1
  26. package/dist/cargo-closure-input.js +66 -6
  27. package/dist/cargo-retention-hook.d.ts +17 -0
  28. package/dist/cargo-retention-hook.d.ts.map +1 -0
  29. package/dist/cargo-retention-hook.js +85 -0
  30. package/dist/cargo-source-hash.d.ts +25 -7
  31. package/dist/cargo-source-hash.d.ts.map +1 -1
  32. package/dist/cargo-source-hash.js +108 -43
  33. package/dist/cargo-toolchain-paths.d.ts +40 -0
  34. package/dist/cargo-toolchain-paths.d.ts.map +1 -0
  35. package/dist/cargo-toolchain-paths.js +84 -0
  36. package/dist/cargo-toolchain-policy.d.ts +25 -8
  37. package/dist/cargo-toolchain-policy.d.ts.map +1 -1
  38. package/dist/cargo-toolchain-policy.js +39 -5
  39. package/dist/cargo-workspace.d.ts +10 -4
  40. package/dist/cargo-workspace.d.ts.map +1 -1
  41. package/dist/cargo-workspace.js +65 -95
  42. package/dist/cross-check-policy.d.ts +9 -9
  43. package/dist/cross-check-policy.d.ts.map +1 -1
  44. package/dist/cross-check-policy.js +11 -11
  45. package/dist/disk-command-policy.d.ts.map +1 -1
  46. package/dist/disk-command-policy.js +1 -0
  47. package/dist/ensure-built-receipt.d.ts +13 -5
  48. package/dist/ensure-built-receipt.d.ts.map +1 -1
  49. package/dist/ensure-built-receipt.js +126 -47
  50. package/dist/ensure-built-witness.d.ts +27 -8
  51. package/dist/ensure-built-witness.d.ts.map +1 -1
  52. package/dist/ensure-built-witness.js +45 -15
  53. package/dist/ensure-built.d.ts.map +1 -1
  54. package/dist/ensure-built.js +9 -1
  55. package/dist/eslint-config-closure.d.ts +7 -0
  56. package/dist/eslint-config-closure.d.ts.map +1 -0
  57. package/dist/eslint-config-closure.js +346 -0
  58. package/dist/executors/all-verdicts/executor.d.ts +35 -0
  59. package/dist/executors/all-verdicts/executor.d.ts.map +1 -0
  60. package/dist/executors/all-verdicts/executor.js +133 -0
  61. package/dist/executors/all-verdicts/schema.d.ts +10 -0
  62. package/dist/executors/all-verdicts/schema.d.ts.map +1 -0
  63. package/dist/executors/all-verdicts/schema.js +2 -0
  64. package/dist/executors/bounded-exec/bounds.d.ts +56 -0
  65. package/dist/executors/bounded-exec/bounds.d.ts.map +1 -0
  66. package/dist/executors/bounded-exec/bounds.js +43 -0
  67. package/dist/executors/bounded-exec/cpu-pool.d.ts +33 -36
  68. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  69. package/dist/executors/bounded-exec/cpu-pool.js +54 -119
  70. package/dist/executors/bounded-exec/executor.d.ts +19 -12
  71. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  72. package/dist/executors/bounded-exec/executor.js +371 -239
  73. package/dist/executors/bounded-exec/gateway-lease.d.ts +22 -19
  74. package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
  75. package/dist/executors/bounded-exec/gateway-lease.js +81 -28
  76. package/dist/executors/bounded-exec/hang-diagnostics.d.ts +18 -1
  77. package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
  78. package/dist/executors/bounded-exec/hang-diagnostics.js +148 -30
  79. package/dist/executors/bounded-exec/lease-wait.d.ts +43 -0
  80. package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
  81. package/dist/executors/bounded-exec/lease-wait.js +68 -0
  82. package/dist/executors/bounded-exec/lock-wait.d.ts +51 -0
  83. package/dist/executors/bounded-exec/lock-wait.d.ts.map +1 -0
  84. package/dist/executors/bounded-exec/lock-wait.js +108 -0
  85. package/dist/executors/bounded-exec/owned-subtree.d.ts +84 -0
  86. package/dist/executors/bounded-exec/owned-subtree.d.ts.map +1 -0
  87. package/dist/executors/bounded-exec/owned-subtree.js +178 -0
  88. package/dist/executors/bounded-exec/progress.d.ts +4 -1
  89. package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
  90. package/dist/executors/bounded-exec/progress.js +5 -2
  91. package/dist/executors/bounded-exec/ram-attach.d.ts +19 -0
  92. package/dist/executors/bounded-exec/ram-attach.d.ts.map +1 -0
  93. package/dist/executors/bounded-exec/ram-attach.js +207 -0
  94. package/dist/executors/bounded-exec/ram-detach.d.ts +25 -0
  95. package/dist/executors/bounded-exec/ram-detach.d.ts.map +1 -0
  96. package/dist/executors/bounded-exec/ram-detach.js +207 -0
  97. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +76 -0
  98. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -1
  99. package/dist/executors/bounded-exec/ram-temp-fixtures.js +296 -0
  100. package/dist/executors/bounded-exec/ram-temp.d.ts +388 -88
  101. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
  102. package/dist/executors/bounded-exec/ram-temp.js +1213 -399
  103. package/dist/executors/bounded-exec/run-cpu-pool.d.ts +4 -4
  104. package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
  105. package/dist/executors/bounded-exec/run-cpu-pool.js +20 -30
  106. package/dist/executors/bounded-exec/runner-hook.js +14 -5
  107. package/dist/executors/bounded-exec/runner-lifecycle.d.ts +14 -1
  108. package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -1
  109. package/dist/executors/bounded-exec/runner-lifecycle.js +27 -6
  110. package/dist/executors/bounded-exec/{cpu-tokens.d.ts → runner-sizing.d.ts} +14 -42
  111. package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -0
  112. package/dist/executors/bounded-exec/{cpu-tokens.js → runner-sizing.js} +5 -35
  113. package/dist/executors/bounded-exec/runtime-pin.d.ts +73 -0
  114. package/dist/executors/bounded-exec/runtime-pin.d.ts.map +1 -0
  115. package/dist/executors/bounded-exec/runtime-pin.js +167 -0
  116. package/dist/executors/bounded-exec/schema.d.ts +18 -1
  117. package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
  118. package/dist/executors/bounded-exec/verdict.d.ts +40 -11
  119. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  120. package/dist/executors/bounded-exec/verdict.js +88 -19
  121. package/dist/executors/cargo-zigbuild/executor.d.ts +21 -0
  122. package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
  123. package/dist/executors/cargo-zigbuild/executor.js +67 -12
  124. package/dist/executors/clean-outputs/executor.js +1 -0
  125. package/dist/executors/scriptc-native/executor.d.ts +79 -0
  126. package/dist/executors/scriptc-native/executor.d.ts.map +1 -0
  127. package/dist/executors/scriptc-native/executor.js +367 -0
  128. package/dist/executors/scriptc-native/ffi-paths.d.ts +9 -0
  129. package/dist/executors/scriptc-native/ffi-paths.d.ts.map +1 -0
  130. package/dist/executors/scriptc-native/ffi-paths.js +25 -0
  131. package/dist/executors/scriptc-native/schema.d.ts +34 -0
  132. package/dist/executors/scriptc-native/schema.d.ts.map +1 -0
  133. package/dist/executors/scriptc-native/schema.js +1 -0
  134. package/dist/executors/typescript-emit/executor.d.ts +3 -1
  135. package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
  136. package/dist/executors/typescript-emit/executor.js +164 -33
  137. package/dist/forbidden-spelling-policy.d.ts +56 -0
  138. package/dist/forbidden-spelling-policy.d.ts.map +1 -0
  139. package/dist/forbidden-spelling-policy.js +176 -0
  140. package/dist/generators/create-package/generator.d.ts.map +1 -1
  141. package/dist/generators/create-package/generator.js +3 -4
  142. package/dist/graph-input-contract.d.ts +14 -0
  143. package/dist/graph-input-contract.d.ts.map +1 -1
  144. package/dist/graph-input-contract.js +67 -2
  145. package/dist/index.d.ts +23 -6
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +676 -215
  148. package/dist/managed-assets.d.ts +2 -0
  149. package/dist/managed-assets.d.ts.map +1 -1
  150. package/dist/managed-files/files.d.ts +3 -3
  151. package/dist/managed-files/files.d.ts.map +1 -1
  152. package/dist/managed-files/files.js +28 -3
  153. package/dist/managed-files/managed-format.d.ts.map +1 -1
  154. package/dist/managed-files/managed-format.js +1 -0
  155. package/dist/nextest-code-bound.js +1 -0
  156. package/dist/nextest-timings.d.ts +35 -0
  157. package/dist/nextest-timings.d.ts.map +1 -0
  158. package/dist/nextest-timings.js +168 -0
  159. package/dist/owned-installation.d.ts +6 -5
  160. package/dist/owned-installation.d.ts.map +1 -1
  161. package/dist/owned-installation.js +150 -26
  162. package/dist/package-target-policy.d.ts.map +1 -1
  163. package/dist/package-target-policy.js +2 -3
  164. package/dist/process-children.d.ts +7 -0
  165. package/dist/process-children.d.ts.map +1 -0
  166. package/dist/process-children.darwin.d.ts +7 -0
  167. package/dist/process-children.darwin.d.ts.map +1 -0
  168. package/dist/process-children.darwin.js +13 -0
  169. package/dist/process-children.js +14 -0
  170. package/dist/process-children.linux.d.ts +8 -0
  171. package/dist/process-children.linux.d.ts.map +1 -0
  172. package/dist/process-children.linux.js +25 -0
  173. package/dist/process-group.d.ts +108 -0
  174. package/dist/process-group.d.ts.map +1 -0
  175. package/dist/process-group.js +171 -0
  176. package/dist/process-listing.d.ts +7 -0
  177. package/dist/process-listing.d.ts.map +1 -0
  178. package/dist/process-listing.js +51 -0
  179. package/dist/producer-receipts.d.ts +8 -2
  180. package/dist/producer-receipts.d.ts.map +1 -1
  181. package/dist/producer-receipts.js +75 -48
  182. package/dist/task-graph-policy.d.ts +21 -0
  183. package/dist/task-graph-policy.d.ts.map +1 -0
  184. package/dist/task-graph-policy.js +91 -0
  185. package/dist/test-timings.js +4 -4
  186. package/dist/test-walk-policy.d.ts +14 -5
  187. package/dist/test-walk-policy.d.ts.map +1 -1
  188. package/dist/test-walk-policy.js +8 -2
  189. package/dist/testing.d.ts +73 -28
  190. package/dist/testing.d.ts.map +1 -1
  191. package/dist/testing.js +217 -223
  192. package/dist/tool-bins.d.ts +33 -0
  193. package/dist/tool-bins.d.ts.map +1 -0
  194. package/dist/tool-bins.js +72 -0
  195. package/dist/typecheck-test-policy.d.ts.map +1 -1
  196. package/dist/typecheck-test-policy.js +3 -4
  197. package/dist/wait-why-policy.d.ts +28 -0
  198. package/dist/wait-why-policy.d.ts.map +1 -0
  199. package/dist/wait-why-policy.js +223 -0
  200. package/dist/workspace-config-policy.d.ts +14 -8
  201. package/dist/workspace-config-policy.d.ts.map +1 -1
  202. package/dist/workspace-config-policy.js +60 -16
  203. package/dist/workspace-manifest.d.ts +41 -6
  204. package/dist/workspace-manifest.d.ts.map +1 -1
  205. package/dist/workspace-manifest.js +57 -0
  206. package/executors.json +21 -1
  207. package/loader.js +2 -0
  208. package/managed/raw/envrc +11 -0
  209. package/managed/raw/patches/nx@23.2.1.patch +2840 -199
  210. package/managed/raw/patches/ttsc@0.34.1.patch +119 -0
  211. package/managed/raw/tooling/direnv/cargo-fetch-bound.ts +245 -0
  212. package/managed/raw/tooling/direnv/cargo-fetch-run.ts +299 -0
  213. package/managed/raw/tooling/direnv/compiler-variables.sh +42 -0
  214. package/managed/raw/tooling/direnv/developer-links.ts +464 -25
  215. package/managed/raw/tooling/direnv/devenv.smoo.nix +78 -38
  216. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -12
  217. package/managed/raw/tooling/direnv/installed-bun-links.ts +308 -0
  218. package/managed/raw/tooling/direnv/linked-snapshots.ts +62 -3
  219. package/managed/raw/tooling/direnv/nx-socket-dir.sh +56 -17
  220. package/managed/raw/tooling/direnv/repo-path +68 -6
  221. package/managed/raw/tooling/direnv/secret-references.ts +13 -4
  222. package/managed/raw/tooling/direnv/setup-environment.ts +128 -537
  223. package/managed/raw/tooling/direnv/toolchain-stamp.ts +4 -2
  224. package/managed/raw/tooling/direnv/ttsc-env.sh +9 -0
  225. package/managed/raw/tooling/direnv/uv-relocation.ts +227 -0
  226. package/managed/raw/tooling/git-hooks/commit-msg.sh +2 -1
  227. package/managed/raw/tooling/git-hooks/pre-commit.sh +2 -1
  228. package/managed/raw/tooling/git-hooks/pre-push.sh +2 -1
  229. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +85 -7
  230. package/managed/templates/github/actions/save-nix-devenv/action.yml +12 -2
  231. package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
  232. package/package.json +77 -13
  233. package/src/bin/smoo-nx-cargo-toolchain.ts +11 -0
  234. package/src/bin/smoo-nx-forbidden-spellings.ts +33 -0
  235. package/src/bin/smoo-nx-nextest-timings.ts +31 -0
  236. package/src/bounded-test-policy.ts +12 -14
  237. package/src/build-state-output-policy.ts +458 -34
  238. package/src/bun-lock-scope.ts +108 -0
  239. package/src/cargo-build-script-env.ts +265 -0
  240. package/src/cargo-closure-input.ts +74 -7
  241. package/src/cargo-retention-hook.ts +94 -0
  242. package/src/cargo-source-hash.ts +138 -41
  243. package/src/cargo-toolchain-paths.ts +95 -0
  244. package/src/cargo-toolchain-policy.ts +49 -5
  245. package/src/cargo-workspace.ts +72 -123
  246. package/src/cross-check-policy.ts +12 -10
  247. package/src/disk-command-policy.ts +1 -0
  248. package/src/ensure-built-receipt.ts +132 -39
  249. package/src/ensure-built-witness.ts +62 -10
  250. package/src/ensure-built.ts +11 -1
  251. package/src/eslint-config-closure.ts +357 -0
  252. package/src/executors/all-verdicts/executor.ts +164 -0
  253. package/src/executors/all-verdicts/schema.json +22 -0
  254. package/src/executors/all-verdicts/schema.ts +10 -0
  255. package/src/executors/bounded-exec/bounds.ts +76 -0
  256. package/src/executors/bounded-exec/cpu-pool.ts +51 -117
  257. package/src/executors/bounded-exec/executor.ts +423 -259
  258. package/src/executors/bounded-exec/gateway-lease.ts +82 -33
  259. package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
  260. package/src/executors/bounded-exec/lease-wait.ts +89 -0
  261. package/src/executors/bounded-exec/lock-wait.ts +141 -0
  262. package/src/executors/bounded-exec/owned-subtree.ts +235 -0
  263. package/src/executors/bounded-exec/progress.ts +9 -3
  264. package/src/executors/bounded-exec/ram-attach.ts +238 -0
  265. package/src/executors/bounded-exec/ram-detach.ts +226 -0
  266. package/src/executors/bounded-exec/ram-temp-fixtures.ts +358 -0
  267. package/src/executors/bounded-exec/ram-temp-registry.txt +440 -0
  268. package/src/executors/bounded-exec/ram-temp.ts +1497 -460
  269. package/src/executors/bounded-exec/run-cpu-pool.ts +22 -30
  270. package/src/executors/bounded-exec/runner-hook.ts +14 -6
  271. package/src/executors/bounded-exec/runner-lifecycle.ts +31 -8
  272. package/src/executors/bounded-exec/{cpu-tokens.ts → runner-sizing.ts} +13 -59
  273. package/src/executors/bounded-exec/runtime-pin.ts +232 -0
  274. package/src/executors/bounded-exec/schema.json +11 -2
  275. package/src/executors/bounded-exec/schema.ts +19 -1
  276. package/src/executors/bounded-exec/verdict.ts +137 -34
  277. package/src/executors/cargo-zigbuild/executor.ts +82 -8
  278. package/src/executors/clean-outputs/executor.ts +1 -0
  279. package/src/executors/scriptc-native/executor.ts +394 -0
  280. package/src/executors/scriptc-native/ffi-paths.ts +29 -0
  281. package/src/executors/scriptc-native/schema.json +60 -0
  282. package/src/executors/scriptc-native/schema.ts +34 -0
  283. package/src/executors/typescript-emit/executor.ts +205 -38
  284. package/src/forbidden-spelling-policy.ts +226 -0
  285. package/src/generators/create-package/generator.ts +7 -7
  286. package/src/graph-input-contract.ts +61 -2
  287. package/src/index.ts +792 -225
  288. package/src/managed-assets.ts +3 -0
  289. package/src/managed-files/files.ts +28 -3
  290. package/src/managed-files/managed-format.ts +1 -0
  291. package/src/nextest-code-bound.ts +1 -0
  292. package/src/nextest-timings.ts +106 -0
  293. package/src/owned-installation.ts +150 -23
  294. package/src/package-target-policy.ts +2 -3
  295. package/src/process-children.darwin.ts +14 -0
  296. package/src/process-children.linux.ts +33 -0
  297. package/src/process-children.ts +22 -0
  298. package/src/process-group.ts +209 -0
  299. package/src/process-listing.ts +54 -0
  300. package/src/producer-receipts.ts +68 -45
  301. package/src/task-graph-policy.ts +98 -0
  302. package/src/test-walk-policy.ts +23 -8
  303. package/src/testing.ts +240 -232
  304. package/src/tool-bins.ts +108 -0
  305. package/src/typecheck-test-policy.ts +2 -3
  306. package/src/wait-why-policy.ts +226 -0
  307. package/src/workspace-config-policy.ts +63 -15
  308. package/src/workspace-manifest.ts +89 -6
  309. package/test-timings.json +123 -98
  310. package/dist/bin/smoo-nx-failures.d.ts +0 -3
  311. package/dist/bin/smoo-nx-failures.d.ts.map +0 -1
  312. package/dist/bin/smoo-nx-failures.js +0 -3
  313. package/dist/bin/smoo-nx-nextest-extract.d.ts +0 -3
  314. package/dist/bin/smoo-nx-nextest-extract.d.ts.map +0 -1
  315. package/dist/bin/smoo-nx-nextest-extract.js +0 -42
  316. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +0 -1
  317. package/dist/failure-summary.d.ts +0 -5
  318. package/dist/failure-summary.d.ts.map +0 -1
  319. package/dist/failure-summary.js +0 -118
  320. package/dist/nextest-extraction.d.ts +0 -117
  321. package/dist/nextest-extraction.d.ts.map +0 -1
  322. package/dist/nextest-extraction.js +0 -303
  323. package/managed/raw/patches/ttsc@0.30.4.patch +0 -2255
  324. package/src/__tests__/cargo-closure-filesets.ts +0 -94
  325. package/src/__tests__/cargo-closure-fixture.ts +0 -113
  326. package/src/__tests__/counted-cargo-process.ts +0 -286
  327. package/src/__tests__/counted-cargo.ts +0 -713
  328. package/src/__tests__/directory-change.ts +0 -27
  329. package/src/__tests__/fixture-cargo-home.ts +0 -36
  330. package/src/__tests__/fixture-nx-env.ts +0 -193
  331. package/src/__tests__/owned-installation.ts +0 -13
  332. package/src/__tests__/past-tick.ts +0 -12
  333. package/src/__tests__/progress-clock.ts +0 -43
  334. package/src/__tests__/runtime-input.ts +0 -23
  335. package/src/bin/smoo-nx-bound-failures.test.ts +0 -127
  336. package/src/bin/smoo-nx-failures.ts +0 -4
  337. package/src/bin/smoo-nx-nextest-extract.ts +0 -44
  338. package/src/bounded-test-policy.test.ts +0 -1029
  339. package/src/build-state-output-policy.test.ts +0 -115
  340. package/src/bun-bootstrap.test.ts +0 -102
  341. package/src/bun-file-packages.test.ts +0 -47
  342. package/src/cargo-closure-filesets.test.ts +0 -63
  343. package/src/cargo-closure-input.property.test.ts +0 -50
  344. package/src/cargo-closure-input.test.ts +0 -506
  345. package/src/cargo-closure-key.test.ts +0 -240
  346. package/src/cargo-resolve-cache.test.ts +0 -1181
  347. package/src/cargo-source-hash.test.ts +0 -707
  348. package/src/cargo-workspace.test.ts +0 -615
  349. package/src/cross-check-policy.test.ts +0 -316
  350. package/src/disk-command-policy.test.ts +0 -61
  351. package/src/ensure-built-receipt.test.ts +0 -279
  352. package/src/ensure-built-witness.test.ts +0 -688
  353. package/src/ensure-built.test.ts +0 -1462
  354. package/src/executors/bounded-exec/cargo-progress-host.test.ts +0 -332
  355. package/src/executors/bounded-exec/cpu-pool.test.ts +0 -684
  356. package/src/executors/bounded-exec/cpu-tokens.test.ts +0 -519
  357. package/src/executors/bounded-exec/disk-lease.test.ts +0 -219
  358. package/src/executors/bounded-exec/executor-host.test.ts +0 -800
  359. package/src/executors/bounded-exec/executor.test.ts +0 -1819
  360. package/src/executors/bounded-exec/go-progress-host.test.ts +0 -171
  361. package/src/executors/bounded-exec/hang-diagnostics.test.ts +0 -291
  362. package/src/executors/bounded-exec/progress.test.ts +0 -139
  363. package/src/executors/bounded-exec/ram-temp-held.test.ts +0 -264
  364. package/src/executors/bounded-exec/ram-temp-host.test.ts +0 -635
  365. package/src/executors/bounded-exec/ram-temp.test.ts +0 -750
  366. package/src/executors/bounded-exec/run-cpu-pool.test.ts +0 -79
  367. package/src/executors/bounded-exec/runner-hook.test.ts +0 -193
  368. package/src/executors/bounded-exec/runner-lifecycle.test.ts +0 -82
  369. package/src/executors/bounded-exec/verdict.test.ts +0 -545
  370. package/src/executors/cargo-zigbuild/executor.test.ts +0 -129
  371. package/src/executors/clean-outputs/executor.test.ts +0 -20
  372. package/src/executors/typescript-emit/executor.test.ts +0 -83
  373. package/src/failure-summary.ts +0 -119
  374. package/src/generators/bounded-test-targets/generator.test.ts +0 -138
  375. package/src/generators/bun-test-tracing/generator.test.ts +0 -250
  376. package/src/generators/create-package/generator.test.ts +0 -190
  377. package/src/generators/make-public/generator.test.ts +0 -137
  378. package/src/graph-input-contract.test.ts +0 -379
  379. package/src/host-controller-wiring.test.ts +0 -31
  380. package/src/index.test.ts +0 -3319
  381. package/src/linked-snapshots.nx.test.ts +0 -254
  382. package/src/managed-files/forgejo-artifact.test.ts +0 -395
  383. package/src/managed-files/generator.test.ts +0 -243
  384. package/src/managed-files/github-host-cache-isolation.test.ts +0 -86
  385. package/src/managed-files/json-edit.test.ts +0 -216
  386. package/src/managed-files/managed-content.test.ts +0 -166
  387. package/src/managed-files/managed-format-json.test.ts +0 -308
  388. package/src/managed-files/repo-path.test.ts +0 -172
  389. package/src/managed-files/setup-devenv-free-disk.test.ts +0 -95
  390. package/src/managed-files/trace-db-artifact.test.ts +0 -7
  391. package/src/managed-files/tree-permissions.test.ts +0 -109
  392. package/src/managed-files/tree.test.ts +0 -123
  393. package/src/manifest-hash.test.ts +0 -219
  394. package/src/nextest-code-bound.test.ts +0 -161
  395. package/src/nextest-extraction.test.ts +0 -216
  396. package/src/nextest-extraction.ts +0 -371
  397. package/src/nextest-partitions.test.ts +0 -501
  398. package/src/nx-cache-bound.test.ts +0 -109
  399. package/src/nx-cache-restore-mtime.test.ts +0 -170
  400. package/src/nx-daemon-claim.test.ts +0 -279
  401. package/src/nx-daemon-idle-cpu.test.ts +0 -80
  402. package/src/nx-daemon-idle-policy.test.ts +0 -111
  403. package/src/nx-daemon-ignore-files.test.ts +0 -210
  404. package/src/nx-daemon-root-normalization.test.ts +0 -105
  405. package/src/nx-daemon-start-never.test.ts +0 -292
  406. package/src/nx-daemon-validity.test.ts +0 -1055
  407. package/src/nx-dot-input-policy.test.ts +0 -353
  408. package/src/nx-failure-life-cycles.test.ts +0 -207
  409. package/src/nx-files-archive-racy.test.ts +0 -97
  410. package/src/nx-foreign-workspace-env.test.ts +0 -329
  411. package/src/nx-incomplete-run-summary.test.ts +0 -70
  412. package/src/nx-plugin-load-errors.test.ts +0 -120
  413. package/src/nx-project-graph-errors.test.ts +0 -70
  414. package/src/nx-project-resolution-cache.test.ts +0 -176
  415. package/src/nx-raw-inputs.test.ts +0 -166
  416. package/src/nx-resident-graph-workers.test.ts +0 -112
  417. package/src/nx-run-information.test.ts +0 -118
  418. package/src/nx-skipped-task-exit.test.ts +0 -180
  419. package/src/nx-state-location.test.ts +0 -63
  420. package/src/nx-store-resolution.test.ts +0 -81
  421. package/src/nx-task-graph-cycles.test.ts +0 -148
  422. package/src/nx-task-output-lease.test.ts +0 -550
  423. package/src/nx-use-local.test.ts +0 -105
  424. package/src/owned-installation.test.ts +0 -105
  425. package/src/package-target-policy.test.ts +0 -1014
  426. package/src/producer-receipts.test.ts +0 -285
  427. package/src/release-config-policy.test.ts +0 -311
  428. package/src/runtime-input.test.ts +0 -393
  429. package/src/serial-group-wiring.test.ts +0 -326
  430. package/src/task-history-namespace.test.ts +0 -181
  431. package/src/task-results.test.ts +0 -228
  432. package/src/test-clock-policy.test.ts +0 -338
  433. package/src/test-program.test.ts +0 -303
  434. package/src/test-timings.test.ts +0 -240
  435. package/src/test-walk-policy.test.ts +0 -620
  436. package/src/testing.test.ts +0 -509
  437. package/src/typecheck-test-policy.test.ts +0 -1468
  438. package/src/typescript-resolution.test.ts +0 -76
  439. package/src/version-actions.test.ts +0 -80
  440. 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 or the cowshed host budget for. Absent, the runner in the command decides:
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,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,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,19 @@
1
+ import { type LockWait } from './lock-wait.js';
1
2
  /**
2
3
  * Why one bounded run ended, recorded per Nx task so a caller can tell a load-sensitive bound
3
4
  * from a real failure without reading the run's output.
4
5
  *
6
+
5
7
  * - `bound`: the run hit a wall-clock bound and nothing else failed. Either the command
6
- * outlived `timeoutMs` (`total`), or every failing test in the runner's report failed on
8
+ * outlived `timeoutMs` (`total`), its fixture segment outlived `fixtureTimeoutMs`
9
+ * (`fixture`), or every failing test in the runner's report failed on
7
10
  * its runner's per-test timeout (`test`). A loaded host produces exactly these.
8
11
  * - `wedged`: `idleTimeoutMs` fired: no test finished for that long during a chargeable test interval. This proves
9
12
  * the suite's completion bound was exceeded, not that every process stopped: an expensive active fixture can
10
13
  * exceed it too. The verdict names tests reported running but never finished and tests the report says were
11
14
  * aborted; diagnostics distinguish a stalled wait from a progressing but oversized lifecycle.
15
+ * When the snapshot named a lock wait, `lockWaits` names the file the run holds on a numbered descriptor and the
16
+ * processes outside the run that also hold it open: open-handle evidence, not a kernel lock owner.
12
17
  * - `no-space`: the run failed and its output said a write found no space (ENOSPC). Whatever its tests then reported,
13
18
  * they failed on the disk, not on their own: the verdict names the line that said so and, when the task held one,
14
19
  * its RAM temp volume as it stood when that line arrived.
@@ -19,7 +24,7 @@ export type BoundedExecVerdict = {
19
24
  readonly outcome: 'passed';
20
25
  } | {
21
26
  readonly outcome: 'bound';
22
- readonly bound: 'total';
27
+ readonly bound: 'total' | 'fixture';
23
28
  readonly limitMs: number;
24
29
  readonly elapsedMs: number;
25
30
  } | {
@@ -31,6 +36,8 @@ export type BoundedExecVerdict = {
31
36
  readonly idleMs: number;
32
37
  readonly elapsedMs: number;
33
38
  readonly tests: readonly string[];
39
+ /** Lock waits the snapshot named: holder evidence (open handles), not a kernel lock owner. */
40
+ readonly lockWaits: readonly LockWait[];
34
41
  } | ({
35
42
  readonly outcome: 'no-space';
36
43
  readonly exitCode: number;
@@ -40,13 +47,23 @@ export type BoundedExecVerdict = {
40
47
  readonly exitCode: number;
41
48
  readonly tests: readonly string[];
42
49
  };
43
- /** The task's RAM temp volume, read when a line saying ENOSPC arrived: the writer's own lease, and the space left. */
44
- export interface TempVolumeSpace {
50
+ /**
51
+ * The task's RAM temp volume, read when a line saying ENOSPC arrived: the writer's own lease and the space left on the
52
+ * volume it was taken on (`measured`), or why there was none to measure: the lease was no longer on that volume
53
+ * (`lost`), or the volume could not be read (`unread`).
54
+ */
55
+ export type TempVolumeSpace = {
56
+ readonly kind: 'measured';
45
57
  readonly lease: string;
46
58
  readonly mountpoint: string;
47
59
  readonly capacityBytes: number;
48
60
  readonly freeBytes: number;
49
- }
61
+ } | {
62
+ readonly kind: 'lost' | 'unread';
63
+ readonly lease: string;
64
+ readonly mountpoint: string;
65
+ readonly detail: string;
66
+ };
50
67
  /** The first output line that said a write found no space, and the task's RAM temp volume then; `null` without one. */
51
68
  export interface NoSpaceSighting {
52
69
  readonly line: string;
@@ -58,16 +75,14 @@ export interface BoundedExecRecord {
58
75
  readonly hash: string | null;
59
76
  readonly verdict: BoundedExecVerdict;
60
77
  /**
61
- * The host CPU budget's grant the run started under: tokens granted of those asked for, and
62
- * how long it waited. Absent when it ran unbudgeted; written for the reader of a slow run,
63
- * never read back.
78
+ * The parent CPU pool's grant the run started under: tokens granted of those asked for, and
79
+ * how long it waited for the pool. Absent when it ran ungranted; written for the reader of a slow
80
+ * run, never read back.
64
81
  */
65
82
  readonly cpu?: {
66
83
  readonly tokens: number;
67
84
  readonly want: number;
68
85
  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
86
  };
72
87
  }
73
88
  /** The Nx task a run executes as. Nx gives an executor no task id, only its parts. */
@@ -91,8 +106,17 @@ export interface JunitFailures {
91
106
  * Retry elements (`flakyFailure`, `rerunFailure`, ...) describe attempts, not the verdict.
92
107
  */
93
108
  export declare function junitFailures(xml: string): JunitFailures;
109
+ /** One test case of a JUnit report: nextest's binary id (its `classname`), the test's name and its seconds. */
110
+ export interface JunitCaseTime {
111
+ readonly binary: string;
112
+ readonly name: string;
113
+ readonly seconds: number;
114
+ }
115
+ /** Every test case of a JUnit document with the `time` it ran for; a case without one is not timed and not listed. */
116
+ export declare function junitCaseTimes(xml: string): JunitCaseTime[];
94
117
  /**
95
- * The bound that ended a run. `total` is a wall-clock ceiling: it answers "is this run unbounded?". `idle` is the
118
+ * The bound that ended a run. `total` is a wall-clock ceiling: it answers "is this run unbounded?". `fixture` is
119
+ * that ceiling over the run's fixture segment alone: the command it prepares never started. `idle` is the
96
120
  * no-progress bound: it answers "is this run hung?", and carries the tests the runner reported still running.
97
121
  *
98
122
  * These are different questions and one number cannot answer both. A ceiling tight enough to catch a hang promptly
@@ -102,6 +126,9 @@ export declare function junitFailures(xml: string): JunitFailures;
102
126
  export type ExpiredBound = {
103
127
  readonly kind: 'total';
104
128
  readonly limitMs: number;
129
+ } | {
130
+ readonly kind: 'fixture';
131
+ readonly limitMs: number;
105
132
  } | {
106
133
  readonly kind: 'idle';
107
134
  readonly limitMs: number;
@@ -116,6 +143,8 @@ export interface RunEnd {
116
143
  readonly report: JunitFailures | null;
117
144
  /** The first output line that said ENOSPC, or `null` when none did. */
118
145
  readonly noSpace: NoSpaceSighting | null;
146
+ /** The lock waits the expiry's snapshot named; empty when none, or when that capture did not complete. */
147
+ readonly lockWaits: readonly LockWait[];
119
148
  }
120
149
  /**
121
150
  * Judge a run. A run that failed after its output said ENOSPC failed on the disk: that is read first, ahead of the
@@ -1 +1 @@
1
- {"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/verdict.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC5G;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACxF;IACE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,GACD,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,eAAe,CAAC,GAClH;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAEjG,sHAAsH;AACtH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAA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I,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,kBAAkB,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAAE,GACpH;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E;;;;GAIG;AACH,wBAAsB,gBAAgB,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: 'total', limitMs: run.expiry.limitMs, elapsedMs: run.elapsedMs };
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 };
@@ -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' && typeof value.limitMs === 'number' && typeof value.elapsedMs === 'number') {
245
- return { outcome: 'bound', bound: 'total', limitMs: value.limitMs, elapsedMs: value.elapsedMs };
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
- if (typeof value.idleMs === 'number' && typeof value.elapsedMs === 'number' && isStrings(value.tests)) {
253
- return { outcome: 'wedged', idleMs: value.idleMs, elapsedMs: value.elapsedMs, tests: value.tests };
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
- typeof value.lease === 'string' &&
285
- typeof value.mountpoint === 'string' &&
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
- const { lease, mountpoint, capacityBytes, freeBytes } = value;
289
- return { value: { lease, mountpoint, capacityBytes, freeBytes } };
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 === 'total'
343
- ? `outlived its ${verdict.limitMs}ms bound (${verdict.elapsedMs}ms)`
344
- : `per-test timeout only: ${verdict.tests.join(', ')}`;
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
- const mib = (bytes) => (bytes / (1024 * 1024)).toFixed(1);
369
- 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`;
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":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB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