@convesoft/nx-rust 0.0.0-stage → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/LICENSE-APACHE +201 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +48 -2
  4. package/executors.json +35 -0
  5. package/generators.json +19 -0
  6. package/package.json +26 -4
  7. package/src/cargo/build-settings.d.ts +54 -0
  8. package/src/cargo/build-settings.js +93 -0
  9. package/src/cargo/build-settings.js.map +1 -0
  10. package/src/cargo/configured-runner.d.ts +36 -0
  11. package/src/cargo/configured-runner.js +99 -0
  12. package/src/cargo/configured-runner.js.map +1 -0
  13. package/src/cargo/configured-tools.d.ts +35 -0
  14. package/src/cargo/configured-tools.js +46 -0
  15. package/src/cargo/configured-tools.js.map +1 -0
  16. package/src/cargo/dep-info-basedir.d.ts +18 -0
  17. package/src/cargo/dep-info-basedir.js +38 -0
  18. package/src/cargo/dep-info-basedir.js.map +1 -0
  19. package/src/cargo/directories.d.ts +40 -0
  20. package/src/cargo/directories.js +89 -0
  21. package/src/cargo/directories.js.map +1 -0
  22. package/src/cargo/host-triple.d.ts +7 -0
  23. package/src/cargo/host-triple.js +21 -0
  24. package/src/cargo/host-triple.js.map +1 -0
  25. package/src/cargo/lockfile.d.ts +63 -0
  26. package/src/cargo/lockfile.js +157 -0
  27. package/src/cargo/lockfile.js.map +1 -0
  28. package/src/cargo/metadata.d.ts +112 -0
  29. package/src/cargo/metadata.js +37 -0
  30. package/src/cargo/metadata.js.map +1 -0
  31. package/src/cargo/package-specs.d.ts +54 -0
  32. package/src/cargo/package-specs.js +109 -0
  33. package/src/cargo/package-specs.js.map +1 -0
  34. package/src/cargo/paths-crates.d.ts +27 -0
  35. package/src/cargo/paths-crates.js +69 -0
  36. package/src/cargo/paths-crates.js.map +1 -0
  37. package/src/cargo/print-artifact-folders.d.ts +1 -0
  38. package/src/cargo/print-artifact-folders.js +58 -0
  39. package/src/cargo/print-artifact-folders.js.map +1 -0
  40. package/src/cargo/redirections.d.ts +87 -0
  41. package/src/cargo/redirections.js +195 -0
  42. package/src/cargo/redirections.js.map +1 -0
  43. package/src/cargo/run-cargo.d.ts +31 -0
  44. package/src/cargo/run-cargo.js +75 -0
  45. package/src/cargo/run-cargo.js.map +1 -0
  46. package/src/cargo/target-triples.d.ts +98 -0
  47. package/src/cargo/target-triples.js +265 -0
  48. package/src/cargo/target-triples.js.map +1 -0
  49. package/src/cargo/version-req.d.ts +12 -0
  50. package/src/cargo/version-req.js +122 -0
  51. package/src/cargo/version-req.js.map +1 -0
  52. package/src/compatibility/cargo-version.d.ts +43 -0
  53. package/src/compatibility/cargo-version.js +83 -0
  54. package/src/compatibility/cargo-version.js.map +1 -0
  55. package/src/compatibility/nx-bridge.d.ts +312 -0
  56. package/src/compatibility/nx-bridge.js +407 -0
  57. package/src/compatibility/nx-bridge.js.map +1 -0
  58. package/src/compatibility/nx-version.d.ts +104 -0
  59. package/src/compatibility/nx-version.js +272 -0
  60. package/src/compatibility/nx-version.js.map +1 -0
  61. package/src/executors/affected-inputs.d.ts +29 -0
  62. package/src/executors/affected-inputs.js +259 -0
  63. package/src/executors/affected-inputs.js.map +1 -0
  64. package/src/executors/affected-run.d.ts +54 -0
  65. package/src/executors/affected-run.js +394 -0
  66. package/src/executors/affected-run.js.map +1 -0
  67. package/src/executors/affected.d.ts +239 -0
  68. package/src/executors/affected.js +589 -0
  69. package/src/executors/affected.js.map +1 -0
  70. package/src/executors/baseline-context.d.ts +85 -0
  71. package/src/executors/baseline-context.js +227 -0
  72. package/src/executors/baseline-context.js.map +1 -0
  73. package/src/executors/baseline.d.ts +123 -0
  74. package/src/executors/baseline.js +356 -0
  75. package/src/executors/baseline.js.map +1 -0
  76. package/src/executors/batch.d.ts +75 -0
  77. package/src/executors/batch.js +434 -0
  78. package/src/executors/batch.js.map +1 -0
  79. package/src/executors/build-records.d.ts +110 -0
  80. package/src/executors/build-records.js +267 -0
  81. package/src/executors/build-records.js.map +1 -0
  82. package/src/executors/cargo/executor.d.ts +28 -0
  83. package/src/executors/cargo/executor.js +58 -0
  84. package/src/executors/cargo/executor.js.map +1 -0
  85. package/src/executors/cargo/schema.json +54 -0
  86. package/src/executors/cargo-invocation.d.ts +81 -0
  87. package/src/executors/cargo-invocation.js +109 -0
  88. package/src/executors/cargo-invocation.js.map +1 -0
  89. package/src/executors/cargo-output.d.ts +212 -0
  90. package/src/executors/cargo-output.js +646 -0
  91. package/src/executors/cargo-output.js.map +1 -0
  92. package/src/executors/command.d.ts +318 -0
  93. package/src/executors/command.js +517 -0
  94. package/src/executors/command.js.map +1 -0
  95. package/src/executors/coverage-baseline.d.ts +23 -0
  96. package/src/executors/coverage-baseline.js +284 -0
  97. package/src/executors/coverage-baseline.js.map +1 -0
  98. package/src/executors/declared-options.d.ts +21 -0
  99. package/src/executors/declared-options.js +58 -0
  100. package/src/executors/declared-options.js.map +1 -0
  101. package/src/executors/digests.d.ts +94 -0
  102. package/src/executors/digests.js +190 -0
  103. package/src/executors/digests.js.map +1 -0
  104. package/src/executors/dotenv-check.d.ts +79 -0
  105. package/src/executors/dotenv-check.js +553 -0
  106. package/src/executors/dotenv-check.js.map +1 -0
  107. package/src/executors/group-invocations.d.ts +80 -0
  108. package/src/executors/group-invocations.js +253 -0
  109. package/src/executors/group-invocations.js.map +1 -0
  110. package/src/executors/group-run.d.ts +114 -0
  111. package/src/executors/group-run.js +591 -0
  112. package/src/executors/group-run.js.map +1 -0
  113. package/src/executors/groups.d.ts +113 -0
  114. package/src/executors/groups.js +285 -0
  115. package/src/executors/groups.js.map +1 -0
  116. package/src/executors/input-check.d.ts +52 -0
  117. package/src/executors/input-check.js +271 -0
  118. package/src/executors/input-check.js.map +1 -0
  119. package/src/executors/kept-files.d.ts +98 -0
  120. package/src/executors/kept-files.js +341 -0
  121. package/src/executors/kept-files.js.map +1 -0
  122. package/src/executors/lockfile/executor.d.ts +16 -0
  123. package/src/executors/lockfile/executor.js +37 -0
  124. package/src/executors/lockfile/executor.js.map +1 -0
  125. package/src/executors/lockfile/schema.json +50 -0
  126. package/src/executors/napi-build.d.ts +73 -0
  127. package/src/executors/napi-build.js +420 -0
  128. package/src/executors/napi-build.js.map +1 -0
  129. package/src/executors/nextest.d.ts +185 -0
  130. package/src/executors/nextest.js +498 -0
  131. package/src/executors/nextest.js.map +1 -0
  132. package/src/executors/nx-command.d.ts +95 -0
  133. package/src/executors/nx-command.js +205 -0
  134. package/src/executors/nx-command.js.map +1 -0
  135. package/src/executors/nx-task-files.d.ts +82 -0
  136. package/src/executors/nx-task-files.js +156 -0
  137. package/src/executors/nx-task-files.js.map +1 -0
  138. package/src/executors/print-test-mode.d.ts +1 -0
  139. package/src/executors/print-test-mode.js +25 -0
  140. package/src/executors/print-test-mode.js.map +1 -0
  141. package/src/executors/release-publish/executor.d.ts +24 -0
  142. package/src/executors/release-publish/executor.js +165 -0
  143. package/src/executors/release-publish/executor.js.map +1 -0
  144. package/src/executors/release-publish/schema.json +30 -0
  145. package/src/executors/run/executor.d.ts +12 -0
  146. package/src/executors/run/executor.js +27 -0
  147. package/src/executors/run/executor.js.map +1 -0
  148. package/src/executors/run/schema.json +45 -0
  149. package/src/executors/runner-script.d.ts +12 -0
  150. package/src/executors/runner-script.js +22 -0
  151. package/src/executors/runner-script.js.map +1 -0
  152. package/src/executors/runtime-input-check.d.ts +24 -0
  153. package/src/executors/runtime-input-check.js +87 -0
  154. package/src/executors/runtime-input-check.js.map +1 -0
  155. package/src/executors/shared-artifacts.d.ts +44 -0
  156. package/src/executors/shared-artifacts.js +132 -0
  157. package/src/executors/shared-artifacts.js.map +1 -0
  158. package/src/executors/split-words.d.ts +24 -0
  159. package/src/executors/split-words.js +111 -0
  160. package/src/executors/split-words.js.map +1 -0
  161. package/src/executors/stage.d.ts +163 -0
  162. package/src/executors/stage.js +526 -0
  163. package/src/executors/stage.js.map +1 -0
  164. package/src/executors/staged-run.d.ts +24 -0
  165. package/src/executors/staged-run.js +110 -0
  166. package/src/executors/staged-run.js.map +1 -0
  167. package/src/executors/task-env.d.ts +271 -0
  168. package/src/executors/task-env.js +494 -0
  169. package/src/executors/task-env.js.map +1 -0
  170. package/src/executors/task-execution.d.ts +61 -0
  171. package/src/executors/task-execution.js +122 -0
  172. package/src/executors/task-execution.js.map +1 -0
  173. package/src/executors/task-guards.d.ts +112 -0
  174. package/src/executors/task-guards.js +430 -0
  175. package/src/executors/task-guards.js.map +1 -0
  176. package/src/executors/task-options.d.ts +114 -0
  177. package/src/executors/task-options.js +258 -0
  178. package/src/executors/task-options.js.map +1 -0
  179. package/src/executors/task.d.ts +166 -0
  180. package/src/executors/task.js +520 -0
  181. package/src/executors/task.js.map +1 -0
  182. package/src/executors/test-mode.d.ts +182 -0
  183. package/src/executors/test-mode.js +391 -0
  184. package/src/executors/test-mode.js.map +1 -0
  185. package/src/executors/test-runner.d.ts +44 -0
  186. package/src/executors/test-runner.js +159 -0
  187. package/src/executors/test-runner.js.map +1 -0
  188. package/src/executors/test-steps.d.ts +109 -0
  189. package/src/executors/test-steps.js +535 -0
  190. package/src/executors/test-steps.js.map +1 -0
  191. package/src/executors/wasm-build.d.ts +56 -0
  192. package/src/executors/wasm-build.js +216 -0
  193. package/src/executors/wasm-build.js.map +1 -0
  194. package/src/generators/crate/binary.schema.json +28 -0
  195. package/src/generators/crate/crate.d.ts +24 -0
  196. package/src/generators/crate/crate.js +108 -0
  197. package/src/generators/crate/crate.js.map +1 -0
  198. package/src/generators/crate/enclosing-workspace.d.ts +25 -0
  199. package/src/generators/crate/enclosing-workspace.js +58 -0
  200. package/src/generators/crate/enclosing-workspace.js.map +1 -0
  201. package/src/generators/crate/library.schema.json +28 -0
  202. package/src/generators/init/graph-check.d.ts +81 -0
  203. package/src/generators/init/graph-check.js +299 -0
  204. package/src/generators/init/graph-check.js.map +1 -0
  205. package/src/generators/init/init.d.ts +23 -0
  206. package/src/generators/init/init.js +113 -0
  207. package/src/generators/init/init.js.map +1 -0
  208. package/src/generators/init/report.d.ts +19 -0
  209. package/src/generators/init/report.js +93 -0
  210. package/src/generators/init/report.js.map +1 -0
  211. package/src/generators/init/schema.json +9 -0
  212. package/src/graph/artifact-kinds.d.ts +29 -0
  213. package/src/graph/artifact-kinds.js +50 -0
  214. package/src/graph/artifact-kinds.js.map +1 -0
  215. package/src/graph/artifact-names.d.ts +97 -0
  216. package/src/graph/artifact-names.js +276 -0
  217. package/src/graph/artifact-names.js.map +1 -0
  218. package/src/graph/build-records.d.ts +74 -0
  219. package/src/graph/build-records.js +104 -0
  220. package/src/graph/build-records.js.map +1 -0
  221. package/src/graph/caching.d.ts +148 -0
  222. package/src/graph/caching.js +676 -0
  223. package/src/graph/caching.js.map +1 -0
  224. package/src/graph/collisions.d.ts +106 -0
  225. package/src/graph/collisions.js +156 -0
  226. package/src/graph/collisions.js.map +1 -0
  227. package/src/graph/computation-reports.d.ts +89 -0
  228. package/src/graph/computation-reports.js +216 -0
  229. package/src/graph/computation-reports.js.map +1 -0
  230. package/src/graph/declared-files.d.ts +190 -0
  231. package/src/graph/declared-files.js +600 -0
  232. package/src/graph/declared-files.js.map +1 -0
  233. package/src/graph/discovery.d.ts +175 -0
  234. package/src/graph/discovery.js +656 -0
  235. package/src/graph/discovery.js.map +1 -0
  236. package/src/graph/edges.d.ts +25 -0
  237. package/src/graph/edges.js +94 -0
  238. package/src/graph/edges.js.map +1 -0
  239. package/src/graph/entries.d.ts +83 -0
  240. package/src/graph/entries.js +259 -0
  241. package/src/graph/entries.js.map +1 -0
  242. package/src/graph/inputs.d.ts +420 -0
  243. package/src/graph/inputs.js +746 -0
  244. package/src/graph/inputs.js.map +1 -0
  245. package/src/graph/lockfile-task.d.ts +74 -0
  246. package/src/graph/lockfile-task.js +105 -0
  247. package/src/graph/lockfile-task.js.map +1 -0
  248. package/src/graph/names.d.ts +41 -0
  249. package/src/graph/names.js +34 -0
  250. package/src/graph/names.js.map +1 -0
  251. package/src/graph/napi.d.ts +107 -0
  252. package/src/graph/napi.js +206 -0
  253. package/src/graph/napi.js.map +1 -0
  254. package/src/graph/nx-glob.d.ts +36 -0
  255. package/src/graph/nx-glob.js +152 -0
  256. package/src/graph/nx-glob.js.map +1 -0
  257. package/src/graph/nx-internals.d.ts +57 -0
  258. package/src/graph/nx-internals.js +128 -0
  259. package/src/graph/nx-internals.js.map +1 -0
  260. package/src/graph/options.d.ts +32 -0
  261. package/src/graph/options.js +80 -0
  262. package/src/graph/options.js.map +1 -0
  263. package/src/graph/outputs.d.ts +75 -0
  264. package/src/graph/outputs.js +140 -0
  265. package/src/graph/outputs.js.map +1 -0
  266. package/src/graph/path-dependencies.d.ts +122 -0
  267. package/src/graph/path-dependencies.js +459 -0
  268. package/src/graph/path-dependencies.js.map +1 -0
  269. package/src/graph/plugin-package.d.ts +36 -0
  270. package/src/graph/plugin-package.js +132 -0
  271. package/src/graph/plugin-package.js.map +1 -0
  272. package/src/graph/plugin-version.d.ts +20 -0
  273. package/src/graph/plugin-version.js +153 -0
  274. package/src/graph/plugin-version.js.map +1 -0
  275. package/src/graph/projects.d.ts +141 -0
  276. package/src/graph/projects.js +182 -0
  277. package/src/graph/projects.js.map +1 -0
  278. package/src/graph/reached-projects.d.ts +46 -0
  279. package/src/graph/reached-projects.js +102 -0
  280. package/src/graph/reached-projects.js.map +1 -0
  281. package/src/graph/real-path.d.ts +47 -0
  282. package/src/graph/real-path.js +113 -0
  283. package/src/graph/real-path.js.map +1 -0
  284. package/src/graph/redirected-uses.d.ts +98 -0
  285. package/src/graph/redirected-uses.js +434 -0
  286. package/src/graph/redirected-uses.js.map +1 -0
  287. package/src/graph/registration.d.ts +121 -0
  288. package/src/graph/registration.js +233 -0
  289. package/src/graph/registration.js.map +1 -0
  290. package/src/graph/script-input.d.ts +46 -0
  291. package/src/graph/script-input.js +65 -0
  292. package/src/graph/script-input.js.map +1 -0
  293. package/src/graph/settings.d.ts +178 -0
  294. package/src/graph/settings.js +479 -0
  295. package/src/graph/settings.js.map +1 -0
  296. package/src/graph/target-defaults-causes.d.ts +33 -0
  297. package/src/graph/target-defaults-causes.js +202 -0
  298. package/src/graph/target-defaults-causes.js.map +1 -0
  299. package/src/graph/target-defaults-layers.d.ts +186 -0
  300. package/src/graph/target-defaults-layers.js +420 -0
  301. package/src/graph/target-defaults-layers.js.map +1 -0
  302. package/src/graph/target-defaults-meaning.d.ts +95 -0
  303. package/src/graph/target-defaults-meaning.js +292 -0
  304. package/src/graph/target-defaults-meaning.js.map +1 -0
  305. package/src/graph/target-defaults-report.d.ts +77 -0
  306. package/src/graph/target-defaults-report.js +242 -0
  307. package/src/graph/target-defaults-report.js.map +1 -0
  308. package/src/graph/target-defaults.d.ts +79 -0
  309. package/src/graph/target-defaults.js +425 -0
  310. package/src/graph/target-defaults.js.map +1 -0
  311. package/src/graph/target-fields.d.ts +16 -0
  312. package/src/graph/target-fields.js +134 -0
  313. package/src/graph/target-fields.js.map +1 -0
  314. package/src/graph/target-tables.d.ts +45 -0
  315. package/src/graph/target-tables.js +299 -0
  316. package/src/graph/target-tables.js.map +1 -0
  317. package/src/graph/targets.d.ts +367 -0
  318. package/src/graph/targets.js +404 -0
  319. package/src/graph/targets.js.map +1 -0
  320. package/src/graph/unification.d.ts +141 -0
  321. package/src/graph/unification.js +459 -0
  322. package/src/graph/unification.js.map +1 -0
  323. package/src/graph/unignored-directories.d.ts +25 -0
  324. package/src/graph/unignored-directories.js +89 -0
  325. package/src/graph/unignored-directories.js.map +1 -0
  326. package/src/graph/visibility.d.ts +17 -0
  327. package/src/graph/visibility.js +67 -0
  328. package/src/graph/visibility.js.map +1 -0
  329. package/src/graph/warnings.d.ts +38 -0
  330. package/src/graph/warnings.js +77 -0
  331. package/src/graph/warnings.js.map +1 -0
  332. package/src/graph/wasm.d.ts +56 -0
  333. package/src/graph/wasm.js +77 -0
  334. package/src/graph/wasm.js.map +1 -0
  335. package/src/index.d.ts +68 -0
  336. package/src/index.js +109 -0
  337. package/src/index.js.map +1 -0
  338. package/src/release/manifests.d.ts +95 -0
  339. package/src/release/manifests.js +164 -0
  340. package/src/release/manifests.js.map +1 -0
  341. package/src/release/places.d.ts +127 -0
  342. package/src/release/places.js +368 -0
  343. package/src/release/places.js.map +1 -0
  344. package/src/release/publish-cargo.d.ts +177 -0
  345. package/src/release/publish-cargo.js +351 -0
  346. package/src/release/publish-cargo.js.map +1 -0
  347. package/src/release/publish-crates.d.ts +124 -0
  348. package/src/release/publish-crates.js +242 -0
  349. package/src/release/publish-crates.js.map +1 -0
  350. package/src/release/publish-environments.d.ts +50 -0
  351. package/src/release/publish-environments.js +284 -0
  352. package/src/release/publish-environments.js.map +1 -0
  353. package/src/release/publish-messages.d.ts +66 -0
  354. package/src/release/publish-messages.js +273 -0
  355. package/src/release/publish-messages.js.map +1 -0
  356. package/src/release/publish-registry.d.ts +27 -0
  357. package/src/release/publish-registry.js +135 -0
  358. package/src/release/publish-registry.js.map +1 -0
  359. package/src/release/publish-settings.d.ts +26 -0
  360. package/src/release/publish-settings.js +56 -0
  361. package/src/release/publish-settings.js.map +1 -0
  362. package/src/release/publish.d.ts +59 -0
  363. package/src/release/publish.js +620 -0
  364. package/src/release/publish.js.map +1 -0
  365. package/src/release/repository.d.ts +73 -0
  366. package/src/release/repository.js +219 -0
  367. package/src/release/repository.js.map +1 -0
  368. package/src/release/requirements.d.ts +34 -0
  369. package/src/release/requirements.js +30 -0
  370. package/src/release/requirements.js.map +1 -0
  371. package/src/release/toml-edit.d.ts +67 -0
  372. package/src/release/toml-edit.js +453 -0
  373. package/src/release/toml-edit.js.map +1 -0
  374. package/src/release/version-actions.d.ts +133 -0
  375. package/src/release/version-actions.js +474 -0
  376. package/src/release/version-actions.js.map +1 -0
  377. package/src/release/version-checks.d.ts +21 -0
  378. package/src/release/version-checks.js +151 -0
  379. package/src/release/version-checks.js.map +1 -0
  380. package/src/release/version-lockfiles.d.ts +61 -0
  381. package/src/release/version-lockfiles.js +222 -0
  382. package/src/release/version-lockfiles.js.map +1 -0
  383. package/src/tools/napi-cli.d.ts +70 -0
  384. package/src/tools/napi-cli.js +63 -0
  385. package/src/tools/napi-cli.js.map +1 -0
  386. package/src/tools/optional-tools.d.ts +121 -0
  387. package/src/tools/optional-tools.js +303 -0
  388. package/src/tools/optional-tools.js.map +1 -0
  389. package/src/tools/print-napi-cli.d.ts +1 -0
  390. package/src/tools/print-napi-cli.js +24 -0
  391. package/src/tools/print-napi-cli.js.map +1 -0
