@convesoft/nx-rust 0.0.0 → 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 +47 -1
  4. package/executors.json +35 -0
  5. package/generators.json +19 -0
  6. package/package.json +17 -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,430 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskError = void 0;
4
+ exports.singleTaskShape = singleTaskShape;
5
+ exports.keyHoldsDigests = keyHoldsDigests;
6
+ exports.checkHakariDependency = checkHakariDependency;
7
+ exports.checkBuildOrder = checkBuildOrder;
8
+ exports.graphTaskOf = graphTaskOf;
9
+ exports.configuredOptions = configuredOptions;
10
+ exports.lockedMode = lockedMode;
11
+ exports.namesTriple = namesTriple;
12
+ exports.checkPickedTriples = checkPickedTriples;
13
+ exports.checkOptionTriple = checkOptionTriple;
14
+ exports.projectWarnings = projectWarnings;
15
+ exports.targetMetadata = targetMetadata;
16
+ const node_path_1 = require("node:path");
17
+ const host_triple_1 = require("../cargo/host-triple");
18
+ const target_triples_1 = require("../cargo/target-triples");
19
+ const collisions_1 = require("../graph/collisions");
20
+ const lockfile_task_1 = require("../graph/lockfile-task");
21
+ const targets_1 = require("../graph/targets");
22
+ const task_env_1 = require("./task-env");
23
+ /** A problem that stops a task before cargo runs; its message is what the task prints. */
24
+ class TaskError extends Error {
25
+ constructor(message) {
26
+ super(message);
27
+ this.name = "TaskError";
28
+ }
29
+ }
30
+ exports.TaskError = TaskError;
31
+ /**
32
+ * What `cargoTaskEnvironment` needs to know of a task run on its own:
33
+ * its configuration, and whether it waits for a continuous task that
34
+ * reports ready by signal, for which Nx sets `NX_READY_URL`
35
+ * ({@link readyUrlProducers}).
36
+ */
37
+ function singleTaskShape(context) {
38
+ var _a;
39
+ const graph = context.taskGraph;
40
+ const task = Object.values((_a = graph === null || graph === void 0 ? void 0 : graph.tasks) !== null && _a !== void 0 ? _a : {}).find((candidate) => candidate.target.project === context.projectName &&
41
+ candidate.target.target === context.targetName &&
42
+ candidate.target.configuration === context.configurationName);
43
+ const producers = task === undefined || graph === undefined || context.projectGraph === undefined
44
+ ? []
45
+ : (0, task_env_1.readyUrlProducers)(task.id, graph, context.projectGraph);
46
+ return { configuration: context.configurationName, readyUrlDependency: producers.length > 0 };
47
+ }
48
+ /**
49
+ * Whether the key of a task whose target hashes digests holds them, so that
50
+ * the task checks them after cargo's call (`DES-LOCKFILE-HASHING`,
51
+ * "Post-check"): the lockfile task that it depends on, by its id, with the
52
+ * members that its metadata names, from which a key that holds every
53
+ * member's digest takes them, or `undefined`. A run that excludes task dependencies, which the plugin's
54
+ * hook marks with a new `NX_RUST_RUN_ID`, runs no lockfile task, and the
55
+ * task's key, which holds that value, is never computed again, so nothing
56
+ * is checked. A task invoked outside a task graph that holds it, such as
57
+ * through another executor, is keyed as that graph says and is not checked
58
+ * either.
59
+ *
60
+ * @throws {TaskError} When the task graph holds the task without its
61
+ * dependency on the lockfile task of its workspace while the run does not
62
+ * exclude task dependencies: its key then holds no digest, and the task
63
+ * fails before cargo runs, so that Nx stores no result for it.
64
+ */
65
+ // @mara implements DES-LOCKFILE-HASHING
66
+ function keyHoldsDigests(context, workspaceManifest, env) {
67
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
68
+ if (((_a = env[lockfile_task_1.runIdVariable]) !== null && _a !== void 0 ? _a : "") !== "") {
69
+ return undefined;
70
+ }
71
+ const graphTask = graphTaskOf(context);
72
+ if (graphTask === undefined) {
73
+ return undefined;
74
+ }
75
+ const projects = (_c = (_b = context.projectsConfigurations) === null || _b === void 0 ? void 0 : _b.projects) !== null && _c !== void 0 ? _c : {};
76
+ // An edge is an object with the task's id; older task graphs held the id itself.
77
+ const edges = (_f = (_e = (_d = context.taskGraph) === null || _d === void 0 ? void 0 : _d.dependencies) === null || _e === void 0 ? void 0 : _e[graphTask.id]) !== null && _f !== void 0 ? _f : [];
78
+ for (const edge of edges) {
79
+ const id = typeof edge === "string" ? edge : edge === null || edge === void 0 ? void 0 : edge.id;
80
+ const dependency = id === undefined ? undefined : (_j = (_h = (_g = context.taskGraph) === null || _g === void 0 ? void 0 : _g.tasks) === null || _h === void 0 ? void 0 : _h[id]) === null || _j === void 0 ? void 0 : _j.target;
81
+ const project = dependency === undefined ? undefined : projects[dependency.project];
82
+ const target = (_k = project === null || project === void 0 ? void 0 : project.targets) === null || _k === void 0 ? void 0 : _k[(_l = dependency === null || dependency === void 0 ? void 0 : dependency.target) !== null && _l !== void 0 ? _l : ""];
83
+ const metadata = targetMetadata((_m = target === null || target === void 0 ? void 0 : target.metadata) === null || _m === void 0 ? void 0 : _m[targets_1.targetCargoMetadataKey]);
84
+ if (id !== undefined &&
85
+ (metadata === null || metadata === void 0 ? void 0 : metadata.target) === "lockfile" &&
86
+ project !== undefined &&
87
+ ((_o = (0, collisions_1.cargoMetadataOf)(project)) === null || _o === void 0 ? void 0 : _o.workspaceManifest) === workspaceManifest) {
88
+ return Object.assign({ id }, (metadata.members === undefined ? {} : { members: metadata.members }));
89
+ }
90
+ }
91
+ const task = `${(_p = context.projectName) !== null && _p !== void 0 ? _p : ""}:${(_q = context.targetName) !== null && _q !== void 0 ? _q : ""}`;
92
+ const folder = (0, node_path_1.dirname)(workspaceManifest);
93
+ throw new TaskError([
94
+ `${task}: this task does not depend on the lockfile task of its Cargo workspace, ${folder === "." ? "at the repository root" : `in ${folder}`}, so its cache key holds no digest of the crate's locked dependencies, and Nx could restore its result after Cargo.lock has changed. The task does not run, so that Nx stores no result for it.`,
95
+ `Make sure that the workspace's folder is an Nx project with the plugin's lockfile target, and that no configuration replaces the dependsOn of ${task}: run \`nx show target ${task} --json\` and look under \`sourceMap\` for the file and entry. A run with --exclude-task-dependencies runs the task without the lockfile task, and Nx never restores what it stores then.`,
96
+ ].join("\n"));
97
+ }
98
+ /**
99
+ * Fails a cached crate task of a workspace that uses `hakari` before cargo
100
+ * runs where its task graph holds no dependency on the workspace's
101
+ * `hakari-check`, in a run that does not exclude task dependencies
102
+ * (`DES-UNIFICATION`, "Drift"): its key holds the hack crate's manifest in
103
+ * place of the other members', which stands for them only while the drift
104
+ * check passes, so that nothing would have checked the hack crate. The
105
+ * caller runs it only where {@link keyHoldsDigests} found the lockfile task
106
+ * in such a run.
107
+ *
108
+ * @throws {TaskError} Naming the workspace and how to find what replaced the
109
+ * task's `dependsOn` (`DES-DIAGNOSTICS`).
110
+ */
111
+ // @mara implements DES-UNIFICATION
112
+ // @mara implements DES-DIAGNOSTICS
113
+ function checkHakariDependency(context, workspaceManifest) {
114
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
115
+ const graphTask = graphTaskOf(context);
116
+ if (graphTask === undefined) {
117
+ return;
118
+ }
119
+ const projects = (_b = (_a = context.projectsConfigurations) === null || _a === void 0 ? void 0 : _a.projects) !== null && _b !== void 0 ? _b : {};
120
+ const edges = (_e = (_d = (_c = context.taskGraph) === null || _c === void 0 ? void 0 : _c.dependencies) === null || _d === void 0 ? void 0 : _d[graphTask.id]) !== null && _e !== void 0 ? _e : [];
121
+ for (const edge of edges) {
122
+ const id = typeof edge === "string" ? edge : edge === null || edge === void 0 ? void 0 : edge.id;
123
+ const dependency = id === undefined ? undefined : (_h = (_g = (_f = context.taskGraph) === null || _f === void 0 ? void 0 : _f.tasks) === null || _g === void 0 ? void 0 : _g[id]) === null || _h === void 0 ? void 0 : _h.target;
124
+ const project = dependency === undefined ? undefined : projects[dependency.project];
125
+ const target = (_j = project === null || project === void 0 ? void 0 : project.targets) === null || _j === void 0 ? void 0 : _j[(_k = dependency === null || dependency === void 0 ? void 0 : dependency.target) !== null && _k !== void 0 ? _k : ""];
126
+ if (((_m = targetMetadata((_l = target === null || target === void 0 ? void 0 : target.metadata) === null || _l === void 0 ? void 0 : _l[targets_1.targetCargoMetadataKey])) === null || _m === void 0 ? void 0 : _m.target) === "hakari-check" &&
127
+ project !== undefined &&
128
+ ((_o = (0, collisions_1.cargoMetadataOf)(project)) === null || _o === void 0 ? void 0 : _o.workspaceManifest) === workspaceManifest) {
129
+ return;
130
+ }
131
+ }
132
+ const task = `${(_p = context.projectName) !== null && _p !== void 0 ? _p : ""}:${(_q = context.targetName) !== null && _q !== void 0 ? _q : ""}`;
133
+ const folder = (0, node_path_1.dirname)(workspaceManifest);
134
+ throw new TaskError([
135
+ `${task}: this task does not depend on the hakari-check task of its Cargo workspace, ${folder === "." ? "at the repository root" : `in ${folder}`}, which uses the feature strategy hakari. Its cache key holds the hack crate's manifest in place of the other members' manifests, which stands for them only while the hack crate is current, so without the check Nx could restore or store a result that depends on what else runs. The task does not run, so that Nx stores no result for it.`,
136
+ `Make sure that no configuration replaces the dependsOn of ${task}: run \`nx show target ${task} --json\` and look under \`sourceMap\` for the file and entry, and keep the plugin's entries with "...". A run with --exclude-task-dependencies runs the task without hakari-check, and Nx never restores what it stores then.`,
137
+ ].join("\n"));
138
+ }
139
+ /**
140
+ * Fails a crate's `test` before cargo runs where its cargo commands replace
141
+ * the executables that a crate's `build` declares, and the task graph holds
142
+ * a task of that `build` that Nx neither finishes before the `test` starts
143
+ * nor starts only after the `test` has finished ({@link finishesBefore}),
144
+ * as where a `project.json`, a target table or a `targetDefaults` entry
145
+ * replaces the `dependsOn` that the plugin infers for `test` (`DES-TARGETS`,
146
+ * "Guard"). The crates are those whose `build` the plugin makes the `test`
147
+ * wait for, `roots` (`testBuilds` in `targets.ts`): under
148
+ * `workspace-build`, every crate of the workspace with a binary and an
149
+ * integration test or bench, the test's own crate among them where it is
150
+ * one, because a `cargo test` of the whole workspace replaces the
151
+ * executables of each (`ADR-WORKSPACE-TEST-EXECUTABLES`). Nx could then run
152
+ * the two at the same time, store the test's executable under the key of
153
+ * `build`, or let the tests run the executable of `build` and store their
154
+ * result (`DES-OUTPUTS`). A run whose graph holds no such `build`, such as
155
+ * `nx test <crate>` with the dependency removed, or one without `build`
156
+ * under `--exclude-task-dependencies`, has nothing to order and passes. A
157
+ * task invoked outside a task graph that holds it is not checked.
158
+ *
159
+ * @param roots The roots of the crates whose `build` the test waits for.
160
+ * @throws {TaskError} Naming the `build` tasks, the reason and the fix.
161
+ */
162
+ // @mara implements DES-TARGETS
163
+ // @mara implements DES-DIAGNOSTICS
164
+ function checkBuildOrder(task, context, roots) {
165
+ var _a, _b, _c;
166
+ const graphTask = graphTaskOf(context);
167
+ const graph = context.taskGraph;
168
+ if (graphTask === undefined || graph === undefined) {
169
+ return;
170
+ }
171
+ const projects = (_b = (_a = context.projectsConfigurations) === null || _a === void 0 ? void 0 : _a.projects) !== null && _b !== void 0 ? _b : {};
172
+ const waited = new Set(roots);
173
+ const unordered = Object.values((_c = graph.tasks) !== null && _c !== void 0 ? _c : {}).filter(({ id, target }) => {
174
+ var _a, _b, _c, _d;
175
+ const project = projects[target.project];
176
+ return (project !== undefined &&
177
+ waited.has(project.root) &&
178
+ ((_d = targetMetadata((_c = (_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a[target.target]) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c[targets_1.targetCargoMetadataKey])) === null || _d === void 0 ? void 0 : _d.target) === "build" &&
179
+ !finishesBefore(graph, id, graphTask.id) &&
180
+ !finishesBefore(graph, graphTask.id, id));
181
+ });
182
+ if (unordered.length === 0) {
183
+ return;
184
+ }
185
+ const builds = unordered
186
+ .map(({ id }) => id)
187
+ .sort()
188
+ .join(" and ");
189
+ const ownOnly = unordered.every(({ target }) => target.project === context.projectName);
190
+ const why = ownOnly
191
+ ? `cargo test replaces the executables that ${builds} declares as its outputs, because the crate has a binary and an integration test or a bench that cargo test builds`
192
+ : `the cargo test of this task, which builds the whole workspace under workspace-build, replaces the executables that ${builds} ${unordered.length === 1 ? "declares as its outputs, because that crate has" : "declare as their outputs, because those crates have"} a binary and an integration test or a bench that cargo test builds`;
193
+ throw new TaskError([
194
+ `${task}: ${why}, and this run holds ${builds} without the dependency of ${task} on ${unordered.length === 1 ? "it" : "them"} that @convesoft/nx-rust infers. Nx could run the two at the same time, store this task's executables under the key of ${builds}, or let the tests run the executables of ${builds} and store their result. The task does not run, so that Nx stores no result for it.`,
195
+ `Make sure that no configuration replaces the dependsOn of ${task}: run \`nx show target ${task} --json\` and look under \`sourceMap\` for the file and entry, and keep the plugin's entries with "...", as in "dependsOn": ["...", "^codegen"]. A dependency on a continuous task orders the two only where that task, or a task it depends on, depends on ${builds} itself.`,
196
+ ].join("\n"));
197
+ }
198
+ /**
199
+ * Whether Nx finishes and stores the task `earlier` before it starts the task
200
+ * `later`, as its task graph decides (`DES-TARGETS`, "Guard"). Nx starts a
201
+ * task once its ordinary dependencies have completed, which comes after
202
+ * their outputs are stored, and once its continuous dependencies have been
203
+ * started, or have reported ready where the edge waits for that; a continuous
204
+ * task is itself started only once its own ordinary dependencies have
205
+ * completed (`EVD-CARGO-ARTIFACT-WRITERS`). So no task of a path of
206
+ * dependencies starts before the task that it depends on has started, and
207
+ * `earlier` has finished before `later` starts where a path leads from
208
+ * `later` to `earlier`, through ordinary and continuous dependencies alike,
209
+ * and its last edge, the one into `earlier`, is an ordinary dependency. A
210
+ * path that reaches `earlier` only as a continuous dependency, which is how
211
+ * Nx records every edge into a continuous task, guarantees no more than that
212
+ * `earlier` has started.
213
+ */
214
+ function finishesBefore(graph, earlier, later) {
215
+ var _a, _b;
216
+ // An edge is an object with the task's id; older task graphs held the id itself.
217
+ const ids = (edges) => (edges !== null && edges !== void 0 ? edges : []).flatMap((edge) => {
218
+ const id = typeof edge === "string" ? edge : edge === null || edge === void 0 ? void 0 : edge.id;
219
+ return id === undefined ? [] : [id];
220
+ });
221
+ const seen = new Set();
222
+ const queue = [later];
223
+ while (queue.length > 0) {
224
+ const id = queue.pop();
225
+ if (seen.has(id)) {
226
+ continue;
227
+ }
228
+ seen.add(id);
229
+ const ordinary = ids((_a = graph.dependencies) === null || _a === void 0 ? void 0 : _a[id]);
230
+ if (ordinary.includes(earlier)) {
231
+ return true;
232
+ }
233
+ queue.push(...ordinary, ...ids((_b = graph.continuousDependencies) === null || _b === void 0 ? void 0 : _b[id]));
234
+ }
235
+ return false;
236
+ }
237
+ /**
238
+ * The task that the task graph in the executor's context holds for this
239
+ * invocation: the one of the same project, target and configuration. Nx
240
+ * gives a task's configuration, its target's `defaultConfiguration` where the
241
+ * command names none, to the task in the graph and to the context alike.
242
+ */
243
+ function graphTaskOf(context) {
244
+ var _a, _b;
245
+ const configuration = context.configurationName || undefined;
246
+ return Object.values((_b = (_a = context.taskGraph) === null || _a === void 0 ? void 0 : _a.tasks) !== null && _b !== void 0 ? _b : {}).find(({ target }) => target.project === context.projectName &&
247
+ target.target === context.targetName &&
248
+ (target.configuration || undefined) === configuration);
249
+ }
250
+ // The target's options with those of the active configuration laid over
251
+ // them, as Nx merges them before the options of the invocation
252
+ // (`combineOptionsForExecutor` in `utils/params.js` of `nx` 24).
253
+ function configuredOptions(context) {
254
+ var _a, _b, _c;
255
+ const configuration = context.configurationName;
256
+ return Object.assign(Object.assign({}, (_a = context.target) === null || _a === void 0 ? void 0 : _a.options), (configuration ? (_c = (_b = context.target) === null || _b === void 0 ? void 0 : _b.configurations) === null || _c === void 0 ? void 0 : _c[configuration] : undefined));
257
+ }
258
+ /**
259
+ * Whether a task runs in locked mode: the `locked` option of the plugin
260
+ * entry, unless `NX_RUST_LOCKED` is set to `true` or `false` for the run
261
+ * (`DES-INVOCATION`). An empty variable counts as unset.
262
+ *
263
+ * @throws {TaskError} When the variable has any other value.
264
+ */
265
+ // @mara implements DES-INVOCATION
266
+ function lockedMode(option, variable) {
267
+ switch (variable) {
268
+ case undefined:
269
+ case "":
270
+ return option;
271
+ case "true":
272
+ return true;
273
+ case "false":
274
+ return false;
275
+ }
276
+ throw new TaskError(`NX_RUST_LOCKED is ${JSON.stringify(variable)}, but it has to be true or false. Unset it to use the "locked" option of the @convesoft/nx-rust entry in nx.json.`);
277
+ }
278
+ // Whether a task's options name a triple, which `--target` then gives cargo
279
+ // in place of what the configuration and the environment pick.
280
+ function namesTriple(options) {
281
+ return typeof options.targetTriple === "string" && options.targetTriple !== "";
282
+ }
283
+ // Fails a cached `build` or `doc` whose run names no triple when the task's
284
+ // environment and Cargo's configuration, as they are now, pick other
285
+ // triples than those whose folders its outputs name, which graph creation
286
+ // recorded: cargo would write elsewhere, and Nx would store no artifact
287
+ // (`DES-OUTPUTS`). Where the configuration alone picks other triples than
288
+ // at graph creation, the graph is out of date, as when a file that Nx does
289
+ // not watch changed under the Nx daemon; otherwise the task's environment
290
+ // differs from the graph's, as through a dotenv file of the task.
291
+ // @mara implements DES-OUTPUTS
292
+ // @mara implements DES-DIAGNOSTICS
293
+ function checkPickedTriples(task, metadata, cwd, root, env) {
294
+ var _a;
295
+ const now = (0, target_triples_1.pickedTriples)(cwd, env);
296
+ const named = metadata.triples === undefined
297
+ ? { kind: "none" }
298
+ : { kind: "triples", triples: metadata.triples, files: [], fromEnv: false };
299
+ if ((0, target_triples_1.samePick)(now, named)) {
300
+ return;
301
+ }
302
+ const end = "The task does not run, so that Nx stores no result for it.";
303
+ const configured = (0, target_triples_1.configuredTriples)(cwd, env);
304
+ if ((0, target_triples_1.pickText)(configured) !== ((_a = metadata.configuredPick) !== null && _a !== void 0 ? _a : "none")) {
305
+ const source = configured.kind === "none"
306
+ ? "no file sets build.target any more"
307
+ : `${(0, target_triples_1.tripleSource)(configured, root)} now ${configured.kind === "unnamed" ? `picks ${JSON.stringify(configured.value)}` : `picks ${(0, target_triples_1.describeTriples)(configured)}`}`;
308
+ throw new TaskError([
309
+ `${task}: Cargo's configuration has changed since Nx created the project graph: ${source}, while the outputs of the cached ${metadata.target} name ${(0, target_triples_1.describeFolders)(named)}.`,
310
+ `Nx does not watch a configuration file outside the repository, such as the Cargo home's, so the graph that the Nx daemon keeps is out of date. Run \`nx reset\`, or stop the daemon with \`nx daemon --stop\`, and run the task again. ${end}`,
311
+ ].join("\n"));
312
+ }
313
+ if (now.kind === "unnamed") {
314
+ throw new TaskError(`${task}: ${(0, target_triples_1.unnamedTripleProblem)(now, root)}, and this run of the cached ${metadata.target} names no triple in the targetTriple option. Give the triple as the targetTriple option instead. ${end}`);
315
+ }
316
+ const source = now.kind === "none" ? "" : `, as ${(0, target_triples_1.tripleSource)(now, root)} picks`;
317
+ const option = now.kind === "triples" && now.triples.length === 1 ? `, --targetTriple=${now.triples[0]}` : "";
318
+ throw new TaskError([
319
+ `${task}: cargo builds this run of the cached ${metadata.target} for ${(0, target_triples_1.describeTriples)(now)}${source}, but its outputs name ${(0, target_triples_1.describeFolders)(named)}, as Cargo's configuration and the environment picked them when Nx created the graph.`,
320
+ `A CARGO_BUILD_TARGET that only a dotenv file of the task sets, such as a .env file in the crate's folder, is unknown when Nx creates the graph. Set it in the environment of the nx command or in the repository's root .env file, or give the triple as the targetTriple option${option}. ${end}`,
321
+ ].join("\n"));
322
+ }
323
+ // Fails a cached `build` or `doc` whose `targetTriple` option is a value
324
+ // for which cargo writes to another folder than the outputs name, which
325
+ // interpolate the option as the triple's folder (`DES-OUTPUTS`):
326
+ // `host-tuple`, for which cargo uses the host's triple, and a target
327
+ // specification file. The option arrives with the task, when Nx has decided
328
+ // to cache it already.
329
+ // @mara implements DES-OUTPUTS
330
+ // @mara implements DES-DIAGNOSTICS
331
+ function checkOptionTriple(task, target, triple, context, env) {
332
+ var _a, _b, _c, _d;
333
+ const reason = (0, target_triples_1.optionTripleReason)(triple);
334
+ if (reason === undefined) {
335
+ return;
336
+ }
337
+ const cause = `${task}: the targetTriple option of this run of the cached ${target} is ${JSON.stringify(triple)}, and @convesoft/nx-rust cannot name the folder that cargo writes to for this value: ${reason}. The task does not run, so that Nx stores no result for it.`;
338
+ if (triple === "host-tuple") {
339
+ const project = (_b = (_a = context.projectsConfigurations) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b[(_c = context.projectName) !== null && _c !== void 0 ? _c : ""];
340
+ const workspaceManifest = project === undefined ? undefined : (_d = (0, collisions_1.cargoMetadataOf)(project)) === null || _d === void 0 ? void 0 : _d.workspaceManifest;
341
+ const host = (0, host_triple_1.hostTriple)((0, node_path_1.join)(context.root, workspaceManifest === undefined ? "." : (0, node_path_1.dirname)(workspaceManifest)), env);
342
+ throw new TaskError(host === undefined
343
+ ? `${cause} Pass the host's triple itself in place of host-tuple, the value that \`rustc -vV\` prints after "host:".`
344
+ : `${cause} Pass the host's triple itself in place of host-tuple: --targetTriple=${host}.`);
345
+ }
346
+ const table = target === "doc"
347
+ ? "[workspace.metadata.nx.project.targets.doc] of the workspace's Cargo.toml"
348
+ : "[package.metadata.nx.targets.build] of the crate's Cargo.toml";
349
+ throw new TaskError(`${cause} Build with a built-in triple, or run the target uncached: set cache = false in ${table}, or in the target's configuration in a project.json.`);
350
+ }
351
+ // The warnings that graph creation recorded for the task's project, whose
352
+ // digest the task's key holds, then those that `createDependencies` found
353
+ // for the task's target, each once (`DES-DIAGNOSTICS`, "Warnings where they
354
+ // are seen"), and those about its workspace's Cargo configuration that Nx
355
+ // does not hash, which no key holds, so that a cache hit replays them as the
356
+ // run that stored the result printed them.
357
+ // @mara implements DES-DIAGNOSTICS
358
+ function projectWarnings(context) {
359
+ var _a, _b, _c;
360
+ const project = (_b = (_a = context.projectsConfigurations) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b[(_c = context.projectName) !== null && _c !== void 0 ? _c : ""];
361
+ const cargo = project === undefined ? undefined : (0, collisions_1.cargoMetadataOf)(project);
362
+ const warnings = [
363
+ ...(Array.isArray(cargo === null || cargo === void 0 ? void 0 : cargo.warnings) ? cargo.warnings : []),
364
+ ...(Array.isArray(cargo === null || cargo === void 0 ? void 0 : cargo.configurationWarnings) ? cargo.configurationWarnings : []),
365
+ ];
366
+ const targetWarnings = Array.isArray(cargo === null || cargo === void 0 ? void 0 : cargo.targetWarnings)
367
+ ? cargo.targetWarnings
368
+ : [];
369
+ return [
370
+ ...new Set([
371
+ ...warnings.filter((warning) => typeof warning === "string"),
372
+ ...targetWarnings.flatMap((entry) => {
373
+ const { target, warning } = (entry !== null && entry !== void 0 ? entry : {});
374
+ return target === context.targetName && typeof warning === "string" ? [warning] : [];
375
+ }),
376
+ ]),
377
+ ];
378
+ }
379
+ // The target's metadata from the plugin, or undefined where it is missing.
380
+ function targetMetadata(value) {
381
+ if (typeof value !== "object" || value === null) {
382
+ return undefined;
383
+ }
384
+ const { target, locked, uncached, triples, tripleProblem, configuredPick, artifactDirectory, directoryVariables: variables, members, digests, everyDigest, records, waitsForBuild, waitsForBuilds, napiAddon, napiHost, napiHeaderFile, sharedLibrary, testRunner, affectedTests, } = value;
385
+ return targets_1.inferredTargetNames.includes(target)
386
+ ? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ target: target, locked: locked === true }, (typeof uncached === "string" ? { uncached } : {})), (Array.isArray(triples) && triples.every((triple) => typeof triple === "string")
387
+ ? { triples: triples }
388
+ : {})), (typeof tripleProblem === "string" ? { tripleProblem } : {})), (typeof configuredPick === "string" ? { configuredPick } : {})), (typeof artifactDirectory === "string" ? { artifactDirectory } : {})), (typeof variables === "object" &&
389
+ variables !== null &&
390
+ Object.values(variables).every((entry) => typeof entry === "string")
391
+ ? { directoryVariables: variables }
392
+ : {})), (isPackageList(members) ? { members } : {})), (isPackageList(digests) ? { digests } : {})), (everyDigest === true ? { everyDigest } : {})), (isRecordSource(records) ? { records } : {})), (waitsForBuild === true ? { waitsForBuild } : {})), (Array.isArray(waitsForBuilds) &&
393
+ waitsForBuilds.every((root) => typeof root === "string")
394
+ ? { waitsForBuilds: waitsForBuilds }
395
+ : {})), (typeof napiAddon === "string" ? { napiAddon } : {})), (typeof napiHost === "string" ? { napiHost } : {})), (typeof napiHeaderFile === "string" ? { napiHeaderFile } : {})), (typeof sharedLibrary === "string" ? { sharedLibrary } : {})), (testRunner === "nextest" ? { testRunner } : {})), (affectedTests === true ? { affectedTests } : {})) : undefined;
396
+ }
397
+ // Whether a value has the shape of the record source that graph creation
398
+ // gives a crate's `build` (`buildRecordSource` in `build-records.ts`).
399
+ function isRecordSource(value) {
400
+ if (typeof value !== "object" || value === null) {
401
+ return false;
402
+ }
403
+ const { library, binaries, features, optionalDependencies, shared } = value;
404
+ const isStrings = (list) => Array.isArray(list) && list.every((item) => typeof item === "string");
405
+ return ((library === undefined ||
406
+ (typeof library === "object" &&
407
+ library !== null &&
408
+ typeof library.name === "string" &&
409
+ typeof library.procMacro === "boolean" &&
410
+ (library.crateTypes === undefined ||
411
+ isStrings(library.crateTypes)))) &&
412
+ Array.isArray(binaries) &&
413
+ binaries.every((binary) => typeof binary === "object" &&
414
+ binary !== null &&
415
+ typeof binary.name === "string" &&
416
+ isStrings(binary.requiredFeatures)) &&
417
+ typeof features === "object" &&
418
+ features !== null &&
419
+ Object.values(features).every(isStrings) &&
420
+ (optionalDependencies === undefined || isStrings(optionalDependencies)) &&
421
+ isStrings(shared));
422
+ }
423
+ function isPackageList(value) {
424
+ return (Array.isArray(value) &&
425
+ value.every((entry) => typeof entry === "object" &&
426
+ entry !== null &&
427
+ typeof entry.name === "string" &&
428
+ typeof entry.version === "string"));
429
+ }
430
+ //# sourceMappingURL=task-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-guards.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/task-guards.ts"],"names":[],"mappings":";;;AAwDA,0CAaC;AAoBD,0CAsCC;AAiBD,sDA4BC;AA2BD,0CAwCC;AAuDD,kCAQC;AAKD,8CAMC;AAUD,gCAaC;AAID,kCAEC;AAYD,gDA2CC;AAUD,8CAiCC;AASD,0CAmBC;AAGD,wCA2DC;AAjhBD,yCAA0C;AAC1C,sDAAkD;AAElD,4DAWiC;AAEjC,oDAAsD;AACtD,0DAAuD;AACvD,8CAK0B;AA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,QAAQ,KAAK,IAAI;QACjB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;QACxC,CAAC,oBAAoB,KAAK,SAAS,IAAI,SAAS,CAAC,oBAAoB,CAAC,CAAC;QACvE,SAAS,CAAC,MAAM,CAAC,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACpB,KAAK,CAAC,KAAK,CACT,CAAC,KAAK,EAAE,EAAE,CACR,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,KAAK,IAAI;YACd,OAAQ,KAAwB,CAAC,IAAI,KAAK,QAAQ;YAClD,OAAQ,KAAwB,CAAC,OAAO,KAAK,QAAQ,CACxD,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,114 @@
1
+ import type { Task } from "@nx/devkit";
2
+ import type { InferredTargetName } from "../graph/targets";
3
+ import { type CargoTargetOptions } from "./command";
4
+ /** What the comparison needs to know about the executor that runs a task. */
5
+ export interface ExecutorOptions {
6
+ /** The executor's full name, such as `@convesoft/nx-rust:cargo`. */
7
+ name: string;
8
+ /** How a warning line names it, such as `cargo` in "the cargo executor". */
9
+ shortName: string;
10
+ /** The options that its schema declares. */
11
+ declared: ReadonlySet<string>;
12
+ }
13
+ /** One task's options, and what tells where they came from. */
14
+ export interface OptionSubject {
15
+ /** The task as `nx show target` takes it, `<project>:<target>`. */
16
+ task: string;
17
+ /** The default name of the task's target. */
18
+ target: InferredTargetName;
19
+ /** The executor that runs the task. */
20
+ executor: ExecutorOptions;
21
+ /** The options that this invocation received. */
22
+ options: Readonly<Record<string, unknown>>;
23
+ /**
24
+ * The options that the target's configuration gives, before options from
25
+ * the command line or forwarded from another task: its `options` with the
26
+ * active configuration's laid over them, as Nx merges them.
27
+ */
28
+ configured: Readonly<Record<string, unknown>>;
29
+ /** The task that the task graph in the executor's context holds for this invocation, if any. */
30
+ graphTask: Task | undefined;
31
+ /** The arguments of the `nx` command, as the plugin's hook recorded them, if it did. */
32
+ record: readonly string[] | undefined;
33
+ /** The repository root, from which the installed `nx` package is resolved. */
34
+ workspaceRoot?: string;
35
+ }
36
+ /** What a task does with its options. */
37
+ export interface TaskOptions {
38
+ /** The options that the task's target takes, for its cargo command. */
39
+ options: CargoTargetOptions;
40
+ /** The binary's arguments, for `run`; empty for every other target. */
41
+ binaryArguments: string[];
42
+ /** One warning line per option that the task ignores, for the top of its output. */
43
+ warnings: string[];
44
+ }
45
+ /**
46
+ * An option's value that the task cannot use, such as an `args` that does
47
+ * not split into words; its message names the task and the option.
48
+ */
49
+ export declare class OptionError extends Error {
50
+ constructor(message: string);
51
+ }
52
+ /**
53
+ * Sorts a task's options into those its target takes and those it ignores,
54
+ * and gives `run` its binary's arguments (`DES-UNKNOWN-OPTIONS`).
55
+ *
56
+ * An option that the executor's schema does not declare, or that it declares
57
+ * but the target does not take ({@link targetTakes}), stays out of the
58
+ * command and gets one warning line ({@link ignoredOptionLine}). On `run`,
59
+ * the value of `args` and, when {@link forwardedArguments} finds them, the
60
+ * arguments after `--` on the command line go to the binary; none of the
61
+ * latter is taken as an option or gets a line.
62
+ *
63
+ * It looks at one task only, so that the batch implementation can call it
64
+ * for each task of a batch.
65
+ *
66
+ * @throws {OptionError} When `args` does not split into words.
67
+ */
68
+ export declare function taskOptions(subject: OptionSubject): TaskOptions;
69
+ /** Why a task ignores an option. */
70
+ export type IgnoredBecause = "unknown" | "not-taken";
71
+ /**
72
+ * The warning line for an option that a task ignores. It names the task and
73
+ * the option and says either that the option was passed on the command line,
74
+ * when {@link passedOnCommandLine} is sure of it, with what to do about the
75
+ * flag or words ({@link commandLineRemedy}), or that it comes from the
76
+ * workspace's configuration, with the command that shows where and the two
77
+ * fixes for a `targetDefaults` entry.
78
+ *
79
+ * Positional words, which Nx hands a task as the option `_`, are named as
80
+ * such.
81
+ */
82
+ export declare function ignoredOptionLine(subject: OptionSubject, name: string, value: unknown, because: IgnoredBecause): string;
83
+ /**
84
+ * Whether the option `name` with `value` was passed on the command line of
85
+ * the `nx` command, which holds only when three records agree
86
+ * (`DES-UNKNOWN-OPTIONS`, paragraph "Command line"):
87
+ *
88
+ * 1. The graph task holds the option among its overrides with the same value.
89
+ * 2. That task's own `__overrides_unparsed__` lists it as `--<name>`,
90
+ * `--<name>=<value>`, `--no-<name>` or, for a one-letter name,
91
+ * `-<name>`, before any `--` in that list.
92
+ * 3. The same flag is among the recorded arguments of the `nx` command.
93
+ *
94
+ * For `_`, the positional words, the list parsed as Nx parses it gives the
95
+ * same words, and each word of the list that can be positional is among the
96
+ * recorded arguments. Where Nx gave a declared option its camel-case name,
97
+ * the overrides and the flag may still have the spelling with dashes.
98
+ */
99
+ export declare function passedOnCommandLine(subject: OptionSubject, name: string, value: unknown): boolean;
100
+ /**
101
+ * The arguments after `--` on the command line that a `run` task passes to
102
+ * its binary, and the names under which the invocation's options hold what
103
+ * Nx parsed from them, or `undefined` when the task passes none. They are
104
+ * passed only when three conditions hold (`DES-UNKNOWN-OPTIONS`, paragraph
105
+ * "run"): the record has `--`; the graph task's own
106
+ * `__overrides_unparsed__` equals the recorded arguments after it; and the
107
+ * invocation's options hold every option that Nx parses from those
108
+ * arguments, apart from the executor's own, with the same value. A missing
109
+ * record counts as a command without `--`.
110
+ */
111
+ export declare function forwardedArguments(subject: OptionSubject): {
112
+ words: string[];
113
+ optionNames: string[];
114
+ } | undefined;