@convesoft/nx-rust 0.0.0 → 1.0.0-rc.2

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 (418) hide show
  1. package/LICENSE-APACHE +201 -0
  2. package/LICENSE-MIT +21 -0
  3. package/PLUGIN.md +106 -0
  4. package/README.md +51 -1
  5. package/docs/artifacts.mara.md +374 -0
  6. package/docs/caching.mara.md +999 -0
  7. package/docs/ci.mara.md +308 -0
  8. package/docs/configuration.mara.md +508 -0
  9. package/docs/decisions.mara.md +3267 -0
  10. package/docs/execution.mara.md +533 -0
  11. package/docs/index.mara.md +51 -0
  12. package/docs/product.mara.md +366 -0
  13. package/docs/release.mara.md +493 -0
  14. package/docs/setup.mara.md +486 -0
  15. package/docs/targets.mara.md +704 -0
  16. package/docs/testing.mara.md +431 -0
  17. package/docs/verification.mara.md +465 -0
  18. package/docs/workspaces.mara.md +445 -0
  19. package/executors.json +35 -0
  20. package/generators.json +19 -0
  21. package/package.json +17 -4
  22. package/src/cargo/build-settings.d.ts +61 -0
  23. package/src/cargo/build-settings.js +103 -0
  24. package/src/cargo/build-settings.js.map +1 -0
  25. package/src/cargo/configured-runner.d.ts +36 -0
  26. package/src/cargo/configured-runner.js +99 -0
  27. package/src/cargo/configured-runner.js.map +1 -0
  28. package/src/cargo/configured-tools.d.ts +35 -0
  29. package/src/cargo/configured-tools.js +46 -0
  30. package/src/cargo/configured-tools.js.map +1 -0
  31. package/src/cargo/dep-info-basedir.d.ts +18 -0
  32. package/src/cargo/dep-info-basedir.js +38 -0
  33. package/src/cargo/dep-info-basedir.js.map +1 -0
  34. package/src/cargo/directories.d.ts +40 -0
  35. package/src/cargo/directories.js +89 -0
  36. package/src/cargo/directories.js.map +1 -0
  37. package/src/cargo/host-triple.d.ts +7 -0
  38. package/src/cargo/host-triple.js +21 -0
  39. package/src/cargo/host-triple.js.map +1 -0
  40. package/src/cargo/lockfile.d.ts +63 -0
  41. package/src/cargo/lockfile.js +157 -0
  42. package/src/cargo/lockfile.js.map +1 -0
  43. package/src/cargo/metadata.d.ts +114 -0
  44. package/src/cargo/metadata.js +37 -0
  45. package/src/cargo/metadata.js.map +1 -0
  46. package/src/cargo/package-specs.d.ts +54 -0
  47. package/src/cargo/package-specs.js +109 -0
  48. package/src/cargo/package-specs.js.map +1 -0
  49. package/src/cargo/paths-crates.d.ts +27 -0
  50. package/src/cargo/paths-crates.js +69 -0
  51. package/src/cargo/paths-crates.js.map +1 -0
  52. package/src/cargo/print-artifact-folders.d.ts +1 -0
  53. package/src/cargo/print-artifact-folders.js +58 -0
  54. package/src/cargo/print-artifact-folders.js.map +1 -0
  55. package/src/cargo/redirections.d.ts +90 -0
  56. package/src/cargo/redirections.js +200 -0
  57. package/src/cargo/redirections.js.map +1 -0
  58. package/src/cargo/run-cargo.d.ts +31 -0
  59. package/src/cargo/run-cargo.js +75 -0
  60. package/src/cargo/run-cargo.js.map +1 -0
  61. package/src/cargo/target-triples.d.ts +98 -0
  62. package/src/cargo/target-triples.js +265 -0
  63. package/src/cargo/target-triples.js.map +1 -0
  64. package/src/cargo/version-req.d.ts +12 -0
  65. package/src/cargo/version-req.js +122 -0
  66. package/src/cargo/version-req.js.map +1 -0
  67. package/src/cargo/warnings-setting.d.ts +24 -0
  68. package/src/cargo/warnings-setting.js +81 -0
  69. package/src/cargo/warnings-setting.js.map +1 -0
  70. package/src/compatibility/cargo-version.d.ts +43 -0
  71. package/src/compatibility/cargo-version.js +83 -0
  72. package/src/compatibility/cargo-version.js.map +1 -0
  73. package/src/compatibility/nx-bridge.d.ts +312 -0
  74. package/src/compatibility/nx-bridge.js +407 -0
  75. package/src/compatibility/nx-bridge.js.map +1 -0
  76. package/src/compatibility/nx-version.d.ts +104 -0
  77. package/src/compatibility/nx-version.js +272 -0
  78. package/src/compatibility/nx-version.js.map +1 -0
  79. package/src/executors/affected-inputs.d.ts +29 -0
  80. package/src/executors/affected-inputs.js +259 -0
  81. package/src/executors/affected-inputs.js.map +1 -0
  82. package/src/executors/affected-run.d.ts +54 -0
  83. package/src/executors/affected-run.js +394 -0
  84. package/src/executors/affected-run.js.map +1 -0
  85. package/src/executors/affected.d.ts +239 -0
  86. package/src/executors/affected.js +589 -0
  87. package/src/executors/affected.js.map +1 -0
  88. package/src/executors/baseline-context.d.ts +85 -0
  89. package/src/executors/baseline-context.js +227 -0
  90. package/src/executors/baseline-context.js.map +1 -0
  91. package/src/executors/baseline.d.ts +123 -0
  92. package/src/executors/baseline.js +356 -0
  93. package/src/executors/baseline.js.map +1 -0
  94. package/src/executors/batch.d.ts +75 -0
  95. package/src/executors/batch.js +434 -0
  96. package/src/executors/batch.js.map +1 -0
  97. package/src/executors/build-records.d.ts +110 -0
  98. package/src/executors/build-records.js +267 -0
  99. package/src/executors/build-records.js.map +1 -0
  100. package/src/executors/cargo/executor.d.ts +28 -0
  101. package/src/executors/cargo/executor.js +58 -0
  102. package/src/executors/cargo/executor.js.map +1 -0
  103. package/src/executors/cargo/schema.json +58 -0
  104. package/src/executors/cargo-invocation.d.ts +81 -0
  105. package/src/executors/cargo-invocation.js +109 -0
  106. package/src/executors/cargo-invocation.js.map +1 -0
  107. package/src/executors/cargo-output.d.ts +218 -0
  108. package/src/executors/cargo-output.js +660 -0
  109. package/src/executors/cargo-output.js.map +1 -0
  110. package/src/executors/command.d.ts +331 -0
  111. package/src/executors/command.js +547 -0
  112. package/src/executors/command.js.map +1 -0
  113. package/src/executors/coverage-baseline.d.ts +23 -0
  114. package/src/executors/coverage-baseline.js +284 -0
  115. package/src/executors/coverage-baseline.js.map +1 -0
  116. package/src/executors/declared-options.d.ts +21 -0
  117. package/src/executors/declared-options.js +58 -0
  118. package/src/executors/declared-options.js.map +1 -0
  119. package/src/executors/denied-warnings.d.ts +99 -0
  120. package/src/executors/denied-warnings.js +188 -0
  121. package/src/executors/denied-warnings.js.map +1 -0
  122. package/src/executors/digests.d.ts +94 -0
  123. package/src/executors/digests.js +190 -0
  124. package/src/executors/digests.js.map +1 -0
  125. package/src/executors/dotenv-check.d.ts +79 -0
  126. package/src/executors/dotenv-check.js +553 -0
  127. package/src/executors/dotenv-check.js.map +1 -0
  128. package/src/executors/group-invocations.d.ts +80 -0
  129. package/src/executors/group-invocations.js +253 -0
  130. package/src/executors/group-invocations.js.map +1 -0
  131. package/src/executors/group-run.d.ts +114 -0
  132. package/src/executors/group-run.js +601 -0
  133. package/src/executors/group-run.js.map +1 -0
  134. package/src/executors/groups.d.ts +118 -0
  135. package/src/executors/groups.js +304 -0
  136. package/src/executors/groups.js.map +1 -0
  137. package/src/executors/input-check.d.ts +52 -0
  138. package/src/executors/input-check.js +271 -0
  139. package/src/executors/input-check.js.map +1 -0
  140. package/src/executors/kept-files.d.ts +98 -0
  141. package/src/executors/kept-files.js +341 -0
  142. package/src/executors/kept-files.js.map +1 -0
  143. package/src/executors/lockfile/executor.d.ts +16 -0
  144. package/src/executors/lockfile/executor.js +37 -0
  145. package/src/executors/lockfile/executor.js.map +1 -0
  146. package/src/executors/lockfile/schema.json +50 -0
  147. package/src/executors/napi-build.d.ts +73 -0
  148. package/src/executors/napi-build.js +420 -0
  149. package/src/executors/napi-build.js.map +1 -0
  150. package/src/executors/nextest.d.ts +189 -0
  151. package/src/executors/nextest.js +504 -0
  152. package/src/executors/nextest.js.map +1 -0
  153. package/src/executors/nx-command.d.ts +95 -0
  154. package/src/executors/nx-command.js +205 -0
  155. package/src/executors/nx-command.js.map +1 -0
  156. package/src/executors/nx-task-files.d.ts +82 -0
  157. package/src/executors/nx-task-files.js +156 -0
  158. package/src/executors/nx-task-files.js.map +1 -0
  159. package/src/executors/print-test-mode.d.ts +1 -0
  160. package/src/executors/print-test-mode.js +25 -0
  161. package/src/executors/print-test-mode.js.map +1 -0
  162. package/src/executors/release-publish/executor.d.ts +24 -0
  163. package/src/executors/release-publish/executor.js +165 -0
  164. package/src/executors/release-publish/executor.js.map +1 -0
  165. package/src/executors/release-publish/schema.json +30 -0
  166. package/src/executors/run/executor.d.ts +12 -0
  167. package/src/executors/run/executor.js +27 -0
  168. package/src/executors/run/executor.js.map +1 -0
  169. package/src/executors/run/schema.json +45 -0
  170. package/src/executors/runner-script.d.ts +12 -0
  171. package/src/executors/runner-script.js +22 -0
  172. package/src/executors/runner-script.js.map +1 -0
  173. package/src/executors/runtime-input-check.d.ts +24 -0
  174. package/src/executors/runtime-input-check.js +87 -0
  175. package/src/executors/runtime-input-check.js.map +1 -0
  176. package/src/executors/shared-artifacts.d.ts +44 -0
  177. package/src/executors/shared-artifacts.js +132 -0
  178. package/src/executors/shared-artifacts.js.map +1 -0
  179. package/src/executors/split-words.d.ts +24 -0
  180. package/src/executors/split-words.js +111 -0
  181. package/src/executors/split-words.js.map +1 -0
  182. package/src/executors/stage.d.ts +163 -0
  183. package/src/executors/stage.js +526 -0
  184. package/src/executors/stage.js.map +1 -0
  185. package/src/executors/staged-run.d.ts +24 -0
  186. package/src/executors/staged-run.js +110 -0
  187. package/src/executors/staged-run.js.map +1 -0
  188. package/src/executors/task-env.d.ts +271 -0
  189. package/src/executors/task-env.js +494 -0
  190. package/src/executors/task-env.js.map +1 -0
  191. package/src/executors/task-execution.d.ts +61 -0
  192. package/src/executors/task-execution.js +122 -0
  193. package/src/executors/task-execution.js.map +1 -0
  194. package/src/executors/task-guards.d.ts +112 -0
  195. package/src/executors/task-guards.js +435 -0
  196. package/src/executors/task-guards.js.map +1 -0
  197. package/src/executors/task-options.d.ts +114 -0
  198. package/src/executors/task-options.js +258 -0
  199. package/src/executors/task-options.js.map +1 -0
  200. package/src/executors/task.d.ts +166 -0
  201. package/src/executors/task.js +527 -0
  202. package/src/executors/task.js.map +1 -0
  203. package/src/executors/test-mode.d.ts +185 -0
  204. package/src/executors/test-mode.js +397 -0
  205. package/src/executors/test-mode.js.map +1 -0
  206. package/src/executors/test-runner.d.ts +44 -0
  207. package/src/executors/test-runner.js +159 -0
  208. package/src/executors/test-runner.js.map +1 -0
  209. package/src/executors/test-steps.d.ts +121 -0
  210. package/src/executors/test-steps.js +566 -0
  211. package/src/executors/test-steps.js.map +1 -0
  212. package/src/executors/wasm-build.d.ts +56 -0
  213. package/src/executors/wasm-build.js +216 -0
  214. package/src/executors/wasm-build.js.map +1 -0
  215. package/src/generators/crate/binary.schema.json +28 -0
  216. package/src/generators/crate/crate.d.ts +24 -0
  217. package/src/generators/crate/crate.js +108 -0
  218. package/src/generators/crate/crate.js.map +1 -0
  219. package/src/generators/crate/enclosing-workspace.d.ts +25 -0
  220. package/src/generators/crate/enclosing-workspace.js +58 -0
  221. package/src/generators/crate/enclosing-workspace.js.map +1 -0
  222. package/src/generators/crate/library.schema.json +28 -0
  223. package/src/generators/init/graph-check.d.ts +81 -0
  224. package/src/generators/init/graph-check.js +299 -0
  225. package/src/generators/init/graph-check.js.map +1 -0
  226. package/src/generators/init/init.d.ts +23 -0
  227. package/src/generators/init/init.js +113 -0
  228. package/src/generators/init/init.js.map +1 -0
  229. package/src/generators/init/report.d.ts +19 -0
  230. package/src/generators/init/report.js +93 -0
  231. package/src/generators/init/report.js.map +1 -0
  232. package/src/generators/init/schema.json +9 -0
  233. package/src/graph/artifact-kinds.d.ts +29 -0
  234. package/src/graph/artifact-kinds.js +50 -0
  235. package/src/graph/artifact-kinds.js.map +1 -0
  236. package/src/graph/artifact-names.d.ts +97 -0
  237. package/src/graph/artifact-names.js +276 -0
  238. package/src/graph/artifact-names.js.map +1 -0
  239. package/src/graph/build-records.d.ts +74 -0
  240. package/src/graph/build-records.js +104 -0
  241. package/src/graph/build-records.js.map +1 -0
  242. package/src/graph/caching.d.ts +148 -0
  243. package/src/graph/caching.js +681 -0
  244. package/src/graph/caching.js.map +1 -0
  245. package/src/graph/clippy-input.d.ts +53 -0
  246. package/src/graph/clippy-input.js +107 -0
  247. package/src/graph/clippy-input.js.map +1 -0
  248. package/src/graph/collisions.d.ts +113 -0
  249. package/src/graph/collisions.js +156 -0
  250. package/src/graph/collisions.js.map +1 -0
  251. package/src/graph/computation-reports.d.ts +89 -0
  252. package/src/graph/computation-reports.js +216 -0
  253. package/src/graph/computation-reports.js.map +1 -0
  254. package/src/graph/declared-files.d.ts +190 -0
  255. package/src/graph/declared-files.js +600 -0
  256. package/src/graph/declared-files.js.map +1 -0
  257. package/src/graph/discovery.d.ts +190 -0
  258. package/src/graph/discovery.js +661 -0
  259. package/src/graph/discovery.js.map +1 -0
  260. package/src/graph/edges.d.ts +25 -0
  261. package/src/graph/edges.js +94 -0
  262. package/src/graph/edges.js.map +1 -0
  263. package/src/graph/entries.d.ts +83 -0
  264. package/src/graph/entries.js +259 -0
  265. package/src/graph/entries.js.map +1 -0
  266. package/src/graph/inputs.d.ts +422 -0
  267. package/src/graph/inputs.js +756 -0
  268. package/src/graph/inputs.js.map +1 -0
  269. package/src/graph/lockfile-task.d.ts +74 -0
  270. package/src/graph/lockfile-task.js +105 -0
  271. package/src/graph/lockfile-task.js.map +1 -0
  272. package/src/graph/names.d.ts +41 -0
  273. package/src/graph/names.js +34 -0
  274. package/src/graph/names.js.map +1 -0
  275. package/src/graph/napi.d.ts +107 -0
  276. package/src/graph/napi.js +206 -0
  277. package/src/graph/napi.js.map +1 -0
  278. package/src/graph/nx-glob.d.ts +36 -0
  279. package/src/graph/nx-glob.js +152 -0
  280. package/src/graph/nx-glob.js.map +1 -0
  281. package/src/graph/nx-internals.d.ts +57 -0
  282. package/src/graph/nx-internals.js +128 -0
  283. package/src/graph/nx-internals.js.map +1 -0
  284. package/src/graph/options.d.ts +32 -0
  285. package/src/graph/options.js +80 -0
  286. package/src/graph/options.js.map +1 -0
  287. package/src/graph/outputs.d.ts +75 -0
  288. package/src/graph/outputs.js +140 -0
  289. package/src/graph/outputs.js.map +1 -0
  290. package/src/graph/path-dependencies.d.ts +122 -0
  291. package/src/graph/path-dependencies.js +459 -0
  292. package/src/graph/path-dependencies.js.map +1 -0
  293. package/src/graph/plugin-package.d.ts +36 -0
  294. package/src/graph/plugin-package.js +132 -0
  295. package/src/graph/plugin-package.js.map +1 -0
  296. package/src/graph/plugin-version.d.ts +20 -0
  297. package/src/graph/plugin-version.js +153 -0
  298. package/src/graph/plugin-version.js.map +1 -0
  299. package/src/graph/projects.d.ts +141 -0
  300. package/src/graph/projects.js +193 -0
  301. package/src/graph/projects.js.map +1 -0
  302. package/src/graph/reached-projects.d.ts +46 -0
  303. package/src/graph/reached-projects.js +102 -0
  304. package/src/graph/reached-projects.js.map +1 -0
  305. package/src/graph/real-path.d.ts +47 -0
  306. package/src/graph/real-path.js +113 -0
  307. package/src/graph/real-path.js.map +1 -0
  308. package/src/graph/redirected-uses.d.ts +98 -0
  309. package/src/graph/redirected-uses.js +434 -0
  310. package/src/graph/redirected-uses.js.map +1 -0
  311. package/src/graph/registration.d.ts +121 -0
  312. package/src/graph/registration.js +233 -0
  313. package/src/graph/registration.js.map +1 -0
  314. package/src/graph/rustfmt-config.d.ts +42 -0
  315. package/src/graph/rustfmt-config.js +173 -0
  316. package/src/graph/rustfmt-config.js.map +1 -0
  317. package/src/graph/script-input.d.ts +46 -0
  318. package/src/graph/script-input.js +65 -0
  319. package/src/graph/script-input.js.map +1 -0
  320. package/src/graph/settings.d.ts +178 -0
  321. package/src/graph/settings.js +479 -0
  322. package/src/graph/settings.js.map +1 -0
  323. package/src/graph/target-defaults-causes.d.ts +33 -0
  324. package/src/graph/target-defaults-causes.js +202 -0
  325. package/src/graph/target-defaults-causes.js.map +1 -0
  326. package/src/graph/target-defaults-layers.d.ts +186 -0
  327. package/src/graph/target-defaults-layers.js +420 -0
  328. package/src/graph/target-defaults-layers.js.map +1 -0
  329. package/src/graph/target-defaults-meaning.d.ts +95 -0
  330. package/src/graph/target-defaults-meaning.js +292 -0
  331. package/src/graph/target-defaults-meaning.js.map +1 -0
  332. package/src/graph/target-defaults-report.d.ts +77 -0
  333. package/src/graph/target-defaults-report.js +242 -0
  334. package/src/graph/target-defaults-report.js.map +1 -0
  335. package/src/graph/target-defaults.d.ts +79 -0
  336. package/src/graph/target-defaults.js +425 -0
  337. package/src/graph/target-defaults.js.map +1 -0
  338. package/src/graph/target-fields.d.ts +16 -0
  339. package/src/graph/target-fields.js +134 -0
  340. package/src/graph/target-fields.js.map +1 -0
  341. package/src/graph/target-tables.d.ts +45 -0
  342. package/src/graph/target-tables.js +299 -0
  343. package/src/graph/target-tables.js.map +1 -0
  344. package/src/graph/targets.d.ts +371 -0
  345. package/src/graph/targets.js +408 -0
  346. package/src/graph/targets.js.map +1 -0
  347. package/src/graph/unification.d.ts +141 -0
  348. package/src/graph/unification.js +459 -0
  349. package/src/graph/unification.js.map +1 -0
  350. package/src/graph/unignored-directories.d.ts +25 -0
  351. package/src/graph/unignored-directories.js +89 -0
  352. package/src/graph/unignored-directories.js.map +1 -0
  353. package/src/graph/visibility.d.ts +17 -0
  354. package/src/graph/visibility.js +67 -0
  355. package/src/graph/visibility.js.map +1 -0
  356. package/src/graph/warnings.d.ts +38 -0
  357. package/src/graph/warnings.js +77 -0
  358. package/src/graph/warnings.js.map +1 -0
  359. package/src/graph/wasm.d.ts +56 -0
  360. package/src/graph/wasm.js +77 -0
  361. package/src/graph/wasm.js.map +1 -0
  362. package/src/index.d.ts +68 -0
  363. package/src/index.js +109 -0
  364. package/src/index.js.map +1 -0
  365. package/src/release/manifests.d.ts +95 -0
  366. package/src/release/manifests.js +164 -0
  367. package/src/release/manifests.js.map +1 -0
  368. package/src/release/places.d.ts +127 -0
  369. package/src/release/places.js +368 -0
  370. package/src/release/places.js.map +1 -0
  371. package/src/release/publish-cargo.d.ts +177 -0
  372. package/src/release/publish-cargo.js +351 -0
  373. package/src/release/publish-cargo.js.map +1 -0
  374. package/src/release/publish-crates.d.ts +124 -0
  375. package/src/release/publish-crates.js +242 -0
  376. package/src/release/publish-crates.js.map +1 -0
  377. package/src/release/publish-environments.d.ts +50 -0
  378. package/src/release/publish-environments.js +284 -0
  379. package/src/release/publish-environments.js.map +1 -0
  380. package/src/release/publish-messages.d.ts +66 -0
  381. package/src/release/publish-messages.js +273 -0
  382. package/src/release/publish-messages.js.map +1 -0
  383. package/src/release/publish-registry.d.ts +27 -0
  384. package/src/release/publish-registry.js +135 -0
  385. package/src/release/publish-registry.js.map +1 -0
  386. package/src/release/publish-settings.d.ts +26 -0
  387. package/src/release/publish-settings.js +56 -0
  388. package/src/release/publish-settings.js.map +1 -0
  389. package/src/release/publish.d.ts +59 -0
  390. package/src/release/publish.js +620 -0
  391. package/src/release/publish.js.map +1 -0
  392. package/src/release/repository.d.ts +73 -0
  393. package/src/release/repository.js +219 -0
  394. package/src/release/repository.js.map +1 -0
  395. package/src/release/requirements.d.ts +34 -0
  396. package/src/release/requirements.js +30 -0
  397. package/src/release/requirements.js.map +1 -0
  398. package/src/release/toml-edit.d.ts +67 -0
  399. package/src/release/toml-edit.js +453 -0
  400. package/src/release/toml-edit.js.map +1 -0
  401. package/src/release/version-actions.d.ts +133 -0
  402. package/src/release/version-actions.js +474 -0
  403. package/src/release/version-actions.js.map +1 -0
  404. package/src/release/version-checks.d.ts +21 -0
  405. package/src/release/version-checks.js +151 -0
  406. package/src/release/version-checks.js.map +1 -0
  407. package/src/release/version-lockfiles.d.ts +61 -0
  408. package/src/release/version-lockfiles.js +222 -0
  409. package/src/release/version-lockfiles.js.map +1 -0
  410. package/src/tools/napi-cli.d.ts +70 -0
  411. package/src/tools/napi-cli.js +63 -0
  412. package/src/tools/napi-cli.js.map +1 -0
  413. package/src/tools/optional-tools.d.ts +121 -0
  414. package/src/tools/optional-tools.js +303 -0
  415. package/src/tools/optional-tools.js.map +1 -0
  416. package/src/tools/print-napi-cli.d.ts +1 -0
  417. package/src/tools/print-napi-cli.js +24 -0
  418. package/src/tools/print-napi-cli.js.map +1 -0
