@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,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.groupInvocations = groupInvocations;
|
|
4
|
+
const directories_1 = require("../cargo/directories");
|
|
5
|
+
const package_specs_1 = require("../cargo/package-specs");
|
|
6
|
+
const real_path_1 = require("../graph/real-path");
|
|
7
|
+
const wasm_1 = require("../graph/wasm");
|
|
8
|
+
const optional_tools_1 = require("../tools/optional-tools");
|
|
9
|
+
const command_1 = require("./command");
|
|
10
|
+
const runner_script_1 = require("./runner-script");
|
|
11
|
+
const task_guards_1 = require("./task-guards");
|
|
12
|
+
/**
|
|
13
|
+
* Completes the cargo command of a group of prepared tasks, all of one
|
|
14
|
+
* workspace, kind, environment and command options (`TERM-GROUP`): asks
|
|
15
|
+
* cargo once for the package ID specifications of the group's crates,
|
|
16
|
+
* where its command selects them so (`DES-INVOCATION`), and once for
|
|
17
|
+
* Cargo's directories, where a task of the group is a cached `build` or
|
|
18
|
+
* `doc` or checks a build's inputs (`DES-OUTPUTS`, `DES-BUILD-INPUT-CHECK`),
|
|
19
|
+
* both in the workspace root with the group's environment, and checks each
|
|
20
|
+
* cached `build` and `doc` against the artifact directory its outputs name.
|
|
21
|
+
*
|
|
22
|
+
* The commands select the crates as `selection` says (`planGroups`):
|
|
23
|
+
* each with `-p`, or the whole workspace with `--workspace`, for which the
|
|
24
|
+
* group keeps every member that the report gives, and for `test` with the
|
|
25
|
+
* three steps and the selecting runner of `DES-TEST-RUN` ({@link cargoSteps}).
|
|
26
|
+
*
|
|
27
|
+
* @returns For each task, in order, the commands of the whole group with
|
|
28
|
+
* what the task does after it, or the message with which the task fails
|
|
29
|
+
* before cargo runs: cargo cannot report the specifications or the
|
|
30
|
+
* directories, the workspace has no member of the crate's name any more,
|
|
31
|
+
* or cargo reports another artifact directory than the outputs name.
|
|
32
|
+
* Every task of a group gets the same `args` where none fails.
|
|
33
|
+
*/
|
|
34
|
+
// @mara implements DES-INVOCATION
|
|
35
|
+
// @mara implements DES-OUTPUTS
|
|
36
|
+
// @mara implements DES-BATCH
|
|
37
|
+
// @mara implements DES-UNIFICATION
|
|
38
|
+
function groupInvocations(tasks, root, selection = { kind: "crates" }) {
|
|
39
|
+
var _a;
|
|
40
|
+
const [first] = tasks;
|
|
41
|
+
if (first === undefined) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const { cwd, env, workspaceRoot, target } = first;
|
|
45
|
+
// One report of Cargo's directories for the group, and then one of the
|
|
46
|
+
// members, where its command selects crates by their specifications: the
|
|
47
|
+
// order in which a task run on its own has always asked.
|
|
48
|
+
const directories = tasks.some((task) => task.artifactCheck !== undefined || task.records !== undefined || task.napi !== undefined)
|
|
49
|
+
? directoryReport(cwd, env)
|
|
50
|
+
: undefined;
|
|
51
|
+
const specs = (0, command_1.selectsBySpecification)(target) && tasks.some((task) => task.crate !== undefined)
|
|
52
|
+
? specReport(cwd, env)
|
|
53
|
+
: undefined;
|
|
54
|
+
const finished = tasks.map((task) => {
|
|
55
|
+
try {
|
|
56
|
+
const reached = directories instanceof directories_1.DirectoryReportError
|
|
57
|
+
? directoryFailure(task.task, directories)
|
|
58
|
+
: directories;
|
|
59
|
+
if (task.napi !== undefined && reached === undefined) {
|
|
60
|
+
throw new task_guards_1.TaskError(`${task.task}: cargo reported no directories for this napi-build.`);
|
|
61
|
+
}
|
|
62
|
+
if (task.artifactCheck !== undefined && reached !== undefined) {
|
|
63
|
+
checkArtifactDirectory(task.task, task.artifactCheck, cwd, root, env, reached);
|
|
64
|
+
}
|
|
65
|
+
const pkg = task.crate === undefined || !(0, command_1.selectsBySpecification)(task.target)
|
|
66
|
+
? undefined
|
|
67
|
+
: packageSpec(task.task, task.crate, workspaceRoot, specs);
|
|
68
|
+
const crate = task.crate === undefined
|
|
69
|
+
? undefined
|
|
70
|
+
: Object.assign({ name: task.crate }, (pkg === undefined ? {} : { spec: pkg.id }));
|
|
71
|
+
return Object.assign(Object.assign(Object.assign({}, (crate === undefined ? {} : { crate })), (pkg === undefined ? {} : { package: pkg })), (reached === undefined ? {} : { directories: reached }));
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
if (error instanceof task_guards_1.TaskError) {
|
|
75
|
+
return error.message;
|
|
76
|
+
}
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
// The command selects the crates of the tasks that passed their checks;
|
|
81
|
+
// a task that failed before cargo takes no part in it.
|
|
82
|
+
const crates = finished.flatMap((entry) => typeof entry === "string" || entry.crate === undefined ? [] : [entry.crate]);
|
|
83
|
+
const workspace = selection.kind === "workspace";
|
|
84
|
+
// nextest runs no runner of the plugin's (`DES-TEST-RUN`).
|
|
85
|
+
const runner = workspace && target === "test" && first.testRunner !== "nextest"
|
|
86
|
+
? { host: (_a = selection.host) !== null && _a !== void 0 ? _a : "", command: (0, runner_script_1.runnerCommand)() }
|
|
87
|
+
: undefined;
|
|
88
|
+
if (runner !== undefined && runner.host === "") {
|
|
89
|
+
throw new Error("A test group that selects the whole workspace needs the host's triple.");
|
|
90
|
+
}
|
|
91
|
+
const workspaceMembers = workspace && specs instanceof Map ? [...specs.values()] : undefined;
|
|
92
|
+
// A group that selects affected tests places changed files among every
|
|
93
|
+
// member (`DES-TEST-RUN`, step 2).
|
|
94
|
+
const affectedMembers = tasks.some((task) => { var _a; return ((_a = task.testMode) === null || _a === void 0 ? void 0 : _a.selects) === true; }) && specs instanceof Map
|
|
95
|
+
? [...specs.values()]
|
|
96
|
+
: undefined;
|
|
97
|
+
return tasks.map((task, index) => {
|
|
98
|
+
const entry = finished[index];
|
|
99
|
+
if (typeof entry === "string") {
|
|
100
|
+
return entry;
|
|
101
|
+
}
|
|
102
|
+
const steps = (0, command_1.cargoSteps)(Object.assign(Object.assign(Object.assign(Object.assign({ target: task.target }, (crates.length === 0 ? {} : { crates })), { locked: task.locked, binaryArguments: task.binaryArguments, workspace }), (task.testRunner === undefined ? {} : { testRunner: task.testRunner })), { workspaceUnification: task.featureUnification === "cargo" }), task.options, runner);
|
|
103
|
+
const args = steps[0].args;
|
|
104
|
+
const inputCheck = task.records !== undefined &&
|
|
105
|
+
task.crate !== undefined &&
|
|
106
|
+
task.manifest !== undefined &&
|
|
107
|
+
entry.directories !== undefined
|
|
108
|
+
? {
|
|
109
|
+
task: task.task,
|
|
110
|
+
crate: task.crate,
|
|
111
|
+
manifest: task.manifest,
|
|
112
|
+
// The compile of `wasm-build` builds the library alone, with
|
|
113
|
+
// `--lib`, and exports no record of a binary (`DES-WASM`).
|
|
114
|
+
records: task.target === "wasm-build" ? Object.assign(Object.assign({}, task.records), { binaries: [] }) : task.records,
|
|
115
|
+
directories: entry.directories,
|
|
116
|
+
// `wasm-build` passes the wasm triple with `--target` (`DES-WASM`).
|
|
117
|
+
selection: task.target === "wasm-build"
|
|
118
|
+
? Object.assign(Object.assign({}, task.options), { targetTriple: wasm_1.wasmTriple }) : task.options,
|
|
119
|
+
env,
|
|
120
|
+
cwd,
|
|
121
|
+
}
|
|
122
|
+
: undefined;
|
|
123
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ args,
|
|
124
|
+
steps,
|
|
125
|
+
cwd }, (workspaceMembers === undefined ? {} : { workspaceMembers })), (affectedMembers === undefined ? {} : { affectedMembers })), (runner === undefined ? {} : { runner: [...runner.command] })), (entry.crate === undefined ? {} : { crate: entry.crate })), (entry.package === undefined ? {} : { package: entry.package })), (task.digests === undefined ? {} : { digests: task.digests })), (inputCheck === undefined ? {} : { inputCheck })), (task.napi !== undefined && entry.directories !== undefined
|
|
126
|
+
? { directories: entry.directories }
|
|
127
|
+
: {}));
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// The members in the workspace root with the group's environment, as the
|
|
131
|
+
// group's command starts (`DES-INVOCATION`), from one report for the group.
|
|
132
|
+
function specReport(cwd, env) {
|
|
133
|
+
try {
|
|
134
|
+
return (0, package_specs_1.memberPackages)(cwd, env);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
if (error instanceof package_specs_1.PackageSpecReportError) {
|
|
138
|
+
return error;
|
|
139
|
+
}
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Cargo's directories in the workspace root with the group's environment,
|
|
144
|
+
// as physical paths, or why cargo could not report them.
|
|
145
|
+
function directoryReport(cwd, env) {
|
|
146
|
+
try {
|
|
147
|
+
const reported = (0, directories_1.reportedDirectories)(cwd, env);
|
|
148
|
+
return { artifact: (0, real_path_1.physicalPath)(reported.artifact), build: (0, real_path_1.physicalPath)(reported.build) };
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
if (error instanceof directories_1.DirectoryReportError) {
|
|
152
|
+
return error;
|
|
153
|
+
}
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// The package ID specification with which the task's command selects its
|
|
158
|
+
// crate: the one that cargo reports for the member of that name when it
|
|
159
|
+
// starts in the workspace root with the task's environment, as the command
|
|
160
|
+
// does (`DES-INVOCATION`). It holds the absolute path of the crate's folder
|
|
161
|
+
// and goes into the command only, into no input, output or option. A group
|
|
162
|
+
// asks cargo once for all its crates ({@link specReport}).
|
|
163
|
+
// @mara implements DES-INVOCATION
|
|
164
|
+
// @mara implements DES-DIAGNOSTICS
|
|
165
|
+
function packageSpec(task, packageName, workspaceRoot, specs) {
|
|
166
|
+
if (!(specs instanceof Map)) {
|
|
167
|
+
const failure = specs !== null && specs !== void 0 ? specs : new package_specs_1.PackageSpecReportError("no report was asked for", "");
|
|
168
|
+
const stderr = failure.stderr.trim();
|
|
169
|
+
throw new task_guards_1.TaskError([
|
|
170
|
+
`${task}: \`cargo metadata\` could not list the members of the Cargo workspace for this task, so @convesoft/nx-rust cannot name the crate ${packageName} to cargo: ${failure.message}.`,
|
|
171
|
+
...(stderr === "" ? [] : [stderr]),
|
|
172
|
+
"The task does not run, so that Nx stores no result for it. Correct what cargo reports, such as a manifest or a configuration file that it cannot read, and run the task again.",
|
|
173
|
+
].join("\n"));
|
|
174
|
+
}
|
|
175
|
+
const spec = specs.get(packageName);
|
|
176
|
+
if (spec === undefined) {
|
|
177
|
+
throw new task_guards_1.TaskError([
|
|
178
|
+
`${task}: the Cargo workspace in ${(0, optional_tools_1.describeFolder)(workspaceRoot)} has no member named ${packageName} any more, while the project graph still has the crate, so the graph is out of date. The task does not run, so that Nx stores no result for it.`,
|
|
179
|
+
"Run `nx reset`, or stop the daemon with `nx daemon --stop`, and run the task again.",
|
|
180
|
+
].join("\n"));
|
|
181
|
+
}
|
|
182
|
+
return spec;
|
|
183
|
+
}
|
|
184
|
+
// Cargo's directories for a task, which cargo reports with the task's
|
|
185
|
+
// environment in the folder where it will run, as physical paths: the
|
|
186
|
+
// artifact directory that it writes to, and the build directory, whose
|
|
187
|
+
// files the check of `DES-BUILD-INPUT-CHECK` leaves out.
|
|
188
|
+
// @mara implements DES-BUILD-INPUT-CHECK
|
|
189
|
+
function taskDirectories(task, cwd, env) {
|
|
190
|
+
const report = directoryReport(cwd, env);
|
|
191
|
+
return report instanceof directories_1.DirectoryReportError ? directoryFailure(task, report) : report;
|
|
192
|
+
}
|
|
193
|
+
// Fails a task whose cargo could not report Cargo's directories.
|
|
194
|
+
function directoryFailure(task, error) {
|
|
195
|
+
const stderr = error.stderr.trim();
|
|
196
|
+
throw new task_guards_1.TaskError([
|
|
197
|
+
`${task}: \`cargo metadata\` could not report Cargo's directories for this task, so @convesoft/nx-rust cannot tell where cargo puts its files: ${error.message}.`,
|
|
198
|
+
...(stderr === "" ? [] : [stderr]),
|
|
199
|
+
"The task does not run, so that Nx stores no result for it. Correct what cargo reports, such as a manifest or a configuration file that it cannot read, and run the task again.",
|
|
200
|
+
].join("\n"));
|
|
201
|
+
}
|
|
202
|
+
// Fails a cached `build` or `doc` for which cargo reports, with the task's
|
|
203
|
+
// environment, another artifact directory than the one whose folders its
|
|
204
|
+
// outputs name, which graph creation recorded: cargo would write elsewhere,
|
|
205
|
+
// and Nx would store what lies at the declared paths, an older artifact or
|
|
206
|
+
// nothing, under the task's key (`DES-OUTPUTS`). Where the variables that
|
|
207
|
+
// move the directory, `CARGO_TARGET_DIR`, `CARGO_BUILD_TARGET_DIR` and
|
|
208
|
+
// `CARGO_HOME`, have the values that graph creation saw, or those values
|
|
209
|
+
// give another directory as well, Cargo's configuration has changed since
|
|
210
|
+
// graph creation, as a file that Nx does not watch can under the Nx daemon;
|
|
211
|
+
// otherwise the task's environment moves it, as a dotenv file of the task
|
|
212
|
+
// does. A group asks cargo once for its directories ({@link directoryReport}).
|
|
213
|
+
// @mara implements DES-OUTPUTS
|
|
214
|
+
// @mara implements DES-DIAGNOSTICS
|
|
215
|
+
function checkArtifactDirectory(task, metadata, cwd, root, env, directories) {
|
|
216
|
+
var _a;
|
|
217
|
+
const named = metadata.artifactDirectory;
|
|
218
|
+
const now = (0, real_path_1.repositoryFolder)(directories.artifact, root);
|
|
219
|
+
if (now.inside && now.path === named) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const end = "The task does not run, so that Nx stores no result for it.";
|
|
223
|
+
const graphVariables = (_a = metadata.directoryVariables) !== null && _a !== void 0 ? _a : {};
|
|
224
|
+
const taskVariables = (0, directories_1.directoryVariables)(env);
|
|
225
|
+
const moved = directories_1.directoryVariableNames.filter((name) => taskVariables[name] !== graphVariables[name]);
|
|
226
|
+
const graphEnv = Object.assign({}, env);
|
|
227
|
+
for (const name of directories_1.directoryVariableNames) {
|
|
228
|
+
if (graphVariables[name] === undefined) {
|
|
229
|
+
delete graphEnv[name];
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
graphEnv[name] = graphVariables[name];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const byVariables = moved.length === 0
|
|
236
|
+
? undefined
|
|
237
|
+
: (0, real_path_1.repositoryFolder)(taskDirectories(task, cwd, graphEnv).artifact, root);
|
|
238
|
+
if (byVariables === undefined || !byVariables.inside || byVariables.path !== named) {
|
|
239
|
+
throw new task_guards_1.TaskError([
|
|
240
|
+
`${task}: Cargo's configuration has changed since Nx created the project graph: cargo now puts the artifacts of this run in ${now.path}${now.inside ? "" : ", outside the repository"}, while the outputs of the cached ${metadata.target} name the artifact directory ${named}.`,
|
|
241
|
+
`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. ${end} Run \`nx reset\`, or stop the daemon with \`nx daemon --stop\`, and run the task again.`,
|
|
242
|
+
].join("\n"));
|
|
243
|
+
}
|
|
244
|
+
const shown = (value) => value === undefined ? "unset" : JSON.stringify(value);
|
|
245
|
+
const variables = moved
|
|
246
|
+
.map((name) => `${name} is ${shown(taskVariables[name])} in the task's environment and was ${shown(graphVariables[name])} when Nx created the graph`)
|
|
247
|
+
.join(", and ");
|
|
248
|
+
throw new task_guards_1.TaskError([
|
|
249
|
+
`${task}: cargo puts the artifacts of this run of the cached ${metadata.target} in ${now.path}${now.inside ? "" : ", outside the repository"}, but its outputs name the artifact directory ${named}: ${variables}.`,
|
|
250
|
+
`A variable that only a dotenv file of the task sets, such as a .env file in the crate's or the workspace's folder or a root .env.build, .env.doc or .env.<configuration>, is unknown when Nx creates the graph. ${end} Set the variable in the environment of the nx command or in the repository's root .env file, or set the folder as build.target-dir in a .cargo/config.toml of the workspace instead.`,
|
|
251
|
+
].join("\n"));
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=group-invocations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-invocations.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/group-invocations.ts"],"names":[],"mappings":";;AAuGA,4CA4IC;AAnPD,sDAM8B;AAE9B,0DAAgF;AAChF,kDAAoE;AAEpE,wCAA2C;AAC3C,4DAAyD;AAEzD,uCAMmB;AAGnB,mDAAgD;AAEhD,+CAA2D;AAoD3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,kCAAkC;AAClC,+BAA+B;AAC/B,6BAA6B;AAC7B,mCAAmC;AACnC,SAAgB,gBAAgB,CAC9B,KAA8B,EAC9B,IAAY,EACZ,YAA4B,EAAE,IAAI,EAAE,QAAQ,EAAE;;IAE9C,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IACtB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAClD,uEAAuE;IACvE,yEAAyE;IACzE,yDAAyD;IACzD,MAAM,WAAW,GAAwD,KAAK,CAAC,IAAI,CACjF,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAC5F;QACC,CAAC,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC;QAC3B,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,KAAK,GACT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A0F;SAChP,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,KAAyB,EAAE,EAAE,CAC1C,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,KAAK;SACpB,GAAG,CACF,CAAC,IAAI,EAAE,EAAE,CACP,GAAG,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,sCAAsC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,4BAA4B,CACxI;SACA,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClB,MAAM,IAAI,uBAAS,CACjB;QACE,GAAG,IAAI,wDAAwD,QAAQ,CAAC,MAAM,OAAO,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,0BAA0B,iDAAiD,KAAK,KAAK,SAAS,GAAG;QACnN,mNAAmN,GAAG,uLAAuL;KAC9Y,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { ExecutorContext } from "@nx/devkit";
|
|
2
|
+
import type { CargoPackage } from "../cargo/metadata";
|
|
3
|
+
import type { CrateSelection } from "./affected";
|
|
4
|
+
import { type CargoStep } from "./command";
|
|
5
|
+
import { type GroupInvocation, type PreparedTask } from "./task";
|
|
6
|
+
import { type RunnerRecords } from "./test-steps";
|
|
7
|
+
/** A task of a group whose checks before cargo passed, with the group's command. */
|
|
8
|
+
export interface GroupMember {
|
|
9
|
+
/** The task as its checks before cargo left it. */
|
|
10
|
+
prepared: PreparedTask;
|
|
11
|
+
/** The group's command, and what the task does after it ({@link groupInvocations}). */
|
|
12
|
+
invocation: GroupInvocation;
|
|
13
|
+
/** The task's own executor context, for the checks after cargo. */
|
|
14
|
+
context: ExecutorContext;
|
|
15
|
+
}
|
|
16
|
+
/** The result of one task of a group. */
|
|
17
|
+
export interface MemberResult {
|
|
18
|
+
/** Whether the task passed every step of its group and the checks after them. */
|
|
19
|
+
success: boolean;
|
|
20
|
+
/** The task's part of each step's output, in order, with the plugin's lines after it. */
|
|
21
|
+
output: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* What a batch shows of cargo's output while a group's command runs, besides
|
|
25
|
+
* each task's result (`DES-BATCH`, "Cargo's output while a batch runs"):
|
|
26
|
+
*
|
|
27
|
+
* - `lines`: cargo's lines as they arrive, on the batch process's standard
|
|
28
|
+
* error, where Nx's terminal UI shows them in the batch's pane;
|
|
29
|
+
* - `status`: one line each time a cargo command starts, naming the command,
|
|
30
|
+
* its crates and the step;
|
|
31
|
+
* - `none`: nothing, as for a task run on its own, whose output is its own.
|
|
32
|
+
*
|
|
33
|
+
* Neither line belongs to a task: no task's stored output changes.
|
|
34
|
+
*/
|
|
35
|
+
export type LiveOutput = "lines" | "status" | "none";
|
|
36
|
+
/**
|
|
37
|
+
* What a batch process shows of cargo's output while it runs
|
|
38
|
+
* ({@link LiveOutput}): its lines under Nx's terminal UI, which Nx tells the
|
|
39
|
+
* batch process with `NX_TUI=true`, and a status line in every other output
|
|
40
|
+
* style, which the batch process cannot tell apart (`EVD-NX-24-BATCHES`,
|
|
41
|
+
* "Terminal output"). The maintainer chose this on 15 November 2026.
|
|
42
|
+
*
|
|
43
|
+
* @param batchEnv The batch process's own environment.
|
|
44
|
+
*/
|
|
45
|
+
export declare function batchLiveOutput(batchEnv: NodeJS.ProcessEnv): LiveOutput;
|
|
46
|
+
/**
|
|
47
|
+
* Runs a group of tasks (`TERM-GROUP`): one cargo command for each step of
|
|
48
|
+
* their target, in the workspace root with the group's environment, and the
|
|
49
|
+
* checks that follow cargo for each task whose crate passed every step
|
|
50
|
+
* (`DES-BATCH`).
|
|
51
|
+
*
|
|
52
|
+
* Cargo's standard output and error go to one file, so that the output
|
|
53
|
+
* keeps the order in which cargo and the test executables wrote it, and only
|
|
54
|
+
* what {@link LiveOutput} asks for reaches the batch process's own output,
|
|
55
|
+
* which belongs to no task (`EVD-NX-24-BATCHES`).
|
|
56
|
+
*
|
|
57
|
+
* Each step runs even where a step before it failed for some crates, and a
|
|
58
|
+
* step is left out where no crate of the group can take part any more:
|
|
59
|
+
* where every task has failed, and for the doctests where no crate of the
|
|
60
|
+
* group has a library. A group of one crate, and a group of one task that
|
|
61
|
+
* selects its crate, runs the command that its task runs on its own and
|
|
62
|
+
* passes where cargo exits with status 0, with the whole output as its own.
|
|
63
|
+
* A group that selects the whole workspace, and a group of several crates,
|
|
64
|
+
* reads which crates passed from cargo's output ({@link readJsonStep},
|
|
65
|
+
* {@link readTestStep} and the steps of `test-steps.ts`); a step whose
|
|
66
|
+
* output shows no result per crate, such as that of `cargo fmt`, fails
|
|
67
|
+
* every task of the group when cargo fails. A task passes only where cargo's
|
|
68
|
+
* output shows that its crate passed.
|
|
69
|
+
*
|
|
70
|
+
* Then each task whose crate passed runs the checks that a task run on its
|
|
71
|
+
* own runs after cargo (`DES-LOCKFILE-HASHING`, "Post-check";
|
|
72
|
+
* `DES-BUILD-INPUT-CHECK`), so that no task of a batch skips one.
|
|
73
|
+
*
|
|
74
|
+
* In a verbose run, each command's lines are printed once, before cargo
|
|
75
|
+
* starts, with a first line that names the tasks of the command, so that
|
|
76
|
+
* they belong to no task's output in a batch (`DES-INVOCATION`, "Printing
|
|
77
|
+
* the command"): from the invocation that cargo is started with, through
|
|
78
|
+
* {@link printCommand}.
|
|
79
|
+
*
|
|
80
|
+
* @param members The tasks of one group, all with the same command.
|
|
81
|
+
* @param verbose Whether the run is verbose: as `batchRunsVerbosely`
|
|
82
|
+
* decides once for the batch, or `taskRunsVerbosely` for a task on its own.
|
|
83
|
+
* @param live What the batch shows of cargo's output while it runs.
|
|
84
|
+
* @param observe Receives each step's whole output once cargo has ended, as
|
|
85
|
+
* `napi-build` and `wasm-build` need it for the library that cargo
|
|
86
|
+
* reports (`DES-NAPI`, `DES-WASM`).
|
|
87
|
+
* @returns One result per member, in order.
|
|
88
|
+
*/
|
|
89
|
+
export declare function runGroup(members: readonly GroupMember[], verbose?: boolean, live?: LiveOutput, observe?: (step: CargoStep, output: string) => void): Promise<MemberResult[]>;
|
|
90
|
+
/**
|
|
91
|
+
* The line that says what a task of an affected group runs and why
|
|
92
|
+
* (`REQ-AFFECTED-TESTS`): all its tests, the tests that cargo-affected
|
|
93
|
+
* selected, with every integration test where its binary may have changed,
|
|
94
|
+
* or none, and why that is enough.
|
|
95
|
+
*/
|
|
96
|
+
export declare function selectionLine(task: string, crate: string, selection: CrateSelection | undefined, baseline: string): string;
|
|
97
|
+
/**
|
|
98
|
+
* The checks after cargo of a task that shared its group's command with
|
|
99
|
+
* other tasks: under `hakari`, the post-check compares the digests of every
|
|
100
|
+
* member, although the task's key holds its own, because its result rests
|
|
101
|
+
* on the drift check, which judged the whole lockfile (`DES-LOCKFILE-HASHING`,
|
|
102
|
+
* "Post-check"). Under the other strategies the key holds them already.
|
|
103
|
+
*/
|
|
104
|
+
export declare function sharedCommandChecks(invocation: GroupInvocation): GroupInvocation;
|
|
105
|
+
/**
|
|
106
|
+
* Whether a crate has a library, whose doctests the doctest step runs; cargo
|
|
107
|
+
* fails `cargo test --doc` for a crate without one.
|
|
108
|
+
*/
|
|
109
|
+
export declare function hasLibrary(pkg: CargoPackage | undefined): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* What the selecting runner recorded in `folder` ({@link RunnerRecords}):
|
|
112
|
+
* one record per file, each a start followed by what came after it.
|
|
113
|
+
*/
|
|
114
|
+
export declare function readRecords(folder: string): RunnerRecords;
|