@@ -0,0 +1,113 @@
1
+ import type { PreparedTask } from "./task";
2
+ /**
3
+ * Whether tasks whose cargo commands would differ only in the crates they
4
+ * select share one command per step (`DES-BATCH`): the one switch of the
5
+ * batch executor that the strategies of `DES-UNIFICATION` turn on.
6
+ *
7
+ * On since `workspace-build` (nxr-8f9dz2): {@link planGroups} makes a group
8
+ * of `build`, `check`, `lint` or `test` select the whole workspace under
9
+ * `workspace-build`, however many tasks it holds, and run `test` in the
10
+ * three steps of `DES-TEST-RUN` with the selecting runner, select its crates
11
+ * with `-p` under `hakari` and `cargo`, and the tasks that cannot do either
12
+ * form groups of one crate ("Groups of one crate" in `DES-BATCH`). The
13
+ * tasks of one target share an environment because cargo never gets the
14
+ * variables by which Nx names a task's project (`ADR-TASK-NAME-VARIABLES`),
15
+ * and a `test` waits for every `build` whose executables its commands
16
+ * replace (`ADR-WORKSPACE-TEST-EXECUTABLES`).
17
+ */
18
+ export declare const groupsShareCommands = true;
19
+ /**
20
+ * Splits the prepared tasks of a batch into groups (`TERM-GROUP`): tasks
21
+ * share a group only where their cargo commands would be the same but for
22
+ * the crates they select, in the same workspace root, with the same
23
+ * environment. The command is compared as {@link cargoArguments} builds it
24
+ * from the options that the task's target takes, so that an option that a
25
+ * task ignores splits no group (`DES-UNKNOWN-OPTIONS`), while a feature set,
26
+ * profile, triple or option that shapes the command, such as the switch for
27
+ * `--all-targets`, does. Environments are compared whole, so that each
28
+ * cargo command runs with the environment that its tasks were keyed with.
29
+ * A task of `build`, `check`, `lint` or `test` whose own options give it a
30
+ * feature set shares no group, even with tasks to which a configuration or
31
+ * the command line gives the same flags (`DES-FEATURE-SETS`).
32
+ *
33
+ * @param shareCommands Whether tasks share a group at all
34
+ * ({@link groupsShareCommands}); without it every task is a group of its own.
35
+ * @returns The groups, each with its tasks in the given order, in the order
36
+ * of each group's first task.
37
+ */
38
+ export declare function formGroups<T extends PreparedTask>(tasks: readonly T[], shareCommands?: boolean): T[][];
39
+ /**
40
+ * How the commands of a group select its crates (`DES-UNIFICATION`, "How
41
+ * each strategy selects"):
42
+ *
43
+ * - `workspace`: the whole workspace with `--workspace`, as a group of
44
+ * `build`, `check`, `lint` or `test` does under `workspace-build` on the
45
+ * host, however many tasks it holds, with the host's triple, which the
46
+ * selecting runner of `test` needs (`DES-TEST-RUN`);
47
+ * - `alone`: a group of one crate, which selects that crate with `-p` and
48
+ * runs the command that a plain cargo of that crate runs ("Groups of one
49
+ * crate" in `DES-BATCH`), with the line that says why where the task's
50
+ * output names it;
51
+ * - `crates`: each crate with `-p`, as a group of `build`, `check`, `lint`
52
+ * or `test` does under `hakari` and `cargo`, as `cargo fmt` takes them,
53
+ * which resolves no features, and the workspace project's targets, which
54
+ * select no crate.
55
+ */
56
+ export type GroupSelection = {
57
+ kind: "workspace";
58
+ host?: string;
59
+ } | {
60
+ kind: "alone";
61
+ note?: string;
62
+ } | {
63
+ kind: "crates";
64
+ };
65
+ /** A group of tasks and how its commands select its crates. */
66
+ export interface PlannedGroup<T extends PreparedTask> {
67
+ tasks: T[];
68
+ selection: GroupSelection;
69
+ }
70
+ /**
71
+ * Decides how each group selects its crates ({@link GroupSelection}), and
72
+ * splits a group whose command would pass a flag whose effect on a crate
73
+ * depends on the selection, or set a runner where the user may have
74
+ * configured one, into groups of one crate, one per task ("Groups of one
75
+ * crate" in `DES-BATCH`). Each task's workspace decides by its strategy
76
+ * (`DES-UNIFICATION`): under `hakari` and `cargo`, a group selects its
77
+ * crates with `-p`, apart from the groups of one crate of
78
+ * {@link hakariSelection} and {@link cargoSelection}. Under
79
+ * `workspace-build`, those are:
80
+ *
81
+ * - a group of `build`, `check`, `lint`, `test` or an artifact target that builds for a
82
+ * triple other than the host's, from its `targetTriple` option or from
83
+ * `build.target` in Cargo's configuration and `CARGO_BUILD_TARGET`, or
84
+ * for a triple whose folder the plugin cannot name, because the whole
85
+ * workspace may not build for it (`DES-FEATURE-SETS`);
86
+ * - a group of `test` with the `cargo` runner on the host where a runner
87
+ * for the host is or may be configured ({@link configuredRunner}), whose
88
+ * tasks say so at the top of their output (`DES-TEST-RUN`, "A runner the
89
+ * user configured"); with nextest, which starts no runner of the
90
+ * plugin's, such a runner applies as to a plain `cargo nextest run`;
91
+ * - a task whose own options give it a feature set, which {@link formGroups}
92
+ * puts in a group of its own, so that its command writes only its crate's
93
+ * files and its result does not depend on what else the batch holds
94
+ * (`DES-FEATURE-SETS`).
95
+ *
96
+ * The host's triple is the one that `rustc -vV` names in the workspace root
97
+ * with the group's environment; where it names none, the group's tasks form
98
+ * groups of one crate, which cost speed and never a result. Every other
99
+ * group of those targets selects the whole workspace, however many tasks it
100
+ * holds, with its feature flags acting on every member (`DES-FEATURE-SETS`).
101
+ * A group decides this once, with the files as they are when the batch forms
102
+ * it: the tasks of a group share their workspace root, environment and
103
+ * command options, which are all that the decision reads.
104
+ *
105
+ * @param shareCommands Whether groups share commands at all ({@link groupsShareCommands}).
106
+ */
107
+ export declare function planGroups<T extends PreparedTask>(groups: readonly T[][], shareCommands?: boolean): PlannedGroup<T>[];
108
+ /**
109
+ * How a group whose first task is `task` selects its crates
110
+ * ({@link planGroups}): the note of a group of one crate holds `{crate}`
111
+ * where it names the crate.
112
+ */
113
+ export declare function groupSelection(task: PreparedTask, host: () => string | undefined): GroupSelection;
@@ -0,0 +1,285 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.groupsShareCommands = void 0;
4
+ exports.formGroups = formGroups;
5
+ exports.planGroups = planGroups;
6
+ exports.groupSelection = groupSelection;
7
+ const node_util_1 = require("node:util");
8
+ const configured_runner_1 = require("../cargo/configured-runner");
9
+ const host_triple_1 = require("../cargo/host-triple");
10
+ const target_triples_1 = require("../cargo/target-triples");
11
+ const wasm_1 = require("../graph/wasm");
12
+ const command_1 = require("./command");
13
+ /**
14
+ * Whether tasks whose cargo commands would differ only in the crates they
15
+ * select share one command per step (`DES-BATCH`): the one switch of the
16
+ * batch executor that the strategies of `DES-UNIFICATION` turn on.
17
+ *
18
+ * On since `workspace-build` (nxr-8f9dz2): {@link planGroups} makes a group
19
+ * of `build`, `check`, `lint` or `test` select the whole workspace under
20
+ * `workspace-build`, however many tasks it holds, and run `test` in the
21
+ * three steps of `DES-TEST-RUN` with the selecting runner, select its crates
22
+ * with `-p` under `hakari` and `cargo`, and the tasks that cannot do either
23
+ * form groups of one crate ("Groups of one crate" in `DES-BATCH`). The
24
+ * tasks of one target share an environment because cargo never gets the
25
+ * variables by which Nx names a task's project (`ADR-TASK-NAME-VARIABLES`),
26
+ * and a `test` waits for every `build` whose executables its commands
27
+ * replace (`ADR-WORKSPACE-TEST-EXECUTABLES`).
28
+ */
29
+ exports.groupsShareCommands = true;
30
+ /**
31
+ * Splits the prepared tasks of a batch into groups (`TERM-GROUP`): tasks
32
+ * share a group only where their cargo commands would be the same but for
33
+ * the crates they select, in the same workspace root, with the same
34
+ * environment. The command is compared as {@link cargoArguments} builds it
35
+ * from the options that the task's target takes, so that an option that a
36
+ * task ignores splits no group (`DES-UNKNOWN-OPTIONS`), while a feature set,
37
+ * profile, triple or option that shapes the command, such as the switch for
38
+ * `--all-targets`, does. Environments are compared whole, so that each
39
+ * cargo command runs with the environment that its tasks were keyed with.
40
+ * A task of `build`, `check`, `lint` or `test` whose own options give it a
41
+ * feature set shares no group, even with tasks to which a configuration or
42
+ * the command line gives the same flags (`DES-FEATURE-SETS`).
43
+ *
44
+ * @param shareCommands Whether tasks share a group at all
45
+ * ({@link groupsShareCommands}); without it every task is a group of its own.
46
+ * @returns The groups, each with its tasks in the given order, in the order
47
+ * of each group's first task.
48
+ */
49
+ // @mara implements DES-BATCH
50
+ // @mara implements DES-UNKNOWN-OPTIONS
51
+ function formGroups(tasks, shareCommands = exports.groupsShareCommands) {
52
+ if (!shareCommands) {
53
+ return tasks.map((task) => [task]);
54
+ }
55
+ const groups = [];
56
+ for (const task of tasks) {
57
+ const key = groupKey(task);
58
+ const group = key.shares
59
+ ? groups.find((entry) => entry.key.shares && sameKey(entry.key, key))
60
+ : undefined;
61
+ if (group === undefined) {
62
+ groups.push({ key, tasks: [task] });
63
+ }
64
+ else {
65
+ group.tasks.push(task);
66
+ }
67
+ }
68
+ return groups.map((group) => group.tasks);
69
+ }
70
+ // The key of a task: its command without the crate it selects, where it
71
+ // selects one, and where it runs. A task of a compiling target whose own
72
+ // options give it a feature set shares no group, so that it forms a group of
73
+ // one crate whatever else the batch holds ("Groups of one crate" in
74
+ // `DES-BATCH`).
75
+ function groupKey(task) {
76
+ if (task.crate === undefined || (task.ownFeatureSet === true && (0, command_1.selectsWorkspace)(task.target))) {
77
+ return { shares: false, cwd: task.cwd, command: [], env: task.env };
78
+ }
79
+ return {
80
+ shares: true,
81
+ target: task.target,
82
+ cwd: task.cwd,
83
+ command: (0, command_1.cargoArguments)(Object.assign({ target: task.target, crates: [{ name: "\0", spec: "\0" }], locked: task.locked, binaryArguments: task.binaryArguments }, (task.testRunner === undefined ? {} : { testRunner: task.testRunner })), task.options),
84
+ env: task.env,
85
+ };
86
+ }
87
+ function sameKey(a, b) {
88
+ return (a.cwd === b.cwd &&
89
+ a.target === b.target &&
90
+ (0, node_util_1.isDeepStrictEqual)(a.command, b.command) &&
91
+ (0, node_util_1.isDeepStrictEqual)(definedEntries(a.env), definedEntries(b.env)));
92
+ }
93
+ // An environment's variables that have a value, in a fixed order.
94
+ function definedEntries(env) {
95
+ return Object.entries(env)
96
+ .filter((entry) => entry[1] !== undefined)
97
+ .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
98
+ }
99
+ /**
100
+ * Decides how each group selects its crates ({@link GroupSelection}), and
101
+ * splits a group whose command would pass a flag whose effect on a crate
102
+ * depends on the selection, or set a runner where the user may have
103
+ * configured one, into groups of one crate, one per task ("Groups of one
104
+ * crate" in `DES-BATCH`). Each task's workspace decides by its strategy
105
+ * (`DES-UNIFICATION`): under `hakari` and `cargo`, a group selects its
106
+ * crates with `-p`, apart from the groups of one crate of
107
+ * {@link hakariSelection} and {@link cargoSelection}. Under
108
+ * `workspace-build`, those are:
109
+ *
110
+ * - a group of `build`, `check`, `lint`, `test` or an artifact target that builds for a
111
+ * triple other than the host's, from its `targetTriple` option or from
112
+ * `build.target` in Cargo's configuration and `CARGO_BUILD_TARGET`, or
113
+ * for a triple whose folder the plugin cannot name, because the whole
114
+ * workspace may not build for it (`DES-FEATURE-SETS`);
115
+ * - a group of `test` with the `cargo` runner on the host where a runner
116
+ * for the host is or may be configured ({@link configuredRunner}), whose
117
+ * tasks say so at the top of their output (`DES-TEST-RUN`, "A runner the
118
+ * user configured"); with nextest, which starts no runner of the
119
+ * plugin's, such a runner applies as to a plain `cargo nextest run`;
120
+ * - a task whose own options give it a feature set, which {@link formGroups}
121
+ * puts in a group of its own, so that its command writes only its crate's
122
+ * files and its result does not depend on what else the batch holds
123
+ * (`DES-FEATURE-SETS`).
124
+ *
125
+ * The host's triple is the one that `rustc -vV` names in the workspace root
126
+ * with the group's environment; where it names none, the group's tasks form
127
+ * groups of one crate, which cost speed and never a result. Every other
128
+ * group of those targets selects the whole workspace, however many tasks it
129
+ * holds, with its feature flags acting on every member (`DES-FEATURE-SETS`).
130
+ * A group decides this once, with the files as they are when the batch forms
131
+ * it: the tasks of a group share their workspace root, environment and
132
+ * command options, which are all that the decision reads.
133
+ *
134
+ * @param shareCommands Whether groups share commands at all ({@link groupsShareCommands}).
135
+ */
136
+ // @mara implements DES-BATCH
137
+ // @mara implements DES-UNIFICATION
138
+ // @mara implements DES-FEATURE-SETS
139
+ // @mara implements DES-TEST-RUN
140
+ function planGroups(groups, shareCommands = exports.groupsShareCommands) {
141
+ const hosts = new Map();
142
+ const host = (task) => {
143
+ const key = JSON.stringify([task.cwd, definedEntries(task.env)]);
144
+ if (!hosts.has(key)) {
145
+ hosts.set(key, (0, host_triple_1.hostTriple)(task.cwd, task.env));
146
+ }
147
+ return hosts.get(key);
148
+ };
149
+ return groups.flatMap((tasks) => {
150
+ const [first] = tasks;
151
+ if (first === undefined) {
152
+ return [];
153
+ }
154
+ const selection = shareCommands
155
+ ? groupSelection(first, () => host(first))
156
+ : { kind: "alone" };
157
+ return selection.kind === "alone"
158
+ ? tasks.map((task) => ({
159
+ tasks: [task],
160
+ selection: selection.note === undefined
161
+ ? { kind: "alone" }
162
+ : { kind: "alone", note: noteFor(task, selection.note) },
163
+ }))
164
+ : [{ tasks: [...tasks], selection }];
165
+ });
166
+ }
167
+ // The note of a group of one crate with the task's name in front, which
168
+ // names the reason with `{crate}` in place of the crate.
169
+ function noteFor(task, note) {
170
+ var _a;
171
+ return `${task.task}: ${note.split("{crate}").join((_a = task.crate) !== null && _a !== void 0 ? _a : "")}`;
172
+ }
173
+ /**
174
+ * How a group selects its crates under `cargo` (`DES-UNIFICATION`, "How
175
+ * each strategy selects"; "Groups of one crate" in `DES-BATCH`): each crate
176
+ * with `-p`, cargo resolving features for the whole workspace, apart from a
177
+ * task with `--features`, which cargo still checks against the selected
178
+ * crates, and which forms a group of one crate. `--all-features` and
179
+ * `--no-default-features` act on every member under workspace unification
180
+ * and share a command.
181
+ */
182
+ // @mara implements DES-UNIFICATION
183
+ // @mara implements DES-BATCH
184
+ function cargoSelection(task) {
185
+ var _a;
186
+ return ((_a = task.options.features) !== null && _a !== void 0 ? _a : []).length > 0 ? { kind: "alone" } : { kind: "crates" };
187
+ }
188
+ /**
189
+ * How a group selects its crates under `hakari` (`DES-UNIFICATION`, "How
190
+ * each strategy selects", "Triples that `platforms` does not list",
191
+ * "Feature flags"): each crate with `-p`, the hack crate keeping the
192
+ * features of third-party crates the same in every selection, apart from
193
+ * the tasks that form groups of one crate:
194
+ *
195
+ * - a feature set given by flags, `--all-features`, `--no-default-features`
196
+ * or any `--features`, which cargo applies to the selected crates only;
197
+ * - a triple that cargo builds for, from the `targetTriple` option or from
198
+ * Cargo's configuration and `CARGO_BUILD_TARGET`, or the host's triple,
199
+ * that the `platforms` which graph creation recorded does not list,
200
+ * because the hack crate does not unify the dependencies under that
201
+ * platform's tables; the host counts for every task, because build
202
+ * scripts and proc macros are compiled for it;
203
+ * - a triple whose folder the plugin cannot name, and a host that `rustc
204
+ * -vV` names no triple for, which cost speed and never a result.
205
+ */
206
+ // @mara implements DES-UNIFICATION
207
+ // @mara implements DES-BATCH
208
+ function hakariSelection(task, picked, host) {
209
+ var _a;
210
+ const { features, allFeatures, noDefaultFeatures } = task.options;
211
+ if ((features !== null && features !== void 0 ? features : []).length > 0 || allFeatures === true || noDefaultFeatures === true) {
212
+ return { kind: "alone" };
213
+ }
214
+ if (picked.kind === "unnamed") {
215
+ return { kind: "alone" };
216
+ }
217
+ const triple = host();
218
+ const platforms = new Set((_a = task.hakariPlatforms) !== null && _a !== void 0 ? _a : []);
219
+ const triples = [...(picked.kind === "triples" ? picked.triples : []), triple];
220
+ return triples.every((entry) => entry !== undefined && platforms.has(entry))
221
+ ? { kind: "crates" }
222
+ : { kind: "alone" };
223
+ }
224
+ /**
225
+ * How a group whose first task is `task` selects its crates
226
+ * ({@link planGroups}): the note of a group of one crate holds `{crate}`
227
+ * where it names the crate.
228
+ */
229
+ function groupSelection(task, host) {
230
+ var _a;
231
+ if (task.crate === undefined || !(0, command_1.selectsWorkspace)(task.target)) {
232
+ return { kind: "crates" };
233
+ }
234
+ // A crate whose own options give it a feature set selects only its crate,
235
+ // whatever else the batch holds, so that its command writes no other
236
+ // crate's files and its result depends on nothing else that runs.
237
+ if (task.ownFeatureSet === true) {
238
+ return { kind: "alone" };
239
+ }
240
+ // `wasm-build` always builds for the wasm triple, a triple other than the
241
+ // host's, which it passes with `--target` (`DES-WASM`).
242
+ const option = task.target === "wasm-build" ? wasm_1.wasmTriple : task.options.targetTriple;
243
+ const picked = typeof option === "string" && option !== ""
244
+ ? { kind: "triples", triples: [option] }
245
+ : (0, target_triples_1.pickedTriples)(task.cwd, task.env);
246
+ switch ((_a = task.featureUnification) !== null && _a !== void 0 ? _a : "workspace-build") {
247
+ case "cargo":
248
+ return cargoSelection(task);
249
+ case "hakari":
250
+ return hakariSelection(task, picked, host);
251
+ case "workspace-build":
252
+ break;
253
+ }
254
+ if (picked.kind === "unnamed") {
255
+ return { kind: "alone" };
256
+ }
257
+ if (picked.kind === "triples" && picked.triples.length > 0) {
258
+ const triple = host();
259
+ if (triple === undefined || picked.triples.some((picked) => picked !== triple)) {
260
+ return { kind: "alone" };
261
+ }
262
+ }
263
+ // nextest needs neither the host's triple nor the plugin's runner, and a
264
+ // runner that the user configured applies to it as to a plain `cargo
265
+ // nextest run` (`DES-TEST-RUN`).
266
+ if (task.target !== "test" || task.testRunner === "nextest") {
267
+ return { kind: "workspace" };
268
+ }
269
+ const triple = host();
270
+ if (triple === undefined) {
271
+ return {
272
+ kind: "alone",
273
+ note: "this task runs the tests of {crate} in cargo commands of its own, because `rustc -vV` names no host triple in the workspace root, which @convesoft/nx-rust needs to pass its selecting runner to cargo.",
274
+ };
275
+ }
276
+ const runner = (0, configured_runner_1.configuredRunner)(task.cwd, task.env, triple);
277
+ if (runner !== undefined) {
278
+ return {
279
+ kind: "alone",
280
+ note: `this task runs the tests of {crate} in a cargo command of its own, without @convesoft/nx-rust's selecting runner, because a runner for the host ${triple} is or may be configured: ${runner.source} ${runner.detail}. Your runner then applies as in a plain \`cargo test -p {crate}\`, and the tests of the crates in this run do not share a cargo command.`,
281
+ };
282
+ }
283
+ return { kind: "workspace", host: triple };
284
+ }
285
+ //# sourceMappingURL=groups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/groups.ts"],"names":[],"mappings":";;;AA+CA,gCAoBC;AAoID,gCA8BC;AAoED,wCAuDC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G,IAAI,EAAE,CAAC;QACtB,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,MAAM,CAAC,EAAE,CAAC;YAC/E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,yEAAyE;IACzE,qEAAqE;IACrE,iCAAiC;IACjC,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC5D,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC;IACtB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO;YACL,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,yMAAyM;SAChN,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAiC,IAAA,oCAAgB,EAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC1F,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO;YACL,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,mJAAmJ,MAAM,6BAA6B,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,2IAA2I;SACtW,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type { BuildRecordSource } from "../graph/build-records";
2
+ import { type BuildSelection } from "./build-records";
3
+ import type { NxTaskFiles } from "./nx-task-files";
4
+ /** What the check of a `build` task needs besides the files that Nx knows. */
5
+ export interface BuildInputCheck {
6
+ /** The task, as `<project>:<target>`. */
7
+ task: string;
8
+ /** The crate's package name. */
9
+ crate: string;
10
+ /** The crate's manifest, relative to the repository root. */
11
+ manifest: string;
12
+ /** What graph creation reported for the crate's records. */
13
+ records: BuildRecordSource;
14
+ /**
15
+ * Cargo's artifact and build directories for the task, as physical
16
+ * paths, which cargo reports with the task's environment.
17
+ */
18
+ directories: {
19
+ artifact: string;
20
+ build: string;
21
+ };
22
+ /**
23
+ * Where the records lie in the layout of an artifact directory, where
24
+ * that is not the artifact directory: the stage of a `napi-build` or
25
+ * `wasm-build` compile, which moves nothing out of it (`DES-BATCH`,
26
+ * "Staged builds"). The stage lies in the artifact directory, which the
27
+ * check leaves out as every one of Cargo's directories.
28
+ */
29
+ recordsFolder?: string;
30
+ /** The task's feature, profile and triple options. */
31
+ selection: BuildSelection;
32
+ /** The task's environment, for `CARGO_BUILD_TARGET` and Cargo's configuration. */
33
+ env: Readonly<Record<string, string | undefined>>;
34
+ /** The absolute path of the folder where cargo ran, the workspace root. */
35
+ cwd: string;
36
+ }
37
+ /**
38
+ * Checks a `build` task after a cargo call that built its crate without
39
+ * error, fresh or not (`DES-BUILD-INPUT-CHECK`): reads the records that the
40
+ * call exported for the crate's library and binaries, as {@link nameRecords}
41
+ * names them, resolves every path they hold to the file it names, leaves out
42
+ * those outside the repository and in Cargo's build or artifact directory,
43
+ * enumerates a recorded folder as Nx sees it, and compares each file with
44
+ * Nx's matching of the task's file inputs.
45
+ *
46
+ * @param nx What Nx knows about the task's files, asked only where a record
47
+ * names a file in the repository.
48
+ * @returns The task's failure message where a file is not covered, naming
49
+ * the crate, each such file and the `fileInputs` line that would cover
50
+ * them; `undefined` where every file is covered.
51
+ */
52
+ export declare function checkBuildInputs(check: BuildInputCheck, repositoryRoot: string, nx: () => Promise<NxTaskFiles>): Promise<string | undefined>;