@@ -0,0 +1,394 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.affectedSelection = affectedSelection;
4
+ exports.contextTriple = contextTriple;
5
+ exports.unreportedFiles = unreportedFiles;
6
+ const tslib_1 = require("tslib");
7
+ const node_child_process_1 = require("node:child_process");
8
+ const node_fs_1 = require("node:fs");
9
+ const node_os_1 = require("node:os");
10
+ const node_path_1 = require("node:path");
11
+ const node_util_1 = require("node:util");
12
+ const host_triple_1 = require("../cargo/host-triple");
13
+ const target_triples_1 = require("../cargo/target-triples");
14
+ const nx_bridge_1 = require("../compatibility/nx-bridge");
15
+ const collisions_1 = require("../graph/collisions");
16
+ const targets_1 = require("../graph/targets");
17
+ const affected_1 = require("./affected");
18
+ const affected_inputs_1 = require("./affected-inputs");
19
+ const baseline_context_1 = require("./baseline-context");
20
+ const cargo_invocation_1 = require("./cargo-invocation");
21
+ const cargo_output_1 = require("./cargo-output");
22
+ const nx_task_files_1 = require("./nx-task-files");
23
+ const test_mode_1 = require("./test-mode");
24
+ /**
25
+ * Steps 1 and 2 of `DES-TEST-RUN` for a nextest group in affected mode
26
+ * (`REQ-AFFECTED-TESTS`, `REQ-SELECTION-SAFETY`): checks that the task's key
27
+ * holds the test mode that the executor reads (`DES-TEST-MODE`), compares
28
+ * the baseline's context record with the group's
29
+ * (`ADR-AFFECTED-BASELINE-CONTEXT`), asks cargo-affected for the selection
30
+ * with git's `diff.relative`, checks the changed files against git's, and
31
+ * widens the selection by the tasks' inputs. Every doubt gives the full suite
32
+ * with the reason. Before it returns a selection, it records in the
33
+ * command's record that the workspace runs a subset in this mode.
34
+ *
35
+ * @param runArgs The arguments of the group's `cargo nextest run`.
36
+ */
37
+ // @mara implements DES-TEST-RUN
38
+ // @mara implements DES-TEST-MODE
39
+ // @mara implements REQ-AFFECTED-TESTS
40
+ // @mara implements REQ-SELECTION-SAFETY
41
+ function affectedSelection(members, workspaceMembers, runArgs, verbose) {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ var _a, _b, _c, _d;
44
+ const [first] = members;
45
+ const mode = (_a = first === null || first === void 0 ? void 0 : first.prepared.testMode) === null || _a === void 0 ? void 0 : _a.mode;
46
+ if (first === undefined || (mode === null || mode === void 0 ? void 0 : mode.kind) !== "affected") {
47
+ return { kind: "full", reason: "the group is not in affected mode" };
48
+ }
49
+ const { cwd, env, workspaceRoot } = first.prepared;
50
+ const root = first.context.root;
51
+ const text = (0, test_mode_1.testModeText)(mode);
52
+ const hashed = (0, test_mode_1.hashedModeProblem)(env, root, workspaceRoot, text);
53
+ if (hashed !== undefined) {
54
+ return { kind: "full", reason: hashed };
55
+ }
56
+ // The name of the test target, which the plugin's options can change
57
+ // (`targetNames`); every task of the group runs it.
58
+ const testTarget = (_b = first.context.targetName) !== null && _b !== void 0 ? _b : "test";
59
+ const graph = first.context.projectGraph;
60
+ if (graph === undefined) {
61
+ return { kind: "full", reason: "Nx gave the executor no project graph" };
62
+ }
63
+ // The projects of the group's crates and of every member with a binary.
64
+ const projects = projectsOfMembers(first.context, workspaceMembers, first.prepared.workspaceRoot);
65
+ const groupProjects = members.map((member) => { var _a; return (_a = member.context.projectName) !== null && _a !== void 0 ? _a : ""; });
66
+ const binaryProjects = workspaceMembers
67
+ .filter((pkg) => pkg.targets.some((target) => target.kind.includes("bin")))
68
+ .flatMap((pkg) => {
69
+ const project = projects.get(pkg.name);
70
+ return project === undefined ? [] : [project];
71
+ });
72
+ let placement;
73
+ try {
74
+ placement = yield (0, affected_inputs_1.inputPlacement)(root, graph, first.context.nxJsonConfiguration, [...new Set([...groupProjects, ...binaryProjects])], testTarget);
75
+ }
76
+ catch (error) {
77
+ if (error instanceof nx_task_files_1.NxTaskFilesError) {
78
+ return {
79
+ kind: "full",
80
+ reason: `@convesoft/nx-rust cannot read the test inputs from the installed Nx (${error.message})`,
81
+ };
82
+ }
83
+ throw error;
84
+ }
85
+ const context = contextProblem(first.prepared, members, placement, mode, root);
86
+ if ("problem" in context) {
87
+ return { kind: "full", reason: context.problem };
88
+ }
89
+ const status = yield runStatus(first.prepared, runArgs, verbose, members);
90
+ if ("problem" in status) {
91
+ return { kind: "full", reason: status.problem };
92
+ }
93
+ const { report } = status;
94
+ const moved = (0, affected_1.collectionsProblem)(report, mode.commits);
95
+ if (moved !== undefined) {
96
+ return { kind: "full", reason: moved };
97
+ }
98
+ // The record again: a collection of the same commit in another context,
99
+ // which ran whole between the first read and the report, changes neither
100
+ // the commits nor the report's collections, only the record
101
+ // (`DES-BASELINE`, "Collection and the test runs").
102
+ const again = (0, baseline_context_1.readContextRecord)(first.prepared.cwd);
103
+ if (!("context" in again) || !(0, node_util_1.isDeepStrictEqual)(again.context, context.record)) {
104
+ return {
105
+ kind: "full",
106
+ reason: "the record of the baseline's context changed while the task ran, as a collection that ran meanwhile changes it",
107
+ };
108
+ }
109
+ const changed = (0, affected_1.gitChangedFiles)(cwd, root, (0, affected_1.usableCollections)(report), env);
110
+ if ("problem" in changed) {
111
+ return { kind: "full", reason: `git cannot name the changed files: ${changed.problem}` };
112
+ }
113
+ const inputFiles = new Set();
114
+ for (const project of groupProjects) {
115
+ for (const file of (_d = (_c = placement.inputs.get(project)) === null || _c === void 0 ? void 0 : _c.files) !== null && _d !== void 0 ? _d : []) {
116
+ inputFiles.add(file);
117
+ }
118
+ }
119
+ // Each input by its path from the top of the git repository; one outside
120
+ // it is one whose changes git cannot see.
121
+ const fromTop = [...inputFiles].map((file) => (0, node_path_1.relative)(changed.top, (0, node_path_1.join)(root, file)).split(node_path_1.sep).join("/"));
122
+ const outside = [...inputFiles].filter((_, index) => fromTop[index].startsWith("../"));
123
+ if (outside.length > 0) {
124
+ return {
125
+ kind: "full",
126
+ reason: `${(0, cargo_output_1.describeList)(outside.slice(0, 3))}, an input of the group's tests, lies outside the git repository in ${changed.top}, so git cannot say whether it changed`,
127
+ };
128
+ }
129
+ const ignored = (0, affected_1.gitIgnored)(changed.top, fromTop, env);
130
+ if ("problem" in ignored) {
131
+ return { kind: "full", reason: `git cannot say which inputs it ignores: ${ignored.problem}` };
132
+ }
133
+ if (ignored.length > 0) {
134
+ return {
135
+ kind: "full",
136
+ reason: `git ignores ${(0, cargo_output_1.describeList)(ignored.slice(0, 3))}, an input of the group's tests, so it cannot say whether that changed`,
137
+ };
138
+ }
139
+ const missing = unreportedFiles(report, changed.files, workspaceRoot);
140
+ if (missing.length > 0) {
141
+ return {
142
+ kind: "full",
143
+ reason: `git names the changed ${missing.length === 1 ? "file" : "files"} ${(0, cargo_output_1.describeList)(missing.slice(0, 3))}, which cargo-affected's report does not list`,
144
+ };
145
+ }
146
+ const folder = workspaceRoot === "." ? "" : workspaceRoot.split(node_path_1.sep).join("/");
147
+ const toProject = new Map([...projects].map(([name, project]) => [project, name]));
148
+ const declaredPatterns = declaredFilesets(first.context, workspaceMembers, projects, testTarget);
149
+ const widened = (0, affected_1.widenSelection)(report, changed.files, {
150
+ workspaceFolder: folder,
151
+ members: workspaceMembers.map((pkg) => wideningMember(pkg, root)),
152
+ crates: members.map((member) => {
153
+ var _a;
154
+ return ({
155
+ name: (_a = member.prepared.crate) !== null && _a !== void 0 ? _a : "",
156
+ optedOut: member.prepared.options.affectedTests === false,
157
+ });
158
+ }),
159
+ owners(path) {
160
+ const owners = placement.owners(path);
161
+ return owners === null || owners === void 0 ? void 0 : owners.flatMap((project) => {
162
+ const name = toProject.get(project);
163
+ return name === undefined ? [] : [name];
164
+ });
165
+ },
166
+ holdsFileBelow(crate, below) {
167
+ var _a;
168
+ const project = projects.get(crate);
169
+ const files = project === undefined ? undefined : (_a = placement.inputs.get(project)) === null || _a === void 0 ? void 0 : _a.files;
170
+ // Every crate's test holds every member's manifest (`DES-INPUTS`),
171
+ // which reaches no program; any other file below the folder counts.
172
+ return [...(files !== null && files !== void 0 ? files : [])].some((file) => file.startsWith(`${below}/`) && file !== `${below}/Cargo.toml`);
173
+ },
174
+ declared: (path) => declaredPatterns(path),
175
+ });
176
+ if (widened.kind === "full") {
177
+ return widened;
178
+ }
179
+ if (!(0, test_mode_1.recordSubset)(env, root, workspaceRoot, text)) {
180
+ return {
181
+ kind: "full",
182
+ reason: "the command's record of the test mode cannot be written, so a later hash of this command could not see that a subset ran",
183
+ };
184
+ }
185
+ return {
186
+ kind: "selection",
187
+ filtersets: (0, affected_1.selectionFiltersets)(widened.crates),
188
+ crates: widened.crates,
189
+ };
190
+ });
191
+ }
192
+ /** The project of each member, by package name, among the projects of the run's configuration. */
193
+ function projectsOfMembers(context, members, workspaceRoot) {
194
+ var _a, _b;
195
+ const names = new Set(members.map((pkg) => pkg.name));
196
+ const projects = new Map();
197
+ for (const [name, project] of Object.entries((_b = (_a = context.projectsConfigurations) === null || _a === void 0 ? void 0 : _a.projects) !== null && _b !== void 0 ? _b : {})) {
198
+ const cargo = (0, collisions_1.cargoMetadataOf)(project);
199
+ if ((cargo === null || cargo === void 0 ? void 0 : cargo.packageName) !== undefined &&
200
+ names.has(cargo.packageName) &&
201
+ (0, node_path_1.dirname)(cargo.workspaceManifest) === workspaceRoot) {
202
+ projects.set(cargo.packageName, name);
203
+ }
204
+ }
205
+ return projects;
206
+ }
207
+ // A member as step 2 needs it, with paths relative to the repository root.
208
+ function wideningMember(pkg, root) {
209
+ var _a;
210
+ const folder = (0, node_path_1.relative)(root, (0, node_path_1.dirname)(pkg.manifest_path)).split(node_path_1.sep).join("/");
211
+ const names = new Set();
212
+ const buildScript = pkg.targets
213
+ .filter((target) => target.kind.includes("custom-build"))
214
+ .flatMap((target) => {
215
+ const source = target.src_path;
216
+ if (typeof source !== "string") {
217
+ return [];
218
+ }
219
+ const file = (0, node_path_1.relative)(root, source).split(node_path_1.sep).join("/");
220
+ const holder = file.slice(0, file.lastIndexOf("/"));
221
+ return holder === folder ? [file] : [file, holder];
222
+ });
223
+ for (const dependency of (_a = pkg.dependencies) !== null && _a !== void 0 ? _a : []) {
224
+ if (typeof dependency.path === "string") {
225
+ names.add(dependency.name);
226
+ }
227
+ }
228
+ return {
229
+ name: pkg.name,
230
+ folder,
231
+ procMacro: pkg.targets.some((target) => target.kind.includes("proc-macro")),
232
+ buildScript,
233
+ hasBinary: pkg.targets.some((target) => target.kind.includes("bin")),
234
+ dependsOn: [...names],
235
+ };
236
+ }
237
+ /**
238
+ * Whether a path matches a `fileInputs` pattern of a crate of the workspace,
239
+ * from the filesets that graph creation recorded in each crate's `test`
240
+ * metadata (`declaredFiles`), with Nx's native matcher.
241
+ */
242
+ function declaredFilesets(context, members, projects, testTarget) {
243
+ var _a, _b, _c, _d, _e, _f;
244
+ const patterns = new Set();
245
+ for (const pkg of members) {
246
+ const project = projects.get(pkg.name);
247
+ const metadata = project === undefined
248
+ ? undefined
249
+ : (_f = (_e = (_d = (_c = (_b = (_a = context.projectsConfigurations) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b[project]) === null || _c === void 0 ? void 0 : _c.targets) === null || _d === void 0 ? void 0 : _d[testTarget]) === null || _e === void 0 ? void 0 : _e.metadata) === null || _f === void 0 ? void 0 : _f[targets_1.targetCargoMetadataKey];
250
+ for (const pattern of Array.isArray(metadata === null || metadata === void 0 ? void 0 : metadata.declaredFiles) ? metadata.declaredFiles : []) {
251
+ if (typeof pattern === "string") {
252
+ patterns.add(pattern.replace(/^\{workspaceRoot\}\/?/, ""));
253
+ }
254
+ }
255
+ }
256
+ if (patterns.size === 0) {
257
+ return () => false;
258
+ }
259
+ const match = nativeMatch(context.root);
260
+ return (path) => (match === undefined ? true : match([...patterns], [path])[0] === true);
261
+ }
262
+ function nativeMatch(root) {
263
+ try {
264
+ return (0, nx_bridge_1.loadNxNative)(root).matchGlobPaths;
265
+ }
266
+ catch (_a) {
267
+ return undefined;
268
+ }
269
+ }
270
+ /**
271
+ * Why the baseline's context does not fit the group's
272
+ * (`ADR-AFFECTED-BASELINE-CONTEXT`): no record, or the options and variables
273
+ * that differ; the record where it fits.
274
+ */
275
+ function contextProblem(prepared, members, placement, mode, repositoryRoot) {
276
+ var _a, _b, _c;
277
+ const record = (0, baseline_context_1.readContextRecord)(prepared.cwd);
278
+ if ("problem" in record) {
279
+ return record;
280
+ }
281
+ const names = new Set();
282
+ const commands = new Set();
283
+ for (const member of members) {
284
+ const inputs = placement.inputs.get((_a = member.context.projectName) !== null && _a !== void 0 ? _a : "");
285
+ for (const name of (_b = inputs === null || inputs === void 0 ? void 0 : inputs.environment) !== null && _b !== void 0 ? _b : []) {
286
+ names.add(name);
287
+ }
288
+ for (const command of (_c = inputs === null || inputs === void 0 ? void 0 : inputs.runtime) !== null && _c !== void 0 ? _c : []) {
289
+ commands.add(command);
290
+ }
291
+ }
292
+ // The runtime inputs again, as Nx ran them when it hashed: what git cannot
293
+ // show has to equal the collection's (`ADR-AFFECTED-BASELINE-CONTEXT`).
294
+ const runtime = (0, baseline_context_1.runtimeContext)((0, baseline_context_1.contextRuntimeCommands)(commands), repositoryRoot, prepared.env);
295
+ if ("problem" in runtime) {
296
+ return { problem: runtime.problem };
297
+ }
298
+ const current = {
299
+ version: 2,
300
+ cargo: (0, baseline_context_1.cargoContext)(prepared.options),
301
+ triple: contextTriple(prepared.cwd, prepared.env),
302
+ env: (0, baseline_context_1.environmentContext)((0, baseline_context_1.contextVariables)(names, prepared.env), prepared.env),
303
+ runtime: runtime.runtime,
304
+ };
305
+ const differences = (0, baseline_context_1.contextDifferences)(record.context, current);
306
+ return differences.length === 0
307
+ ? { record: record.context }
308
+ : {
309
+ problem: `the baseline ${mode.commits.join(",")} was collected in another context: ${(0, cargo_output_1.describeList)(differences)} ${differences.length === 1 ? "differs" : "differ"}`,
310
+ };
311
+ }
312
+ /**
313
+ * The target triple that cargo builds for in the workspace root with `env`,
314
+ * as a context record names it: `host <triple>` where neither Cargo's
315
+ * configuration nor `CARGO_BUILD_TARGET` picks one, else the pick as
316
+ * {@link pickText} gives it.
317
+ */
318
+ function contextTriple(workspaceRoot, env) {
319
+ var _a;
320
+ const picked = (0, target_triples_1.pickedTriples)(workspaceRoot, env);
321
+ return picked.kind === "none"
322
+ ? `host ${(_a = (0, host_triple_1.hostTriple)(workspaceRoot, env)) !== null && _a !== void 0 ? _a : "unknown"}`
323
+ : (0, target_triples_1.pickText)(picked);
324
+ }
325
+ /**
326
+ * Runs `cargo affected status` for the group (`DES-TEST-RUN`, step 1) in the
327
+ * workspace root, with the group's environment and git's `diff.relative`, and
328
+ * reads its report from a folder of its own under the system's temporary
329
+ * folder, which is removed afterwards.
330
+ */
331
+ function runStatus(prepared, runArgs, verbose, members) {
332
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
333
+ const folder = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "nx-rust-affected-"));
334
+ const file = (0, node_path_1.join)(folder, "report.json");
335
+ const invocation = {
336
+ args: (0, affected_1.affectedStatusArguments)(runArgs, file),
337
+ cwd: prepared.cwd,
338
+ env: (0, affected_1.diffRelativeVariables)(prepared.env),
339
+ };
340
+ try {
341
+ if (verbose) {
342
+ yield (0, cargo_invocation_1.printCommand)(members.map((member) => member.prepared.task).join(", "), invocation);
343
+ }
344
+ const run = yield new Promise((resolve) => {
345
+ const child = (0, node_child_process_1.spawn)("cargo", invocation.args, {
346
+ cwd: invocation.cwd,
347
+ env: (0, cargo_invocation_1.cargoEnvironment)(invocation, prepared.env),
348
+ stdio: ["ignore", "ignore", "pipe"],
349
+ });
350
+ const stderr = [];
351
+ child.stderr.on("data", (chunk) => stderr.push(chunk));
352
+ const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
353
+ const forward = (signal) => child.kill(signal);
354
+ for (const signal of signals) {
355
+ process.on(signal, forward);
356
+ }
357
+ const finish = (result) => {
358
+ for (const signal of signals) {
359
+ process.off(signal, forward);
360
+ }
361
+ resolve(Object.assign(Object.assign({}, result), { stderr: Buffer.concat(stderr).toString("utf8") }));
362
+ };
363
+ child.on("error", (error) => finish({ code: null, signal: null, failure: error.message }));
364
+ child.on("close", (code, signal) => finish({ code, signal }));
365
+ });
366
+ let text;
367
+ try {
368
+ text = (0, node_fs_1.readFileSync)(file, "utf8");
369
+ }
370
+ catch (_a) {
371
+ text = undefined;
372
+ }
373
+ return (0, affected_1.readAffectedReport)(run, text, run.stderr);
374
+ }
375
+ finally {
376
+ (0, node_fs_1.rmSync)(folder, { recursive: true, force: true });
377
+ }
378
+ });
379
+ }
380
+ /**
381
+ * The changed files inside the workspace folder that cargo-affected's report
382
+ * does not list, by their paths relative to the workspace root, apart from
383
+ * `.profraw` files, which cargo-affected leaves out (`DES-TEST-RUN`, step 1):
384
+ * a mismatch of paths fails safe.
385
+ */
386
+ function unreportedFiles(report, changed, workspaceRoot) {
387
+ const folder = workspaceRoot === "." || workspaceRoot === "" ? "" : `${workspaceRoot.split(node_path_1.sep).join("/")}/`;
388
+ const listed = new Set(report.changedFiles.map((file) => file.path));
389
+ return changed
390
+ .filter((path) => folder === "" || path.startsWith(folder))
391
+ .map((path) => path.slice(folder.length))
392
+ .filter((path) => !path.endsWith(".profraw") && !listed.has(path));
393
+ }
394
+ //# sourceMappingURL=affected-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"affected-run.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/affected-run.ts"],"names":[],"mappings":";;AA6EA,8CA+JC;AAoJD,sCAKC;AAsED,0CAYC;;AAtdD,2DAA2C;AAC3C,qCAA4D;AAC5D,qCAAiC;AACjC,yCAAyD;AACzD,yCAA8C;AAC9C,sDAAkD;AAElD,4DAAkE;AAClE,0DAA+E;AAC/E,oDAAsD;AACtD,8CAA0D;AAC1D,yCAaoB;AACpB,uDAAwE;AACxE,yDAS4B;AAC5B,yDAA0F;AAC1F,iDAA8C;AAC9C,mDAAmD;AAEnD,2CAA2F;AAmB3F;;;;;;;;;;;;GAYG;AACH,gCAAgC;AAChC,iCAAiC;AACjC,sCAAsC;AACtC,wCAAwC;AACxC,SAAsB,iBAAiB,CACrC,OAAkC,EAClC,gBAAyC,EACzC,OAA0B,EAC1B,OAAgB;;;QAEhB,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;QACxB,MAAM,IAAI,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,CAAC,QAAQ,0CAAE,IAAI,CAAC;QAC5C,IAAI,KAAK,KAAK,SAAS,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,UAAU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AC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,239 @@
1
+ /** One test that cargo-affected's report selects. */
2
+ export interface SelectedTest {
3
+ /** The test binary's ID, such as `core-x` or `app::it`. */
4
+ binary: string;
5
+ /** The test's name. */
6
+ name: string;
7
+ }
8
+ /** One changed file that cargo-affected's report names. */
9
+ export interface ReportedFile {
10
+ /** The path relative to the workspace root, as cargo-affected names it with git's `diff.relative`. */
11
+ path: string;
12
+ /** Whether stored coverage holds rows of the file (`tracked_by_coverage`). */
13
+ trackedByCoverage: boolean;
14
+ }
15
+ /** The parts of a report of `cargo affected status --report-json` that the plugin uses. */
16
+ export interface AffectedReport {
17
+ /** The commits of the collections that the report rests on, with their relation to `HEAD`. */
18
+ collectShas: {
19
+ sha: string;
20
+ relation: string;
21
+ }[];
22
+ /** The changed files the report names. */
23
+ changedFiles: ReportedFile[];
24
+ /** The tests it selects. */
25
+ selected: SelectedTest[];
26
+ }
27
+ /**
28
+ * Reads the report of `cargo affected status --report-json <file>
29
+ * --report-detail full` (`DES-TEST-RUN`, step 1; `EVD-CARGO-AFFECTED-REPORT`).
30
+ * It is used only where cargo-affected exited with 0, its `schema_version` is
31
+ * 1, `cache.status` is `hit-exact` or `hit-with-divergence` and
32
+ * `selection.selected_tests` is a list; every other case gives the reason why
33
+ * the group runs its full suite: the status, with the `differing_labels` of
34
+ * the closest stored fingerprint for `miss-fingerprint`, or cargo-affected's
35
+ * exit status and the end of its standard error. A report whose parts do not
36
+ * have the shape that schema 1 gives them cannot be used either.
37
+ *
38
+ * @param exit How cargo-affected ended: its status, or why it did not run.
39
+ * @param text The report file's text, `undefined` where there is none.
40
+ * @param stderr cargo-affected's standard error, whose end a reason quotes.
41
+ */
42
+ export declare function readAffectedReport(exit: {
43
+ code: number | null;
44
+ signal?: string | null;
45
+ failure?: string;
46
+ }, text: string | undefined, stderr: string): {
47
+ report: AffectedReport;
48
+ } | {
49
+ problem: string;
50
+ };
51
+ /**
52
+ * The commits of the report's collections whose rows the selection uses:
53
+ * those whose relation to `HEAD` is `equal` or `reachable`.
54
+ */
55
+ export declare function usableCollections(report: AffectedReport): string[];
56
+ /**
57
+ * Why the report cannot stand for the task's key, or `undefined`: a
58
+ * collection that the report names and that the commits read before the
59
+ * run do not hold, as after a collection that ran meanwhile
60
+ * (`DES-TEST-MODE`, "Between hashing and the run").
61
+ */
62
+ export declare function collectionsProblem(report: AffectedReport, commits: readonly string[]): string | undefined;
63
+ /**
64
+ * The arguments after `cargo` of step 1 of `DES-TEST-RUN`: `affected status
65
+ * --report-json <file> --report-detail full --` and the cargo arguments of
66
+ * step 3, from its `cargo nextest run` command, without the flags that only a
67
+ * run takes, `--no-fail-fast` and `--no-tests`, since cargo-affected passes
68
+ * them to `cargo nextest list`.
69
+ *
70
+ * @param runArgs The arguments of the group's `cargo nextest run`, without the
71
+ * plugin's tool configuration.
72
+ */
73
+ export declare function affectedStatusArguments(runArgs: readonly string[], reportFile: string): string[];
74
+ /**
75
+ * The variables that set git's `diff.relative` for cargo-affected's process
76
+ * alone, added after any `GIT_CONFIG_<n>` that `env` already has
77
+ * (`DES-TEST-RUN`, step 1): without it, cargo-affected selects nothing in a
78
+ * workspace below the top of its git repository (`EVD-CARGO-AFFECTED-REPORT`).
79
+ */
80
+ export declare function diffRelativeVariables(env: NodeJS.ProcessEnv): Record<string, string>;
81
+ /** What git says changed against the report's collections, by paths relative to the repository root. */
82
+ export interface ChangedFiles {
83
+ /** Every changed path, both ends of a rename and deleted files included. */
84
+ files: string[];
85
+ /** The top of the git repository, absolute. */
86
+ top: string;
87
+ }
88
+ /**
89
+ * The changed files of the whole repository, as git itself names them
90
+ * (`DES-TEST-RUN`, step 1, "Changed files"): for each commit, `git diff --raw
91
+ * --no-renames -z <commit>`, which compares it with the working tree, staged
92
+ * and unstaged changes alike, and once `git ls-files --others
93
+ * --exclude-standard -z` for the untracked files that git does not ignore,
94
+ * all from the top of the repository with `core.quotePath=false`. A changed
95
+ * submodule gives a problem, since git does not name the files that changed
96
+ * inside it. The paths are made relative to `repositoryRoot`, the folder of
97
+ * Nx's workspace, which may lie below the top of the git repository.
98
+ */
99
+ export declare function gitChangedFiles(workspaceRoot: string, repositoryRoot: string, commits: readonly string[], env: NodeJS.ProcessEnv): ChangedFiles | {
100
+ problem: string;
101
+ };
102
+ /** A path from the top of the git repository as a path relative to Nx's workspace root, with `/`. */
103
+ export declare function toRepositoryPath(top: string, repositoryRoot: string, path: string): string;
104
+ /**
105
+ * The entries of `git diff --raw -z` output: each a status line
106
+ * `:<mode> <mode> <object> <object> <status>` and a path, NUL-separated; a
107
+ * mode `160000` marks a submodule.
108
+ */
109
+ export declare function parseRawDiff(output: string): {
110
+ path: string;
111
+ submodule: boolean;
112
+ }[] | {
113
+ problem: string;
114
+ };
115
+ /**
116
+ * Of `paths`, relative to the top of the git repository, those that git
117
+ * ignores (`git check-ignore -z --stdin`), which git cannot say changed
118
+ * (`DES-TEST-RUN`, step 1). Tracked files are never ignored.
119
+ */
120
+ export declare function gitIgnored(top: string, paths: readonly string[], env: NodeJS.ProcessEnv): string[] | {
121
+ problem: string;
122
+ };
123
+ /** A member of the workspace, as step 2 of `DES-TEST-RUN` needs to know it. */
124
+ export interface WideningMember {
125
+ /** The package name. */
126
+ name: string;
127
+ /** Its folder, relative to the repository root, with `/`. */
128
+ folder: string;
129
+ /** Whether it is a proc-macro crate. */
130
+ procMacro: boolean;
131
+ /**
132
+ * The paths, relative to the repository root, that are its build script:
133
+ * the file of its `custom-build` target, and the folder that holds it where
134
+ * that is not the member's own folder, such as `build/`.
135
+ */
136
+ buildScript: string[];
137
+ /** Whether it has a binary target, whose program its integration tests can start. */
138
+ hasBinary: boolean;
139
+ /** The members that it depends on, by a Cargo dependency of any kind. */
140
+ dependsOn: string[];
141
+ }
142
+ /** A crate of the group: its package name and whether it opts out of selection. */
143
+ export interface WideningCrate {
144
+ name: string;
145
+ optedOut: boolean;
146
+ }
147
+ /** What step 2 needs besides the report and the changed files. */
148
+ export interface WideningContext {
149
+ /** The workspace's root folder, relative to the repository root, `""` for the root itself. */
150
+ workspaceFolder: string;
151
+ /** Every member of the workspace. */
152
+ members: readonly WideningMember[];
153
+ /** The group's crates. */
154
+ crates: readonly WideningCrate[];
155
+ /**
156
+ * The crates, among the group's and the members with a binary target,
157
+ * whose `test` task has `path` among its inputs (`DES-INPUTS`), dependency
158
+ * sources reached through `^` included; `undefined` where the plugin cannot
159
+ * tell, which runs the full suite.
160
+ */
161
+ owners(path: string): readonly string[] | undefined;
162
+ /**
163
+ * Whether the `test` task of the group's crate `crate` has a file below
164
+ * `folder` among its inputs, other than the manifest there, which every
165
+ * crate's `test` holds.
166
+ */
167
+ holdsFileBelow(crate: string, folder: string): boolean;
168
+ /** Whether a `fileInputs` pattern of any crate of the workspace matches `path`. */
169
+ declared(path: string): boolean;
170
+ }
171
+ /** What a crate of the group runs in affected mode. */
172
+ export type CrateSelection =
173
+ /** Every test, with why. */
174
+ {
175
+ kind: "all";
176
+ reasons: string[];
177
+ }
178
+ /** The selected tests, by binary ID, and every integration test where `integration` names why. */
179
+ | {
180
+ kind: "some";
181
+ tests: Map<string, Set<string>>;
182
+ integration?: string;
183
+ };
184
+ /** The selection of a group after step 2, or why it runs its full suite. */
185
+ export type GroupSelectionResult = {
186
+ kind: "full";
187
+ reason: string;
188
+ } | {
189
+ kind: "selection";
190
+ crates: Map<string, CrateSelection>;
191
+ };
192
+ /**
193
+ * Step 2 of `DES-TEST-RUN` (`ADR-AFFECTED-TESTS-WIDENING`): widens the
194
+ * tests that cargo-affected selected where coverage cannot see a changed
195
+ * file's whole effect.
196
+ *
197
+ * - Coverage narrows a changed file only where it is a `.rs` file inside the
198
+ * workspace folder that the report lists with `tracked_by_coverage: true`,
199
+ * lies in the folder of a member that is not a proc-macro crate, the
200
+ * deepest such folder, is neither that member's build script nor in a
201
+ * folder of its own that holds it, and no `fileInputs` pattern of any crate
202
+ * matches it.
203
+ * - Every other changed file adds every test of each crate of the group whose
204
+ * `test` task has it among its inputs; one that is an input of no crate of
205
+ * the group adds nothing, and one that the plugin cannot place runs the
206
+ * full suite.
207
+ * - Where a changed file is among the inputs of the `test` task of a member
208
+ * with a binary target, narrowing or not, that member runs every test of
209
+ * its integration test targets, and each crate of the group that depends
210
+ * on it, by a Cargo dependency of any kind or a declared input that reaches
211
+ * its folder (which an Nx dependency gives through `^`), runs all its tests.
212
+ * - A crate that opts out runs all its tests; the selected tests of the
213
+ * report count only for the group's other crates, by the package that the
214
+ * binary ID names before its first `::`.
215
+ *
216
+ * @param changed The changed files, relative to the repository root.
217
+ */
218
+ export declare function widenSelection(report: AffectedReport, changed: readonly string[], context: WideningContext): GroupSelectionResult;
219
+ /** The package of a binary ID: the part before its first `::` (`EVD-CARGO-AFFECTED-REPORT`). */
220
+ export declare function packageOf(binary: string): string;
221
+ /** The longest `-E` arguments together, in bytes, before the selection names whole binaries. */
222
+ export declare const maxSelectionBytes: number;
223
+ /**
224
+ * A name or binary ID as the equality matcher of a nextest filterset takes
225
+ * it: `\`, `/`, `)` and `,` escaped with `\` (`EVD-CARGO-AFFECTED-REPORT`).
226
+ */
227
+ export declare function filtersetEscape(value: string): string;
228
+ /**
229
+ * The `-E` arguments that carry a group's selection to nextest (`DES-TEST-RUN`,
230
+ * step 3), each `(<filterset of its crates>) & (<parts>)`, which nextest
231
+ * unites and intersects with the repository's default filter: a part is
232
+ * `binary_id(=<id>) & (test(=<name>) | …)` for the selected tests of one
233
+ * binary, `package(=<name>)` for a crate that runs all its tests, and
234
+ * `package(=<name>) & kind(test)` for the integration tests of a crate with a
235
+ * binary. No argument exceeds 64 KiB; where they would exceed 512 KiB
236
+ * together, each binary's part names the binary only, which runs more tests
237
+ * and never fewer. An empty list means that no test is selected.
238
+ */
239
+ export declare function selectionFiltersets(crates: ReadonlyMap<string, CrateSelection>): string[];