@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.
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +48 -2
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +26 -4
- package/src/cargo/build-settings.d.ts +54 -0
- package/src/cargo/build-settings.js +93 -0
- package/src/cargo/build-settings.js.map +1 -0
- package/src/cargo/configured-runner.d.ts +36 -0
- package/src/cargo/configured-runner.js +99 -0
- package/src/cargo/configured-runner.js.map +1 -0
- package/src/cargo/configured-tools.d.ts +35 -0
- package/src/cargo/configured-tools.js +46 -0
- package/src/cargo/configured-tools.js.map +1 -0
- package/src/cargo/dep-info-basedir.d.ts +18 -0
- package/src/cargo/dep-info-basedir.js +38 -0
- package/src/cargo/dep-info-basedir.js.map +1 -0
- package/src/cargo/directories.d.ts +40 -0
- package/src/cargo/directories.js +89 -0
- package/src/cargo/directories.js.map +1 -0
- package/src/cargo/host-triple.d.ts +7 -0
- package/src/cargo/host-triple.js +21 -0
- package/src/cargo/host-triple.js.map +1 -0
- package/src/cargo/lockfile.d.ts +63 -0
- package/src/cargo/lockfile.js +157 -0
- package/src/cargo/lockfile.js.map +1 -0
- package/src/cargo/metadata.d.ts +112 -0
- package/src/cargo/metadata.js +37 -0
- package/src/cargo/metadata.js.map +1 -0
- package/src/cargo/package-specs.d.ts +54 -0
- package/src/cargo/package-specs.js +109 -0
- package/src/cargo/package-specs.js.map +1 -0
- package/src/cargo/paths-crates.d.ts +27 -0
- package/src/cargo/paths-crates.js +69 -0
- package/src/cargo/paths-crates.js.map +1 -0
- package/src/cargo/print-artifact-folders.d.ts +1 -0
- package/src/cargo/print-artifact-folders.js +58 -0
- package/src/cargo/print-artifact-folders.js.map +1 -0
- package/src/cargo/redirections.d.ts +87 -0
- package/src/cargo/redirections.js +195 -0
- package/src/cargo/redirections.js.map +1 -0
- package/src/cargo/run-cargo.d.ts +31 -0
- package/src/cargo/run-cargo.js +75 -0
- package/src/cargo/run-cargo.js.map +1 -0
- package/src/cargo/target-triples.d.ts +98 -0
- package/src/cargo/target-triples.js +265 -0
- package/src/cargo/target-triples.js.map +1 -0
- package/src/cargo/version-req.d.ts +12 -0
- package/src/cargo/version-req.js +122 -0
- package/src/cargo/version-req.js.map +1 -0
- package/src/compatibility/cargo-version.d.ts +43 -0
- package/src/compatibility/cargo-version.js +83 -0
- package/src/compatibility/cargo-version.js.map +1 -0
- package/src/compatibility/nx-bridge.d.ts +312 -0
- package/src/compatibility/nx-bridge.js +407 -0
- package/src/compatibility/nx-bridge.js.map +1 -0
- package/src/compatibility/nx-version.d.ts +104 -0
- package/src/compatibility/nx-version.js +272 -0
- package/src/compatibility/nx-version.js.map +1 -0
- package/src/executors/affected-inputs.d.ts +29 -0
- package/src/executors/affected-inputs.js +259 -0
- package/src/executors/affected-inputs.js.map +1 -0
- package/src/executors/affected-run.d.ts +54 -0
- package/src/executors/affected-run.js +394 -0
- package/src/executors/affected-run.js.map +1 -0
- package/src/executors/affected.d.ts +239 -0
- package/src/executors/affected.js +589 -0
- package/src/executors/affected.js.map +1 -0
- package/src/executors/baseline-context.d.ts +85 -0
- package/src/executors/baseline-context.js +227 -0
- package/src/executors/baseline-context.js.map +1 -0
- package/src/executors/baseline.d.ts +123 -0
- package/src/executors/baseline.js +356 -0
- package/src/executors/baseline.js.map +1 -0
- package/src/executors/batch.d.ts +75 -0
- package/src/executors/batch.js +434 -0
- package/src/executors/batch.js.map +1 -0
- package/src/executors/build-records.d.ts +110 -0
- package/src/executors/build-records.js +267 -0
- package/src/executors/build-records.js.map +1 -0
- package/src/executors/cargo/executor.d.ts +28 -0
- package/src/executors/cargo/executor.js +58 -0
- package/src/executors/cargo/executor.js.map +1 -0
- package/src/executors/cargo/schema.json +54 -0
- package/src/executors/cargo-invocation.d.ts +81 -0
- package/src/executors/cargo-invocation.js +109 -0
- package/src/executors/cargo-invocation.js.map +1 -0
- package/src/executors/cargo-output.d.ts +212 -0
- package/src/executors/cargo-output.js +646 -0
- package/src/executors/cargo-output.js.map +1 -0
- package/src/executors/command.d.ts +318 -0
- package/src/executors/command.js +517 -0
- package/src/executors/command.js.map +1 -0
- package/src/executors/coverage-baseline.d.ts +23 -0
- package/src/executors/coverage-baseline.js +284 -0
- package/src/executors/coverage-baseline.js.map +1 -0
- package/src/executors/declared-options.d.ts +21 -0
- package/src/executors/declared-options.js +58 -0
- package/src/executors/declared-options.js.map +1 -0
- package/src/executors/digests.d.ts +94 -0
- package/src/executors/digests.js +190 -0
- package/src/executors/digests.js.map +1 -0
- package/src/executors/dotenv-check.d.ts +79 -0
- package/src/executors/dotenv-check.js +553 -0
- package/src/executors/dotenv-check.js.map +1 -0
- package/src/executors/group-invocations.d.ts +80 -0
- package/src/executors/group-invocations.js +253 -0
- package/src/executors/group-invocations.js.map +1 -0
- package/src/executors/group-run.d.ts +114 -0
- package/src/executors/group-run.js +591 -0
- package/src/executors/group-run.js.map +1 -0
- package/src/executors/groups.d.ts +113 -0
- package/src/executors/groups.js +285 -0
- package/src/executors/groups.js.map +1 -0
- package/src/executors/input-check.d.ts +52 -0
- package/src/executors/input-check.js +271 -0
- package/src/executors/input-check.js.map +1 -0
- package/src/executors/kept-files.d.ts +98 -0
- package/src/executors/kept-files.js +341 -0
- package/src/executors/kept-files.js.map +1 -0
- package/src/executors/lockfile/executor.d.ts +16 -0
- package/src/executors/lockfile/executor.js +37 -0
- package/src/executors/lockfile/executor.js.map +1 -0
- package/src/executors/lockfile/schema.json +50 -0
- package/src/executors/napi-build.d.ts +73 -0
- package/src/executors/napi-build.js +420 -0
- package/src/executors/napi-build.js.map +1 -0
- package/src/executors/nextest.d.ts +185 -0
- package/src/executors/nextest.js +498 -0
- package/src/executors/nextest.js.map +1 -0
- package/src/executors/nx-command.d.ts +95 -0
- package/src/executors/nx-command.js +205 -0
- package/src/executors/nx-command.js.map +1 -0
- package/src/executors/nx-task-files.d.ts +82 -0
- package/src/executors/nx-task-files.js +156 -0
- package/src/executors/nx-task-files.js.map +1 -0
- package/src/executors/print-test-mode.d.ts +1 -0
- package/src/executors/print-test-mode.js +25 -0
- package/src/executors/print-test-mode.js.map +1 -0
- package/src/executors/release-publish/executor.d.ts +24 -0
- package/src/executors/release-publish/executor.js +165 -0
- package/src/executors/release-publish/executor.js.map +1 -0
- package/src/executors/release-publish/schema.json +30 -0
- package/src/executors/run/executor.d.ts +12 -0
- package/src/executors/run/executor.js +27 -0
- package/src/executors/run/executor.js.map +1 -0
- package/src/executors/run/schema.json +45 -0
- package/src/executors/runner-script.d.ts +12 -0
- package/src/executors/runner-script.js +22 -0
- package/src/executors/runner-script.js.map +1 -0
- package/src/executors/runtime-input-check.d.ts +24 -0
- package/src/executors/runtime-input-check.js +87 -0
- package/src/executors/runtime-input-check.js.map +1 -0
- package/src/executors/shared-artifacts.d.ts +44 -0
- package/src/executors/shared-artifacts.js +132 -0
- package/src/executors/shared-artifacts.js.map +1 -0
- package/src/executors/split-words.d.ts +24 -0
- package/src/executors/split-words.js +111 -0
- package/src/executors/split-words.js.map +1 -0
- package/src/executors/stage.d.ts +163 -0
- package/src/executors/stage.js +526 -0
- package/src/executors/stage.js.map +1 -0
- package/src/executors/staged-run.d.ts +24 -0
- package/src/executors/staged-run.js +110 -0
- package/src/executors/staged-run.js.map +1 -0
- package/src/executors/task-env.d.ts +271 -0
- package/src/executors/task-env.js +494 -0
- package/src/executors/task-env.js.map +1 -0
- package/src/executors/task-execution.d.ts +61 -0
- package/src/executors/task-execution.js +122 -0
- package/src/executors/task-execution.js.map +1 -0
- package/src/executors/task-guards.d.ts +112 -0
- package/src/executors/task-guards.js +430 -0
- package/src/executors/task-guards.js.map +1 -0
- package/src/executors/task-options.d.ts +114 -0
- package/src/executors/task-options.js +258 -0
- package/src/executors/task-options.js.map +1 -0
- package/src/executors/task.d.ts +166 -0
- package/src/executors/task.js +520 -0
- package/src/executors/task.js.map +1 -0
- package/src/executors/test-mode.d.ts +182 -0
- package/src/executors/test-mode.js +391 -0
- package/src/executors/test-mode.js.map +1 -0
- package/src/executors/test-runner.d.ts +44 -0
- package/src/executors/test-runner.js +159 -0
- package/src/executors/test-runner.js.map +1 -0
- package/src/executors/test-steps.d.ts +109 -0
- package/src/executors/test-steps.js +535 -0
- package/src/executors/test-steps.js.map +1 -0
- package/src/executors/wasm-build.d.ts +56 -0
- package/src/executors/wasm-build.js +216 -0
- package/src/executors/wasm-build.js.map +1 -0
- package/src/generators/crate/binary.schema.json +28 -0
- package/src/generators/crate/crate.d.ts +24 -0
- package/src/generators/crate/crate.js +108 -0
- package/src/generators/crate/crate.js.map +1 -0
- package/src/generators/crate/enclosing-workspace.d.ts +25 -0
- package/src/generators/crate/enclosing-workspace.js +58 -0
- package/src/generators/crate/enclosing-workspace.js.map +1 -0
- package/src/generators/crate/library.schema.json +28 -0
- package/src/generators/init/graph-check.d.ts +81 -0
- package/src/generators/init/graph-check.js +299 -0
- package/src/generators/init/graph-check.js.map +1 -0
- package/src/generators/init/init.d.ts +23 -0
- package/src/generators/init/init.js +113 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/report.d.ts +19 -0
- package/src/generators/init/report.js +93 -0
- package/src/generators/init/report.js.map +1 -0
- package/src/generators/init/schema.json +9 -0
- package/src/graph/artifact-kinds.d.ts +29 -0
- package/src/graph/artifact-kinds.js +50 -0
- package/src/graph/artifact-kinds.js.map +1 -0
- package/src/graph/artifact-names.d.ts +97 -0
- package/src/graph/artifact-names.js +276 -0
- package/src/graph/artifact-names.js.map +1 -0
- package/src/graph/build-records.d.ts +74 -0
- package/src/graph/build-records.js +104 -0
- package/src/graph/build-records.js.map +1 -0
- package/src/graph/caching.d.ts +148 -0
- package/src/graph/caching.js +676 -0
- package/src/graph/caching.js.map +1 -0
- package/src/graph/collisions.d.ts +106 -0
- package/src/graph/collisions.js +156 -0
- package/src/graph/collisions.js.map +1 -0
- package/src/graph/computation-reports.d.ts +89 -0
- package/src/graph/computation-reports.js +216 -0
- package/src/graph/computation-reports.js.map +1 -0
- package/src/graph/declared-files.d.ts +190 -0
- package/src/graph/declared-files.js +600 -0
- package/src/graph/declared-files.js.map +1 -0
- package/src/graph/discovery.d.ts +175 -0
- package/src/graph/discovery.js +656 -0
- package/src/graph/discovery.js.map +1 -0
- package/src/graph/edges.d.ts +25 -0
- package/src/graph/edges.js +94 -0
- package/src/graph/edges.js.map +1 -0
- package/src/graph/entries.d.ts +83 -0
- package/src/graph/entries.js +259 -0
- package/src/graph/entries.js.map +1 -0
- package/src/graph/inputs.d.ts +420 -0
- package/src/graph/inputs.js +746 -0
- package/src/graph/inputs.js.map +1 -0
- package/src/graph/lockfile-task.d.ts +74 -0
- package/src/graph/lockfile-task.js +105 -0
- package/src/graph/lockfile-task.js.map +1 -0
- package/src/graph/names.d.ts +41 -0
- package/src/graph/names.js +34 -0
- package/src/graph/names.js.map +1 -0
- package/src/graph/napi.d.ts +107 -0
- package/src/graph/napi.js +206 -0
- package/src/graph/napi.js.map +1 -0
- package/src/graph/nx-glob.d.ts +36 -0
- package/src/graph/nx-glob.js +152 -0
- package/src/graph/nx-glob.js.map +1 -0
- package/src/graph/nx-internals.d.ts +57 -0
- package/src/graph/nx-internals.js +128 -0
- package/src/graph/nx-internals.js.map +1 -0
- package/src/graph/options.d.ts +32 -0
- package/src/graph/options.js +80 -0
- package/src/graph/options.js.map +1 -0
- package/src/graph/outputs.d.ts +75 -0
- package/src/graph/outputs.js +140 -0
- package/src/graph/outputs.js.map +1 -0
- package/src/graph/path-dependencies.d.ts +122 -0
- package/src/graph/path-dependencies.js +459 -0
- package/src/graph/path-dependencies.js.map +1 -0
- package/src/graph/plugin-package.d.ts +36 -0
- package/src/graph/plugin-package.js +132 -0
- package/src/graph/plugin-package.js.map +1 -0
- package/src/graph/plugin-version.d.ts +20 -0
- package/src/graph/plugin-version.js +153 -0
- package/src/graph/plugin-version.js.map +1 -0
- package/src/graph/projects.d.ts +141 -0
- package/src/graph/projects.js +182 -0
- package/src/graph/projects.js.map +1 -0
- package/src/graph/reached-projects.d.ts +46 -0
- package/src/graph/reached-projects.js +102 -0
- package/src/graph/reached-projects.js.map +1 -0
- package/src/graph/real-path.d.ts +47 -0
- package/src/graph/real-path.js +113 -0
- package/src/graph/real-path.js.map +1 -0
- package/src/graph/redirected-uses.d.ts +98 -0
- package/src/graph/redirected-uses.js +434 -0
- package/src/graph/redirected-uses.js.map +1 -0
- package/src/graph/registration.d.ts +121 -0
- package/src/graph/registration.js +233 -0
- package/src/graph/registration.js.map +1 -0
- package/src/graph/script-input.d.ts +46 -0
- package/src/graph/script-input.js +65 -0
- package/src/graph/script-input.js.map +1 -0
- package/src/graph/settings.d.ts +178 -0
- package/src/graph/settings.js +479 -0
- package/src/graph/settings.js.map +1 -0
- package/src/graph/target-defaults-causes.d.ts +33 -0
- package/src/graph/target-defaults-causes.js +202 -0
- package/src/graph/target-defaults-causes.js.map +1 -0
- package/src/graph/target-defaults-layers.d.ts +186 -0
- package/src/graph/target-defaults-layers.js +420 -0
- package/src/graph/target-defaults-layers.js.map +1 -0
- package/src/graph/target-defaults-meaning.d.ts +95 -0
- package/src/graph/target-defaults-meaning.js +292 -0
- package/src/graph/target-defaults-meaning.js.map +1 -0
- package/src/graph/target-defaults-report.d.ts +77 -0
- package/src/graph/target-defaults-report.js +242 -0
- package/src/graph/target-defaults-report.js.map +1 -0
- package/src/graph/target-defaults.d.ts +79 -0
- package/src/graph/target-defaults.js +425 -0
- package/src/graph/target-defaults.js.map +1 -0
- package/src/graph/target-fields.d.ts +16 -0
- package/src/graph/target-fields.js +134 -0
- package/src/graph/target-fields.js.map +1 -0
- package/src/graph/target-tables.d.ts +45 -0
- package/src/graph/target-tables.js +299 -0
- package/src/graph/target-tables.js.map +1 -0
- package/src/graph/targets.d.ts +367 -0
- package/src/graph/targets.js +404 -0
- package/src/graph/targets.js.map +1 -0
- package/src/graph/unification.d.ts +141 -0
- package/src/graph/unification.js +459 -0
- package/src/graph/unification.js.map +1 -0
- package/src/graph/unignored-directories.d.ts +25 -0
- package/src/graph/unignored-directories.js +89 -0
- package/src/graph/unignored-directories.js.map +1 -0
- package/src/graph/visibility.d.ts +17 -0
- package/src/graph/visibility.js +67 -0
- package/src/graph/visibility.js.map +1 -0
- package/src/graph/warnings.d.ts +38 -0
- package/src/graph/warnings.js +77 -0
- package/src/graph/warnings.js.map +1 -0
- package/src/graph/wasm.d.ts +56 -0
- package/src/graph/wasm.js +77 -0
- package/src/graph/wasm.js.map +1 -0
- package/src/index.d.ts +68 -0
- package/src/index.js +109 -0
- package/src/index.js.map +1 -0
- package/src/release/manifests.d.ts +95 -0
- package/src/release/manifests.js +164 -0
- package/src/release/manifests.js.map +1 -0
- package/src/release/places.d.ts +127 -0
- package/src/release/places.js +368 -0
- package/src/release/places.js.map +1 -0
- package/src/release/publish-cargo.d.ts +177 -0
- package/src/release/publish-cargo.js +351 -0
- package/src/release/publish-cargo.js.map +1 -0
- package/src/release/publish-crates.d.ts +124 -0
- package/src/release/publish-crates.js +242 -0
- package/src/release/publish-crates.js.map +1 -0
- package/src/release/publish-environments.d.ts +50 -0
- package/src/release/publish-environments.js +284 -0
- package/src/release/publish-environments.js.map +1 -0
- package/src/release/publish-messages.d.ts +66 -0
- package/src/release/publish-messages.js +273 -0
- package/src/release/publish-messages.js.map +1 -0
- package/src/release/publish-registry.d.ts +27 -0
- package/src/release/publish-registry.js +135 -0
- package/src/release/publish-registry.js.map +1 -0
- package/src/release/publish-settings.d.ts +26 -0
- package/src/release/publish-settings.js +56 -0
- package/src/release/publish-settings.js.map +1 -0
- package/src/release/publish.d.ts +59 -0
- package/src/release/publish.js +620 -0
- package/src/release/publish.js.map +1 -0
- package/src/release/repository.d.ts +73 -0
- package/src/release/repository.js +219 -0
- package/src/release/repository.js.map +1 -0
- package/src/release/requirements.d.ts +34 -0
- package/src/release/requirements.js +30 -0
- package/src/release/requirements.js.map +1 -0
- package/src/release/toml-edit.d.ts +67 -0
- package/src/release/toml-edit.js +453 -0
- package/src/release/toml-edit.js.map +1 -0
- package/src/release/version-actions.d.ts +133 -0
- package/src/release/version-actions.js +474 -0
- package/src/release/version-actions.js.map +1 -0
- package/src/release/version-checks.d.ts +21 -0
- package/src/release/version-checks.js +151 -0
- package/src/release/version-checks.js.map +1 -0
- package/src/release/version-lockfiles.d.ts +61 -0
- package/src/release/version-lockfiles.js +222 -0
- package/src/release/version-lockfiles.js.map +1 -0
- package/src/tools/napi-cli.d.ts +70 -0
- package/src/tools/napi-cli.js +63 -0
- package/src/tools/napi-cli.js.map +1 -0
- package/src/tools/optional-tools.d.ts +121 -0
- package/src/tools/optional-tools.js +303 -0
- package/src/tools/optional-tools.js.map +1 -0
- package/src/tools/print-napi-cli.d.ts +1 -0
- package/src/tools/print-napi-cli.js +24 -0
- package/src/tools/print-napi-cli.js.map +1 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hakariCheckFailure = hakariCheckFailure;
|
|
4
|
+
exports.checksAfterCargo = checksAfterCargo;
|
|
5
|
+
exports.runCargo = runCargo;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const cargo_invocation_1 = require("./cargo-invocation");
|
|
9
|
+
const digests_1 = require("./digests");
|
|
10
|
+
const input_check_1 = require("./input-check");
|
|
11
|
+
const nx_task_files_1 = require("./nx-task-files");
|
|
12
|
+
/**
|
|
13
|
+
* The message of a failed `hakari-check`, after cargo-hakari's own output
|
|
14
|
+
* (`DES-UNIFICATION`, "Drift"; `DES-DIAGNOSTICS`): which command failed, and
|
|
15
|
+
* that running `cargo hakari generate` and `cargo hakari manage-deps` and
|
|
16
|
+
* committing the result brings the hack crate up to date.
|
|
17
|
+
*/
|
|
18
|
+
// @mara implements DES-DIAGNOSTICS
|
|
19
|
+
function hakariCheckFailure(task, args) {
|
|
20
|
+
return `${task}: \`cargo ${args.join(" ")}\` failed, so the hack crate of cargo-hakari is not current, or cargo-hakari could not read the package graph, as its output above says. No task of the workspace's crates that depends on this check runs, so that Nx stores no result for them. Run \`cargo hakari generate\` and \`cargo hakari manage-deps\` in the workspace root and commit the result.`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The checks of a task after its cargo call has succeeded, in one step
|
|
24
|
+
* (`DES-LOCKFILE-HASHING`, "Post-check"): first what the task does with the
|
|
25
|
+
* lockfile's digests, which the lockfile task writes and a cached task
|
|
26
|
+
* computes again, then, on a crate's `build`, the comparison of the files
|
|
27
|
+
* that cargo recorded with the task's inputs (`DES-BUILD-INPUT-CHECK`). Both
|
|
28
|
+
* run, so that a failed task names every problem at once.
|
|
29
|
+
*
|
|
30
|
+
* @returns The failure messages, without which the task succeeds, and the
|
|
31
|
+
* warning that the input check did not run, for the task's output.
|
|
32
|
+
*/
|
|
33
|
+
// @mara implements DES-LOCKFILE-HASHING
|
|
34
|
+
// @mara implements DES-BUILD-INPUT-CHECK
|
|
35
|
+
function checksAfterCargo(invocation, context) {
|
|
36
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
const failures = [];
|
|
39
|
+
const warnings = [];
|
|
40
|
+
const step = invocation.digests;
|
|
41
|
+
const digestFailure = step === undefined
|
|
42
|
+
? undefined
|
|
43
|
+
: step.kind === "write"
|
|
44
|
+
? (0, digests_1.writeDigests)(`${(_a = context.projectName) !== null && _a !== void 0 ? _a : ""}:${(_b = context.targetName) !== null && _b !== void 0 ? _b : ""}`, step)
|
|
45
|
+
: (0, digests_1.checkDigests)(step);
|
|
46
|
+
if (digestFailure !== undefined) {
|
|
47
|
+
failures.push(digestFailure);
|
|
48
|
+
}
|
|
49
|
+
const check = invocation.inputCheck;
|
|
50
|
+
if (check !== undefined) {
|
|
51
|
+
// Where the installed Nx lacks a part that the check needs, which only
|
|
52
|
+
// an Nx that the plugin does not support can, the task warns and the
|
|
53
|
+
// check does not run (`DES-DIAGNOSTICS`).
|
|
54
|
+
try {
|
|
55
|
+
const parts = (0, nx_task_files_1.nxTaskFileParts)(context.root);
|
|
56
|
+
const inputFailure = yield (0, input_check_1.checkBuildInputs)(check, context.root, () => (0, nx_task_files_1.nxTaskFiles)(parts, context));
|
|
57
|
+
if (inputFailure !== undefined) {
|
|
58
|
+
failures.push(inputFailure);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (!(error instanceof nx_task_files_1.NxTaskFilesError)) {
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
warnings.push((0, nx_task_files_1.skippedCheckWarning)(check.task, error));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return { failures, warnings };
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Runs cargo for a task with the task's environment and the variables of the
|
|
73
|
+
* invocation, which no command of this version has, and with the task's
|
|
74
|
+
* standard streams. Signals that stop the executor reach cargo too.
|
|
75
|
+
*
|
|
76
|
+
* @param taskEnv The task's environment without the variables by which Nx
|
|
77
|
+
* tells it how it runs and records it (`cargoTaskEnvironment`).
|
|
78
|
+
*
|
|
79
|
+
* Unlike graph creation (`runCargoForGraph`), a task sets no
|
|
80
|
+
* `RUSTUP_AUTO_INSTALL`, so rustup behaves as for plain cargo.
|
|
81
|
+
*
|
|
82
|
+
* @param shownFor In a verbose run, the task whose command it is: the
|
|
83
|
+
* command's lines ({@link printCommand}), built from the same invocation,
|
|
84
|
+
* go to standard error before cargo starts (`DES-INVOCATION`, "Printing the
|
|
85
|
+
* command"). Undefined in every other run, which prints nothing of it.
|
|
86
|
+
* @returns Whether cargo exited with status 0.
|
|
87
|
+
*/
|
|
88
|
+
// @mara implements DES-INVOCATION
|
|
89
|
+
function runCargo(invocation, taskEnv, shownFor) {
|
|
90
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
if (shownFor !== undefined) {
|
|
92
|
+
// Written out before cargo starts, whose output goes to the same streams.
|
|
93
|
+
yield (0, cargo_invocation_1.printCommand)(shownFor, invocation);
|
|
94
|
+
}
|
|
95
|
+
return new Promise((resolve) => {
|
|
96
|
+
const child = (0, node_child_process_1.spawn)("cargo", invocation.args, {
|
|
97
|
+
cwd: invocation.cwd,
|
|
98
|
+
env: (0, cargo_invocation_1.cargoEnvironment)(invocation, taskEnv),
|
|
99
|
+
stdio: "inherit",
|
|
100
|
+
});
|
|
101
|
+
const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
102
|
+
const forward = (signal) => child.kill(signal);
|
|
103
|
+
for (const signal of signals) {
|
|
104
|
+
process.on(signal, forward);
|
|
105
|
+
}
|
|
106
|
+
const finish = (success) => {
|
|
107
|
+
for (const signal of signals) {
|
|
108
|
+
process.off(signal, forward);
|
|
109
|
+
}
|
|
110
|
+
resolve(success);
|
|
111
|
+
};
|
|
112
|
+
child.on("error", (error) => {
|
|
113
|
+
console.error(error.code === "ENOENT"
|
|
114
|
+
? `cargo was not found on PATH (${error.message}).`
|
|
115
|
+
: `cargo could not be started: ${error.message}`);
|
|
116
|
+
finish(false);
|
|
117
|
+
});
|
|
118
|
+
child.on("close", (code) => finish(code === 0));
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=task-execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-execution.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/task-execution.ts"],"names":[],"mappings":";;AAsCA,gDAEC;AAeD,4CAqCC;AAoBD,4BAoCC;;AAnJD,2DAA2C;AAC3C,yDAA0F;AAC1F,uCAAuD;AACvD,+CAAuE;AACvE,mDAKyB;AAqBzB;;;;;GAKG;AACH,mCAAmC;AACnC,SAAgB,kBAAkB,CAAC,IAAY,EAAE,IAAuB;IACtE,OAAO,GAAG,IAAI,aAAa,IAAI,CAAC,IAA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AAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAC/B,CAAC;gBACD,OAAO,CAAC,OAAO,CAAC,CAAC;YACnB,CAAC,CAAC;YACF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAA4B,EAAE,EAAE;gBACjD,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,IAAI,KAAK,QAAQ;oBACrB,CAAC,CAAC,gCAAgC,KAAK,CAAC,OAAO,IAAI;oBACnD,CAAC,CAAC,+BAA+B,KAAK,CAAC,OAAO,EAAE,CACnD,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;CAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { ExecutorContext, Task } from "@nx/devkit";
|
|
2
|
+
import type { PackageVersion } from "../cargo/lockfile";
|
|
3
|
+
import { type InferredTargetName, type TargetCargoMetadata } from "../graph/targets";
|
|
4
|
+
import type { CargoTargetOptions } from "./command";
|
|
5
|
+
import type { DigestCheck, DigestWrite } from "./digests";
|
|
6
|
+
import { type TaskShape } from "./task-env";
|
|
7
|
+
import type { ExecutorOptions } from "./task-options";
|
|
8
|
+
/** A problem that stops a task before cargo runs; its message is what the task prints. */
|
|
9
|
+
export declare class TaskError extends Error {
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* One of the plugin's executors, by the name under which `executors.json`
|
|
14
|
+
* lists it, with the options that its schema declares.
|
|
15
|
+
*/
|
|
16
|
+
export interface PluginExecutor extends ExecutorOptions {
|
|
17
|
+
/** Whether the executor runs the target with this default name. */
|
|
18
|
+
serves(target: InferredTargetName): boolean;
|
|
19
|
+
}
|
|
20
|
+
/** What a task does with digests after its cargo call (`TaskInvocation.digests`). */
|
|
21
|
+
export type DigestStep = ({
|
|
22
|
+
kind: "write";
|
|
23
|
+
} & DigestWrite) | ({
|
|
24
|
+
kind: "check";
|
|
25
|
+
} & DigestCheck);
|
|
26
|
+
/**
|
|
27
|
+
* What `cargoTaskEnvironment` needs to know of a task run on its own:
|
|
28
|
+
* its configuration, and whether it waits for a continuous task that
|
|
29
|
+
* reports ready by signal, for which Nx sets `NX_READY_URL`
|
|
30
|
+
* ({@link readyUrlProducers}).
|
|
31
|
+
*/
|
|
32
|
+
export declare function singleTaskShape(context: ExecutorContext): TaskShape;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the key of a task whose target hashes digests holds them, so that
|
|
35
|
+
* the task checks them after cargo's call (`DES-LOCKFILE-HASHING`,
|
|
36
|
+
* "Post-check"): the lockfile task that it depends on, by its id, with the
|
|
37
|
+
* members that its metadata names, from which a key that holds every
|
|
38
|
+
* member's digest takes them, or `undefined`. A run that excludes task dependencies, which the plugin's
|
|
39
|
+
* hook marks with a new `NX_RUST_RUN_ID`, runs no lockfile task, and the
|
|
40
|
+
* task's key, which holds that value, is never computed again, so nothing
|
|
41
|
+
* is checked. A task invoked outside a task graph that holds it, such as
|
|
42
|
+
* through another executor, is keyed as that graph says and is not checked
|
|
43
|
+
* either.
|
|
44
|
+
*
|
|
45
|
+
* @throws {TaskError} When the task graph holds the task without its
|
|
46
|
+
* dependency on the lockfile task of its workspace while the run does not
|
|
47
|
+
* exclude task dependencies: its key then holds no digest, and the task
|
|
48
|
+
* fails before cargo runs, so that Nx stores no result for it.
|
|
49
|
+
*/
|
|
50
|
+
export declare function keyHoldsDigests(context: ExecutorContext, workspaceManifest: string, env: NodeJS.ProcessEnv): {
|
|
51
|
+
id: string;
|
|
52
|
+
members?: PackageVersion[];
|
|
53
|
+
} | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Fails a cached crate task of a workspace that uses `hakari` before cargo
|
|
56
|
+
* runs where its task graph holds no dependency on the workspace's
|
|
57
|
+
* `hakari-check`, in a run that does not exclude task dependencies
|
|
58
|
+
* (`DES-UNIFICATION`, "Drift"): its key holds the hack crate's manifest in
|
|
59
|
+
* place of the other members', which stands for them only while the drift
|
|
60
|
+
* check passes, so that nothing would have checked the hack crate. The
|
|
61
|
+
* caller runs it only where {@link keyHoldsDigests} found the lockfile task
|
|
62
|
+
* in such a run.
|
|
63
|
+
*
|
|
64
|
+
* @throws {TaskError} Naming the workspace and how to find what replaced the
|
|
65
|
+
* task's `dependsOn` (`DES-DIAGNOSTICS`).
|
|
66
|
+
*/
|
|
67
|
+
export declare function checkHakariDependency(context: ExecutorContext, workspaceManifest: string): void;
|
|
68
|
+
/**
|
|
69
|
+
* Fails a crate's `test` before cargo runs where its cargo commands replace
|
|
70
|
+
* the executables that a crate's `build` declares, and the task graph holds
|
|
71
|
+
* a task of that `build` that Nx neither finishes before the `test` starts
|
|
72
|
+
* nor starts only after the `test` has finished ({@link finishesBefore}),
|
|
73
|
+
* as where a `project.json`, a target table or a `targetDefaults` entry
|
|
74
|
+
* replaces the `dependsOn` that the plugin infers for `test` (`DES-TARGETS`,
|
|
75
|
+
* "Guard"). The crates are those whose `build` the plugin makes the `test`
|
|
76
|
+
* wait for, `roots` (`testBuilds` in `targets.ts`): under
|
|
77
|
+
* `workspace-build`, every crate of the workspace with a binary and an
|
|
78
|
+
* integration test or bench, the test's own crate among them where it is
|
|
79
|
+
* one, because a `cargo test` of the whole workspace replaces the
|
|
80
|
+
* executables of each (`ADR-WORKSPACE-TEST-EXECUTABLES`). Nx could then run
|
|
81
|
+
* the two at the same time, store the test's executable under the key of
|
|
82
|
+
* `build`, or let the tests run the executable of `build` and store their
|
|
83
|
+
* result (`DES-OUTPUTS`). A run whose graph holds no such `build`, such as
|
|
84
|
+
* `nx test <crate>` with the dependency removed, or one without `build`
|
|
85
|
+
* under `--exclude-task-dependencies`, has nothing to order and passes. A
|
|
86
|
+
* task invoked outside a task graph that holds it is not checked.
|
|
87
|
+
*
|
|
88
|
+
* @param roots The roots of the crates whose `build` the test waits for.
|
|
89
|
+
* @throws {TaskError} Naming the `build` tasks, the reason and the fix.
|
|
90
|
+
*/
|
|
91
|
+
export declare function checkBuildOrder(task: string, context: ExecutorContext, roots: readonly string[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* The task that the task graph in the executor's context holds for this
|
|
94
|
+
* invocation: the one of the same project, target and configuration. Nx
|
|
95
|
+
* gives a task's configuration, its target's `defaultConfiguration` where the
|
|
96
|
+
* command names none, to the task in the graph and to the context alike.
|
|
97
|
+
*/
|
|
98
|
+
export declare function graphTaskOf(context: ExecutorContext): Task | undefined;
|
|
99
|
+
export declare function configuredOptions(context: ExecutorContext): Record<string, unknown>;
|
|
100
|
+
/**
|
|
101
|
+
* Whether a task runs in locked mode: the `locked` option of the plugin
|
|
102
|
+
* entry, unless `NX_RUST_LOCKED` is set to `true` or `false` for the run
|
|
103
|
+
* (`DES-INVOCATION`). An empty variable counts as unset.
|
|
104
|
+
*
|
|
105
|
+
* @throws {TaskError} When the variable has any other value.
|
|
106
|
+
*/
|
|
107
|
+
export declare function lockedMode(option: boolean, variable: string | undefined): boolean;
|
|
108
|
+
export declare function namesTriple(options: CargoTargetOptions): boolean;
|
|
109
|
+
export declare function checkPickedTriples(task: string, metadata: TargetCargoMetadata, cwd: string, root: string, env: NodeJS.ProcessEnv): void;
|
|
110
|
+
export declare function checkOptionTriple(task: string, target: InferredTargetName, triple: string, context: ExecutorContext, env: NodeJS.ProcessEnv): void;
|
|
111
|
+
export declare function projectWarnings(context: ExecutorContext): string[];
|
|
112
|
+
export declare function targetMetadata(value: unknown): TargetCargoMetadata | undefined;
|