@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.
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +47 -1
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +17 -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,517 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nextestToolName = exports.maxFiltersetBytes = exports.workspaceUnificationFlags = exports.hakariCheckSteps = exports.pluginVersionOption = exports.optionTargets = void 0;
|
|
4
|
+
exports.targetTakes = targetTakes;
|
|
5
|
+
exports.selectsWorkspace = selectsWorkspace;
|
|
6
|
+
exports.cargoArguments = cargoArguments;
|
|
7
|
+
exports.sharedCommandFlags = sharedCommandFlags;
|
|
8
|
+
exports.reportsLibrary = reportsLibrary;
|
|
9
|
+
exports.selectsBySpecification = selectsBySpecification;
|
|
10
|
+
exports.crateSelection = crateSelection;
|
|
11
|
+
exports.nextestFiltersets = nextestFiltersets;
|
|
12
|
+
exports.withToolConfiguration = withToolConfiguration;
|
|
13
|
+
exports.compilingFlags = compilingFlags;
|
|
14
|
+
exports.nextestListArguments = nextestListArguments;
|
|
15
|
+
exports.cargoSteps = cargoSteps;
|
|
16
|
+
const targets_1 = require("../graph/targets");
|
|
17
|
+
const wasm_1 = require("../graph/wasm");
|
|
18
|
+
// The targets that take the feature and profile options, and those that
|
|
19
|
+
// also take `targetTriple`: not `test` and the coverage baseline, which runs
|
|
20
|
+
// the tests, and not `napi-build`, which build for the host only in v1
|
|
21
|
+
// (`ADR-V1-SCOPE`), nor `wasm-build`, which always builds for the wasm
|
|
22
|
+
// triple (`DES-WASM`).
|
|
23
|
+
const tripleTargets = targets_1.compilingTargets.filter((target) => target !== "test" &&
|
|
24
|
+
target !== "coverage-baseline" &&
|
|
25
|
+
target !== "napi-build" &&
|
|
26
|
+
target !== "wasm-build");
|
|
27
|
+
/**
|
|
28
|
+
* The targets that take each option, by their default names, as the option
|
|
29
|
+
* reference of `DES-PLUGIN-OPTIONS` gives them. A task of another target
|
|
30
|
+
* ignores the option, also where its executor's schema declares it, because
|
|
31
|
+
* one schema serves every target of the cargo executor, and a target table
|
|
32
|
+
* in Cargo metadata that sets it fails graph creation
|
|
33
|
+
* (`DES-UNKNOWN-OPTIONS`).
|
|
34
|
+
*/
|
|
35
|
+
// @mara implements DES-PLUGIN-OPTIONS
|
|
36
|
+
exports.optionTargets = {
|
|
37
|
+
features: new Set(targets_1.compilingTargets),
|
|
38
|
+
allFeatures: new Set(targets_1.compilingTargets),
|
|
39
|
+
noDefaultFeatures: new Set(targets_1.compilingTargets),
|
|
40
|
+
profile: new Set(targets_1.compilingTargets),
|
|
41
|
+
targetTriple: new Set(tripleTargets),
|
|
42
|
+
allTargets: new Set(["check", "lint"]),
|
|
43
|
+
noDeps: new Set(["doc"]),
|
|
44
|
+
bin: new Set(["run"]),
|
|
45
|
+
args: new Set(["run"]),
|
|
46
|
+
affectedTests: new Set(["test"]),
|
|
47
|
+
wasmTarget: new Set(["wasm-build"]),
|
|
48
|
+
fullCollect: new Set(["coverage-baseline"]),
|
|
49
|
+
diffOnly: new Set(["coverage-baseline"]),
|
|
50
|
+
fullCollectThreshold: new Set(["coverage-baseline"]),
|
|
51
|
+
separateBuildDir: new Set(["coverage-baseline"]),
|
|
52
|
+
pluginVersion: new Set(targets_1.inferredTargetNames),
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The option that the plugin sets itself, to carry its version into the
|
|
56
|
+
* cache key where Nx has no node for its package (`DES-PLUGIN-OPTIONS`). A
|
|
57
|
+
* target table in Cargo metadata may not set it.
|
|
58
|
+
*/
|
|
59
|
+
exports.pluginVersionOption = "pluginVersion";
|
|
60
|
+
/** Whether the target with this default name takes the option `name`. */
|
|
61
|
+
function targetTakes(target, name) {
|
|
62
|
+
return (Object.prototype.hasOwnProperty.call(exports.optionTargets, name) &&
|
|
63
|
+
exports.optionTargets[name].has(target));
|
|
64
|
+
}
|
|
65
|
+
// The per-crate targets whose commands compile the crate, and which select
|
|
66
|
+
// the whole workspace under `workspace-build`; `fmt` and `fmt-check` resolve
|
|
67
|
+
// no features and keep selecting their crates (`DES-TARGET-COMMANDS`).
|
|
68
|
+
const compilingCrateTargets = new Set([
|
|
69
|
+
"build",
|
|
70
|
+
"check",
|
|
71
|
+
"lint",
|
|
72
|
+
"test",
|
|
73
|
+
"napi-build",
|
|
74
|
+
"wasm-build",
|
|
75
|
+
]);
|
|
76
|
+
/**
|
|
77
|
+
* Whether a group of tasks of the target with this default name selects the
|
|
78
|
+
* whole workspace with `--workspace` under `workspace-build` on the host:
|
|
79
|
+
* `build`, `check`, `lint` and `test`, whose commands compile their crates
|
|
80
|
+
* with features that the selection would otherwise narrow
|
|
81
|
+
* (`DES-UNIFICATION`). `bench` never joins a batch (`DES-TARGETS`), and
|
|
82
|
+
* `cargo fmt` resolves no features.
|
|
83
|
+
*/
|
|
84
|
+
function selectsWorkspace(target) {
|
|
85
|
+
return compilingCrateTargets.has(target);
|
|
86
|
+
}
|
|
87
|
+
// The cargo subcommand of each per-crate target and its own flags, before the
|
|
88
|
+
// package selection (`DES-TARGET-COMMANDS`).
|
|
89
|
+
const crateCommands = {
|
|
90
|
+
build: ["build"],
|
|
91
|
+
// The compile steps of `napi-build` and `wasm-build`, plain `cargo build`
|
|
92
|
+
// commands (`DES-NAPI`, `DES-WASM`).
|
|
93
|
+
"napi-build": ["build"],
|
|
94
|
+
// `--lib`: a binary of the crate built for the wasm triple writes
|
|
95
|
+
// `<name>.wasm` too, over the library's (`EVD-WASM-POSTPROCESS`).
|
|
96
|
+
"wasm-build": ["build", "--lib"],
|
|
97
|
+
check: ["check"],
|
|
98
|
+
lint: ["clippy"],
|
|
99
|
+
test: ["test"],
|
|
100
|
+
"fmt-check": ["fmt", "--check"],
|
|
101
|
+
fmt: ["fmt"],
|
|
102
|
+
bench: ["bench"],
|
|
103
|
+
run: ["run"],
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The arguments after `cargo` of the command that a task of an inferred
|
|
107
|
+
* target runs in its workspace's root folder.
|
|
108
|
+
*
|
|
109
|
+
* A crate's targets select it with `-p` as {@link crateSelection} says, and
|
|
110
|
+
* the workspace project's targets address the whole workspace. Apart from that,
|
|
111
|
+
* a flag comes only from an option that the target takes
|
|
112
|
+
* ({@link optionTargets}), so that the command is the one that a developer
|
|
113
|
+
* types in the workspace root (`DES-INVOCATION`); `run` passes the binary's
|
|
114
|
+
* arguments after `--`, and the lockfile task runs `cargo update
|
|
115
|
+
* --workspace` (`DES-LOCKFILE-HASHING`). In locked mode every command passes `--locked`,
|
|
116
|
+
* apart from `update`, whose purpose is to change `Cargo.lock`, `fmt` and
|
|
117
|
+
* `fmt-check`, because `cargo fmt` rejects the flag, and `audit`, because
|
|
118
|
+
* cargo-audit only reads the lockfile and has no such flag; cargo-deny takes
|
|
119
|
+
* it before its `check`.
|
|
120
|
+
*
|
|
121
|
+
* @throws {Error} When a crate's target has no crate, or no specification
|
|
122
|
+
* where its command takes one.
|
|
123
|
+
*/
|
|
124
|
+
// @mara implements DES-INVOCATION
|
|
125
|
+
// @mara implements DES-TARGET-COMMANDS
|
|
126
|
+
// @mara implements DES-WORKSPACE-TARGETS
|
|
127
|
+
// @mara implements REQ-TEST-RUNNER
|
|
128
|
+
function cargoArguments(subject, options) {
|
|
129
|
+
var _a;
|
|
130
|
+
const { target, crates, locked } = subject;
|
|
131
|
+
const taken = Object.fromEntries(Object.entries(options).filter(([name]) => targetTakes(target, name)));
|
|
132
|
+
if (target === "test" && subject.testRunner === "nextest") {
|
|
133
|
+
return nextestArguments(subject, taken);
|
|
134
|
+
}
|
|
135
|
+
const crateCommand = crateCommands[target];
|
|
136
|
+
if (crateCommand !== undefined) {
|
|
137
|
+
if (crates === undefined || crates.length === 0) {
|
|
138
|
+
throw new Error(`The target "${target}" runs for a crate, and the project has none.`);
|
|
139
|
+
}
|
|
140
|
+
const formatting = target === "fmt" || target === "fmt-check";
|
|
141
|
+
const binaryArguments = target === "run" ? ((_a = subject.binaryArguments) !== null && _a !== void 0 ? _a : []) : [];
|
|
142
|
+
const workspace = subject.workspace === true && selectsWorkspace(target);
|
|
143
|
+
return [
|
|
144
|
+
...crateCommand,
|
|
145
|
+
...flag(taken.allTargets, "--all-targets"),
|
|
146
|
+
// The compiles of the artifact targets always print cargo's JSON
|
|
147
|
+
// messages, from which the plugin takes the library that it
|
|
148
|
+
// post-processes (`DES-NAPI`, `DES-WASM`).
|
|
149
|
+
...(crates.length > 1 || workspace || reportsLibrary(target)
|
|
150
|
+
? sharedCommandFlags(target)
|
|
151
|
+
: []),
|
|
152
|
+
...(workspace ? ["--workspace"] : crateSelection(target, crates)),
|
|
153
|
+
...compilingFlags(taken),
|
|
154
|
+
...(target === "wasm-build" ? ["--target", wasm_1.wasmTriple] : []),
|
|
155
|
+
...(formatting ? [] : unificationFlags(subject)),
|
|
156
|
+
...(taken.bin !== undefined ? ["--bin", taken.bin] : []),
|
|
157
|
+
...flag(locked && !formatting, "--locked"),
|
|
158
|
+
...(binaryArguments.length > 0 ? ["--", ...binaryArguments] : []),
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
switch (target) {
|
|
162
|
+
case "doc":
|
|
163
|
+
return [
|
|
164
|
+
"doc",
|
|
165
|
+
...flag(taken.noDeps, "--no-deps"),
|
|
166
|
+
"--workspace",
|
|
167
|
+
...compilingFlags(taken),
|
|
168
|
+
...unificationFlags(subject),
|
|
169
|
+
...flag(locked, "--locked"),
|
|
170
|
+
];
|
|
171
|
+
case "hakari-check":
|
|
172
|
+
return [...exports.hakariCheckSteps[0]];
|
|
173
|
+
case "audit":
|
|
174
|
+
return ["audit"];
|
|
175
|
+
case "deny":
|
|
176
|
+
return ["deny", ...flag(locked, "--locked"), "check"];
|
|
177
|
+
case "update":
|
|
178
|
+
return ["update"];
|
|
179
|
+
case "lockfile":
|
|
180
|
+
return ["update", "--workspace", ...flag(locked, "--locked")];
|
|
181
|
+
}
|
|
182
|
+
throw new Error(`nx-rust has no command for the target "${target}".`);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* The commands of `hakari-check`, after `cargo`, in the order in which it
|
|
186
|
+
* runs them (`DES-UNIFICATION`, "Drift"): neither writes a file, and
|
|
187
|
+
* cargo-hakari takes no `--locked`.
|
|
188
|
+
*/
|
|
189
|
+
exports.hakariCheckSteps = [
|
|
190
|
+
["hakari", "generate", "--diff"],
|
|
191
|
+
["hakari", "manage-deps", "--dry-run"],
|
|
192
|
+
];
|
|
193
|
+
/**
|
|
194
|
+
* The flags with which every command that compiles resolves features for
|
|
195
|
+
* the whole workspace under the `cargo` strategy (`DES-UNIFICATION`, "How
|
|
196
|
+
* each strategy selects"): the setting on the command line, which stable
|
|
197
|
+
* cargo ignores with a warning, and the unstable flag, which stable cargo
|
|
198
|
+
* rejects, so that a task on a stable toolchain fails with cargo's error
|
|
199
|
+
* instead of compiling with narrowed features.
|
|
200
|
+
*/
|
|
201
|
+
// @mara implements DES-UNIFICATION
|
|
202
|
+
exports.workspaceUnificationFlags = [
|
|
203
|
+
"--config",
|
|
204
|
+
'resolver.feature-unification="workspace"',
|
|
205
|
+
"-Zfeature-unification",
|
|
206
|
+
];
|
|
207
|
+
// The flags of the `cargo` strategy, where the subject uses it.
|
|
208
|
+
function unificationFlags(subject) {
|
|
209
|
+
return subject.workspaceUnification === true ? [...exports.workspaceUnificationFlags] : [];
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The flags that a command for several crates, or for the whole workspace,
|
|
213
|
+
* adds, so that cargo goes on after a crate fails and its output shows each
|
|
214
|
+
* crate's result (`DES-BATCH`): `--keep-going` and JSON messages for
|
|
215
|
+
* `build`, `check` and `lint`, and `--no-fail-fast` for `test`. A command
|
|
216
|
+
* of a group of one crate adds none, so that it is the command that a plain
|
|
217
|
+
* `cargo` of that one crate runs, apart from the compiles of `napi-build`
|
|
218
|
+
* and `wasm-build`, which have no plain cargo counterpart and always add
|
|
219
|
+
* them, so that cargo reports the library that they post-process
|
|
220
|
+
* (`DES-NAPI`, `DES-WASM`).
|
|
221
|
+
*/
|
|
222
|
+
// @mara implements DES-BATCH
|
|
223
|
+
function sharedCommandFlags(target) {
|
|
224
|
+
switch (target) {
|
|
225
|
+
case "build":
|
|
226
|
+
case "napi-build":
|
|
227
|
+
case "wasm-build":
|
|
228
|
+
case "check":
|
|
229
|
+
case "lint":
|
|
230
|
+
return ["--keep-going", "--message-format=json"];
|
|
231
|
+
case "test":
|
|
232
|
+
return ["--no-fail-fast"];
|
|
233
|
+
default:
|
|
234
|
+
return [];
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Whether the compile of the target with this default name always prints
|
|
239
|
+
* cargo's JSON messages, also for one crate: the artifact targets, which
|
|
240
|
+
* take the library that cargo reports in them (`DES-NAPI`, `DES-WASM`).
|
|
241
|
+
*/
|
|
242
|
+
function reportsLibrary(target) {
|
|
243
|
+
return target === "napi-build" || target === "wasm-build";
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Whether the command of the target with this default name selects crates
|
|
247
|
+
* by their package ID specifications: every per-crate command but `cargo
|
|
248
|
+
* fmt`, which takes package names only (`DES-INVOCATION`).
|
|
249
|
+
*/
|
|
250
|
+
function selectsBySpecification(target) {
|
|
251
|
+
return crateCommands[target] !== undefined && target !== "fmt" && target !== "fmt-check";
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* The arguments with which the command of the target with this default name
|
|
255
|
+
* selects `crates`, all of one workspace: `-p` and each crate's package ID
|
|
256
|
+
* specification, in the given order, or for `cargo fmt` `-p` and each
|
|
257
|
+
* crate's package name (`DES-INVOCATION`). A bare name is not enough for the
|
|
258
|
+
* other commands: cargo matches it against every package that the selection
|
|
259
|
+
* reaches, where a dependency can have a member's name, also with its
|
|
260
|
+
* version, and the plugin, which reads the workspace without dependencies,
|
|
261
|
+
* cannot tell where that happens (`EVD-CARGO-PACKAGE-SPECS`).
|
|
262
|
+
*
|
|
263
|
+
* @throws {Error} When the target's command takes specifications and a
|
|
264
|
+
* crate has none.
|
|
265
|
+
*/
|
|
266
|
+
// @mara implements DES-INVOCATION
|
|
267
|
+
function crateSelection(target, crates) {
|
|
268
|
+
const bySpecification = selectsBySpecification(target);
|
|
269
|
+
return crates.flatMap(({ name, spec }) => {
|
|
270
|
+
if (!bySpecification) {
|
|
271
|
+
return ["-p", name];
|
|
272
|
+
}
|
|
273
|
+
if (spec === undefined) {
|
|
274
|
+
throw new Error(`The target "${target}" selects the crate ${name} by its specification, and it has none.`);
|
|
275
|
+
}
|
|
276
|
+
return ["-p", spec];
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* The arguments of `cargo nextest run` for the tests of a group's crates
|
|
281
|
+
* (`DES-TEST-RUN`, step 3), before the plugin's tool configuration file,
|
|
282
|
+
* which the group adds when it runs the step ({@link withToolConfiguration}):
|
|
283
|
+
*
|
|
284
|
+
* - where the command selects the whole workspace, `--workspace` and the
|
|
285
|
+
* filterset of the group's packages ({@link nextestFiltersets});
|
|
286
|
+
* otherwise each crate with `-p` and its package ID specification, as
|
|
287
|
+
* `cargo test` takes them;
|
|
288
|
+
* - for several crates or the whole workspace, `--no-fail-fast`, so that a
|
|
289
|
+
* failing test does not keep the tests of another crate from running;
|
|
290
|
+
* a command of one crate is the one that a developer types;
|
|
291
|
+
* - `--no-tests=pass`, because a crate without tests, or whose tests the
|
|
292
|
+
* repository's default filter leaves out, passes as it does under `cargo
|
|
293
|
+
* test`, where nextest would fail with exit code 4;
|
|
294
|
+
* - the feature flags, `--cargo-profile` for the `profile` option, because
|
|
295
|
+
* nextest's own `--profile` names a profile of its configuration
|
|
296
|
+
* (`EVD-NEXTEST-CARGO-FLAGS`), the flags of the `cargo` strategy
|
|
297
|
+
* ({@link workspaceUnificationFlags}), which nextest passes on to cargo,
|
|
298
|
+
* and `--locked`.
|
|
299
|
+
*
|
|
300
|
+
* No `--profile` and no `--ignore-default-filter`: the repository's nextest
|
|
301
|
+
* configuration applies as for a plain `cargo nextest run` ("nextest's
|
|
302
|
+
* configuration" in `DES-TEST-RUN`).
|
|
303
|
+
*/
|
|
304
|
+
// @mara implements DES-TEST-RUN
|
|
305
|
+
// @mara implements DES-PLUGIN-OPTIONS
|
|
306
|
+
function nextestArguments(subject, taken) {
|
|
307
|
+
var _a;
|
|
308
|
+
const crates = (_a = subject.crates) !== null && _a !== void 0 ? _a : [];
|
|
309
|
+
if (crates.length === 0) {
|
|
310
|
+
throw new Error('The target "test" runs for a crate, and the project has none.');
|
|
311
|
+
}
|
|
312
|
+
const workspace = subject.workspace === true;
|
|
313
|
+
return [
|
|
314
|
+
"nextest",
|
|
315
|
+
"run",
|
|
316
|
+
...(workspace ? ["--workspace"] : []),
|
|
317
|
+
...(crates.length > 1 || workspace ? ["--no-fail-fast"] : []),
|
|
318
|
+
"--no-tests=pass",
|
|
319
|
+
...(workspace
|
|
320
|
+
? nextestFiltersets(crates.map((crate) => crate.name))
|
|
321
|
+
: crateSelection("test", crates)),
|
|
322
|
+
...compilingFlags(taken, "--cargo-profile"),
|
|
323
|
+
...unificationFlags(subject),
|
|
324
|
+
...flag(subject.locked, "--locked"),
|
|
325
|
+
];
|
|
326
|
+
}
|
|
327
|
+
/** The longest filterset argument that the plugin passes to nextest, in bytes. */
|
|
328
|
+
exports.maxFiltersetBytes = 64 * 1024;
|
|
329
|
+
/**
|
|
330
|
+
* The `-E` arguments that select a group's packages for nextest
|
|
331
|
+
* (`DES-TEST-RUN`, "Under `workspace-build`"): `package(=a) | package(=b)`,
|
|
332
|
+
* where `=` matches each name exactly, split into several arguments, which
|
|
333
|
+
* nextest unites, so that none exceeds {@link maxFiltersetBytes}: Linux
|
|
334
|
+
* refuses one argument of more than 128 KiB (`EVD-CARGO-AFFECTED-REPORT`).
|
|
335
|
+
* A package name holds no character that a filterset escapes.
|
|
336
|
+
*
|
|
337
|
+
* In affected mode (nxr-tabkjx), each argument is intersected with a part of
|
|
338
|
+
* the selection, `(<group's filterset>) & (<part>)`; that is the one place
|
|
339
|
+
* where the selection joins the command.
|
|
340
|
+
*/
|
|
341
|
+
// @mara implements DES-TEST-RUN
|
|
342
|
+
function nextestFiltersets(packages) {
|
|
343
|
+
const parts = [];
|
|
344
|
+
let current = "";
|
|
345
|
+
for (const name of packages) {
|
|
346
|
+
const term = `package(=${name})`;
|
|
347
|
+
const joined = current === "" ? term : `${current} | ${term}`;
|
|
348
|
+
if (current !== "" && Buffer.byteLength(joined) > exports.maxFiltersetBytes) {
|
|
349
|
+
parts.push(current);
|
|
350
|
+
current = term;
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
current = joined;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (current !== "") {
|
|
357
|
+
parts.push(current);
|
|
358
|
+
}
|
|
359
|
+
return parts.flatMap((part) => ["-E", part]);
|
|
360
|
+
}
|
|
361
|
+
/** The name under which nextest takes the plugin's tool configuration file. */
|
|
362
|
+
exports.nextestToolName = "nx-rust";
|
|
363
|
+
/**
|
|
364
|
+
* The arguments of a nextest step with the plugin's tool configuration file
|
|
365
|
+
* (`DES-TEST-RUN`, "nextest's configuration"): `--tool-config-file
|
|
366
|
+
* nx-rust:<file>` after `nextest run`. The file is written for each run, so
|
|
367
|
+
* the step's arguments name it only once it exists.
|
|
368
|
+
*
|
|
369
|
+
* @param file The absolute path of the file.
|
|
370
|
+
*/
|
|
371
|
+
function withToolConfiguration(args, file) {
|
|
372
|
+
return [
|
|
373
|
+
...args.slice(0, 2),
|
|
374
|
+
"--tool-config-file",
|
|
375
|
+
`${exports.nextestToolName}:${file}`,
|
|
376
|
+
...args.slice(2),
|
|
377
|
+
];
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* The feature, profile and triple flags, from the options that the target
|
|
381
|
+
* takes; the profile goes with `profileFlag`, which nextest calls
|
|
382
|
+
* `--cargo-profile`.
|
|
383
|
+
*/
|
|
384
|
+
function compilingFlags(taken, profileFlag = "--profile") {
|
|
385
|
+
var _a;
|
|
386
|
+
const features = (_a = taken.features) !== null && _a !== void 0 ? _a : [];
|
|
387
|
+
return [
|
|
388
|
+
...(features.length > 0 ? ["--features", features.join(",")] : []),
|
|
389
|
+
...flag(taken.allFeatures, "--all-features"),
|
|
390
|
+
...flag(taken.noDefaultFeatures, "--no-default-features"),
|
|
391
|
+
...(taken.profile !== undefined ? [profileFlag, taken.profile] : []),
|
|
392
|
+
...(taken.targetTriple !== undefined ? ["--target", taken.targetTriple] : []),
|
|
393
|
+
];
|
|
394
|
+
}
|
|
395
|
+
function flag(on, name) {
|
|
396
|
+
return on === true ? [name] : [];
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* The arguments of `cargo nextest list --message-format json` for the tests
|
|
400
|
+
* that a `cargo nextest run` with `runArgs` is to run (`DES-TEST-RUN`, step
|
|
401
|
+
* 4): the same selection, filtersets, feature and profile flags and
|
|
402
|
+
* `--locked`, without the flags that only a run takes, `--no-fail-fast` and
|
|
403
|
+
* `--no-tests`. nextest gives each test of the list a `filter-match` after
|
|
404
|
+
* the same filters, the repository's default filter among them, and with the
|
|
405
|
+
* same environment the same profile applies (`EVD-NEXTEST-RUNNER-STEPS`).
|
|
406
|
+
*/
|
|
407
|
+
// @mara implements DES-TEST-RUN
|
|
408
|
+
function nextestListArguments(runArgs) {
|
|
409
|
+
return [
|
|
410
|
+
"nextest",
|
|
411
|
+
"list",
|
|
412
|
+
"--message-format",
|
|
413
|
+
"json",
|
|
414
|
+
...runArgs.slice(2).filter((arg) => arg !== "--no-fail-fast" && !arg.startsWith("--no-tests")),
|
|
415
|
+
];
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* The steps of a group's cargo commands (`DES-BATCH`): one command, as
|
|
419
|
+
* {@link cargoArguments} builds it, for every target but `hakari-check`,
|
|
420
|
+
* which runs the two commands of {@link hakariCheckSteps}, `test` with the
|
|
421
|
+
* nextest runner, and `test` with the `cargo` runner on a group that selects
|
|
422
|
+
* the whole workspace.
|
|
423
|
+
*
|
|
424
|
+
* With the `cargo` runner, such a group has three steps (`DES-TEST-RUN`,
|
|
425
|
+
* "Under `workspace-build`"):
|
|
426
|
+
*
|
|
427
|
+
* 1. `cargo test --workspace --no-run`, which compiles every test executable,
|
|
428
|
+
* the binaries that integration tests use and every example;
|
|
429
|
+
* 2. `cargo test --workspace --tests --no-fail-fast
|
|
430
|
+
* --message-format=json-render-diagnostics` with the selecting runner
|
|
431
|
+
* through `--config 'target.<host>.runner=[…]'`, in TOML strings;
|
|
432
|
+
* 3. `cargo test --workspace --doc --no-fail-fast`, without the runner.
|
|
433
|
+
*
|
|
434
|
+
* With the nextest runner, every group has two (`DES-TEST-RUN`, steps 3 and
|
|
435
|
+
* 5): `cargo nextest run` ({@link cargoArguments}), which builds every test
|
|
436
|
+
* binary before it runs one, and `cargo test --doc` for the doctests, which
|
|
437
|
+
* nextest does not run (`REQ-DOCTESTS`), selecting the crates as the first
|
|
438
|
+
* step does: `--workspace`, or each crate with `-p`. The first step is a
|
|
439
|
+
* `nextest` step where it selects several crates or the whole workspace,
|
|
440
|
+
* whose results the group reads from nextest's JUnit report, and otherwise
|
|
441
|
+
* the plain command of one crate. Both pass `--no-fail-fast` where they
|
|
442
|
+
* select more than one crate.
|
|
443
|
+
*
|
|
444
|
+
* Each step passes the same feature and profile flags and `--locked` as
|
|
445
|
+
* the others, so that every step resolves the same features
|
|
446
|
+
* (`REQ-STABLE-FEATURES`) and reuses what the steps before it compiled; the
|
|
447
|
+
* profile is `--cargo-profile` for nextest and `--profile` for cargo
|
|
448
|
+
* (`EVD-NEXTEST-CARGO-FLAGS`).
|
|
449
|
+
*
|
|
450
|
+
* @param runner The selecting runner, which a `test` group of the `cargo`
|
|
451
|
+
* runner that selects the whole workspace needs.
|
|
452
|
+
* @throws {Error} As {@link cargoArguments} does, and for such a group
|
|
453
|
+
* without a runner.
|
|
454
|
+
*/
|
|
455
|
+
// @mara implements DES-TEST-RUN
|
|
456
|
+
// @mara implements DES-UNIFICATION
|
|
457
|
+
// @mara implements REQ-DOCTESTS
|
|
458
|
+
// @mara implements DES-TEST-PHASES
|
|
459
|
+
function cargoSteps(subject, options, runner) {
|
|
460
|
+
var _a;
|
|
461
|
+
if (subject.target === "hakari-check") {
|
|
462
|
+
return exports.hakariCheckSteps.map((args) => ({ kind: "command", args: [...args] }));
|
|
463
|
+
}
|
|
464
|
+
if (subject.target === "test" && subject.testRunner === "nextest") {
|
|
465
|
+
const taken = Object.fromEntries(Object.entries(options).filter(([name]) => targetTakes("test", name)));
|
|
466
|
+
const crates = (_a = subject.crates) !== null && _a !== void 0 ? _a : [];
|
|
467
|
+
const shared = subject.workspace === true || crates.length > 1;
|
|
468
|
+
return [
|
|
469
|
+
shared
|
|
470
|
+
? {
|
|
471
|
+
kind: "nextest",
|
|
472
|
+
args: cargoArguments(subject, options),
|
|
473
|
+
listArgs: nextestListArguments(cargoArguments(subject, options)),
|
|
474
|
+
}
|
|
475
|
+
: { kind: "command", args: cargoArguments(subject, options) },
|
|
476
|
+
{
|
|
477
|
+
kind: "doctests",
|
|
478
|
+
args: [
|
|
479
|
+
"test",
|
|
480
|
+
...(subject.workspace === true ? ["--workspace"] : crateSelection("test", crates)),
|
|
481
|
+
"--doc",
|
|
482
|
+
...(shared ? ["--no-fail-fast"] : []),
|
|
483
|
+
...compilingFlags(taken),
|
|
484
|
+
...unificationFlags(subject),
|
|
485
|
+
...flag(subject.locked, "--locked"),
|
|
486
|
+
],
|
|
487
|
+
},
|
|
488
|
+
];
|
|
489
|
+
}
|
|
490
|
+
if (!(subject.target === "test" && subject.workspace === true)) {
|
|
491
|
+
return [{ kind: "command", args: cargoArguments(subject, options) }];
|
|
492
|
+
}
|
|
493
|
+
if (runner === undefined) {
|
|
494
|
+
throw new Error("A test group that selects the whole workspace needs the selecting runner.");
|
|
495
|
+
}
|
|
496
|
+
const taken = Object.fromEntries(Object.entries(options).filter(([name]) => targetTakes("test", name)));
|
|
497
|
+
const tail = [...compilingFlags(taken), ...flag(subject.locked, "--locked")];
|
|
498
|
+
const toml = `[${runner.command.map((word) => JSON.stringify(word)).join(", ")}]`;
|
|
499
|
+
return [
|
|
500
|
+
{ kind: "tests-build", args: ["test", "--workspace", "--no-run", ...tail] },
|
|
501
|
+
{
|
|
502
|
+
kind: "test-binaries",
|
|
503
|
+
args: [
|
|
504
|
+
"test",
|
|
505
|
+
"--workspace",
|
|
506
|
+
"--tests",
|
|
507
|
+
"--no-fail-fast",
|
|
508
|
+
"--message-format=json-render-diagnostics",
|
|
509
|
+
...tail,
|
|
510
|
+
"--config",
|
|
511
|
+
`target.${runner.host}.runner=${toml}`,
|
|
512
|
+
],
|
|
513
|
+
},
|
|
514
|
+
{ kind: "doctests", args: ["test", "--workspace", "--doc", "--no-fail-fast", ...tail] },
|
|
515
|
+
];
|
|
516
|
+
}
|
|
517
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/command.ts"],"names":[],"mappings":";;;AAgHA,kCAKC;AAuED,4CAEC;AA4CD,wCAwDC;AA4CD,gDAaC;AAOD,wCAEC;AAOD,wDAEC;AAgBD,wCAgBC;AAkED,8CAiBC;AAaD,sDAOC;AAOD,wCASC;AA2CD,oDAQC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coverage baseline target on the workspace project of a workspace with
|
|
5
|
+
* `affectedTests` (`REQ-BASELINE`, `DES-BASELINE`), which the lockfile
|
|
6
|
+
* executor, `@convesoft/nx-rust:lockfile`, runs: it has no batch
|
|
7
|
+
* implementation, so that a collection never joins a batch, and the empty
|
|
8
|
+
* entry that `init` adds for it in `targetDefaults` covers the target.
|
|
9
|
+
*
|
|
10
|
+
* In the workspace root, it computes the context that the collection runs
|
|
11
|
+
* in, the record that step 1 of `DES-TEST-RUN` compares
|
|
12
|
+
* (`ADR-AFFECTED-BASELINE-CONTEXT`), takes the workspace's collection lock,
|
|
13
|
+
* asks `cargo affected status` whether `collect --diff` can run
|
|
14
|
+
* ({@link collectionChoice}), removes the record, and for a full collection
|
|
15
|
+
* the database, runs `cargo affected collect` with git's `diff.relative`,
|
|
16
|
+
* and writes the record only after cargo-affected has ended successfully
|
|
17
|
+
* ("Order of writing"). A collection that fails or is interrupted leaves no
|
|
18
|
+
* record. Collection sets no Cargo directory of its own unless
|
|
19
|
+
* `separateBuildDir` is on.
|
|
20
|
+
*/
|
|
21
|
+
export declare function collectBaseline(options: CargoTargetOptions, context: ExecutorContext): Promise<{
|
|
22
|
+
success: boolean;
|
|
23
|
+
}>;
|