@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,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uncachedByDesign = void 0;
|
|
4
|
+
exports.uncachedReason = uncachedReason;
|
|
5
|
+
exports.targetOutputs = targetOutputs;
|
|
6
|
+
exports.finalFileNames = finalFileNames;
|
|
7
|
+
/**
|
|
8
|
+
* The folders of a build's final artifacts below the artifact directory up
|
|
9
|
+
* to the triple, as Nx interpolates them from the task's options
|
|
10
|
+
* (`DES-OUTPUTS`, "Paths"): the folder of the triple that the task names,
|
|
11
|
+
* else of each triple that Cargo's configuration and the graph's
|
|
12
|
+
* environment pick, else the artifact directory itself. Where they pick an
|
|
13
|
+
* empty list, cargo builds nothing, and where they pick a triple that the
|
|
14
|
+
* plugin cannot name, the target is left uncached unless every run names a
|
|
15
|
+
* triple ({@link uncachedReason}); there an output without a triple keeps
|
|
16
|
+
* no value, and Nx drops it. The executor fails a cached task whose
|
|
17
|
+
* environment then picks other triples (`taskInvocation` in `task.ts`).
|
|
18
|
+
*/
|
|
19
|
+
function tripleFolders(triples) {
|
|
20
|
+
switch (triples.kind) {
|
|
21
|
+
case "none":
|
|
22
|
+
return ["{options.targetTriple ?? .}"];
|
|
23
|
+
case "triples":
|
|
24
|
+
return triples.triples.length === 0
|
|
25
|
+
? ["{options.targetTriple}"]
|
|
26
|
+
: triples.triples.map((triple) => `{options.targetTriple ?? ${triple}}`);
|
|
27
|
+
case "unnamed":
|
|
28
|
+
return ["{options.targetTriple}"];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The profile's folder below a triple's folder, `debug` without a profile.
|
|
33
|
+
* The executor rejects the profiles `dev`, `test` and `bench` on `build` and
|
|
34
|
+
* `doc`, whose folders Cargo names `debug` and `release`, which this
|
|
35
|
+
* expression cannot map.
|
|
36
|
+
*/
|
|
37
|
+
const profileFolder = "{options.profile ?? debug}";
|
|
38
|
+
/**
|
|
39
|
+
* Why `DES-TARGETS` and `DES-WORKSPACE-TARGETS` leave a target uncached in
|
|
40
|
+
* every project, for the message of a task whose configuration caches it
|
|
41
|
+
* anyway.
|
|
42
|
+
*/
|
|
43
|
+
exports.uncachedByDesign = {
|
|
44
|
+
fmt: "it rewrites the crate's files, which a result restored from the cache would not do",
|
|
45
|
+
bench: "benchmark timings differ between runs",
|
|
46
|
+
run: "it runs a binary, whose effects a result restored from the cache would not repeat",
|
|
47
|
+
audit: "cargo-audit fetches the advisory database each time it runs, and no input covers it, so a cached pass could hide a newer advisory",
|
|
48
|
+
deny: "cargo-deny fetches the advisory database each time it runs, and no input covers it, so a cached pass could hide a newer advisory",
|
|
49
|
+
update: "it exists to change Cargo.lock",
|
|
50
|
+
lockfile: "whether cargo changes Cargo.lock also depends on files outside the repository, such as a [patch] in the Cargo home's configuration, which Nx cannot hash",
|
|
51
|
+
"hakari-check": "its verdict depends on the whole package graph, which also follows files outside the repository, such as a [patch] in the Cargo home's configuration, which Nx cannot hash",
|
|
52
|
+
"nx-release-publish": "it uploads the crate to a registry, which a result restored from the cache would not do",
|
|
53
|
+
"coverage-baseline": "it changes the coverage database and the record of its context in the workspace's target folder, which a result restored from the cache would not do",
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Why the plugin leaves a target that `DES-TARGETS` caches uncached in one
|
|
57
|
+
* project, or `undefined` where it caches it (`DES-OUTPUTS`): `build` and
|
|
58
|
+
* `doc` where the artifact directory lies outside the repository, or where
|
|
59
|
+
* Cargo's configuration or the graph's environment picks a triple whose
|
|
60
|
+
* folder the plugin cannot name and the target's options name none, and
|
|
61
|
+
* `doc` where another workspace shares the artifact directory, as the same
|
|
62
|
+
* folder or one inside the other. The plugin
|
|
63
|
+
* cannot name or store the artifacts of such a task.
|
|
64
|
+
*
|
|
65
|
+
* @param namesTriple Whether the target's options or configurations name a triple.
|
|
66
|
+
*/
|
|
67
|
+
// @mara implements DES-OUTPUTS
|
|
68
|
+
function uncachedReason(target, place, namesTriple) {
|
|
69
|
+
if (target !== "build" && target !== "doc") {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
if (!place.artifacts.inside) {
|
|
73
|
+
return "its workspace's artifact directory lies outside the repository, where Nx cannot store files";
|
|
74
|
+
}
|
|
75
|
+
if (target === "doc" && place.artifacts.shared) {
|
|
76
|
+
return "another workspace's artifact directory is the same folder or lies inside it or around it, and restoring one workspace's doc folder from the cache would delete or replace files of the others";
|
|
77
|
+
}
|
|
78
|
+
if (place.tripleProblem !== undefined && !namesTriple) {
|
|
79
|
+
return `${place.tripleProblem}; give the triple as the targetTriple option instead`;
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The outputs of a cached target, which name final artifacts only and never
|
|
85
|
+
* a path inside Cargo's build directory (`DES-OUTPUTS`, `DES-BUILD-DIRS`):
|
|
86
|
+
*
|
|
87
|
+
* - `build`: the executable of each binary target, and the `cdylib` and
|
|
88
|
+
* `staticlib` files of the library, in the artifact directory's folder
|
|
89
|
+
* for each triple that the task builds for and its profile
|
|
90
|
+
* ({@link tripleFolders}). A library's file is named for both Linux and
|
|
91
|
+
* macOS, and Nx stores what exists.
|
|
92
|
+
* - `doc`: the whole `doc` folder of the artifact directory, or of each
|
|
93
|
+
* triple's folder where the task builds for a triple.
|
|
94
|
+
*
|
|
95
|
+
* Other targets store their result only and have no outputs, and neither
|
|
96
|
+
* do targets that are not cached. The list is empty rather than absent,
|
|
97
|
+
* because Nx gives a `build` target without `outputs` folders such as
|
|
98
|
+
* `{projectRoot}/build` of its own accord.
|
|
99
|
+
*/
|
|
100
|
+
// @mara implements DES-OUTPUTS
|
|
101
|
+
// @mara implements DES-BUILD-DIRS
|
|
102
|
+
// @mara implements REQ-CACHE-OUTPUTS
|
|
103
|
+
function targetOutputs(target, pkg, artifacts, cached, triples = { kind: "none" }) {
|
|
104
|
+
if (!artifacts.inside || !cached) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
const folders = tripleFolders(triples).map((folder) => `{workspaceRoot}/${artifacts.path}/${folder}`);
|
|
108
|
+
if (target === "doc") {
|
|
109
|
+
return folders.map((folder) => `${folder}/doc`);
|
|
110
|
+
}
|
|
111
|
+
if (target !== "build" || pkg === undefined) {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
const files = finalFileNames(pkg);
|
|
115
|
+
return folders.flatMap((folder) => files.map((file) => `${folder}/${profileFolder}/${file}`));
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The names of a crate's final artifacts in a profile folder, which the
|
|
119
|
+
* outputs of its `build` name ({@link targetOutputs}, `DES-OUTPUTS`): the
|
|
120
|
+
* executable of each binary target, and the `cdylib` and `staticlib` files
|
|
121
|
+
* of the library, a `cdylib` named for both Linux and macOS.
|
|
122
|
+
*/
|
|
123
|
+
// @mara implements DES-OUTPUTS
|
|
124
|
+
function finalFileNames(pkg) {
|
|
125
|
+
const files = [];
|
|
126
|
+
for (const cargoTarget of pkg.targets) {
|
|
127
|
+
if (cargoTarget.kind.includes("bin")) {
|
|
128
|
+
files.push(cargoTarget.name);
|
|
129
|
+
}
|
|
130
|
+
const library = cargoTarget.name.replace(/-/g, "_");
|
|
131
|
+
if (cargoTarget.kind.includes("cdylib")) {
|
|
132
|
+
files.push(`lib${library}.so`, `lib${library}.dylib`);
|
|
133
|
+
}
|
|
134
|
+
if (cargoTarget.kind.includes("staticlib")) {
|
|
135
|
+
files.push(`lib${library}.a`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return files;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=outputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/outputs.ts"],"names":[],"mappings":";;;AAiGA,wCAkBC;AAsBD,sCAqBC;AASD,wCAeC;AAvKD;;;;;;;;;;;GAWG;AACH,SAAS,aAAa,CAAC,OAAsB;IAC3C,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,MAAM;YACT,OAAO,CAAC,6BAA6B,CAAC,CAAC;QACzC,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;gBACjC,CAAC,CAAC,CAAC,wBAAwB,CAAC;gBAC5B,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,4BAA4B,MAAM,GAAG,CAAC,CAAC;QAC7E,KAAK,SAAS;YACZ,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACtC,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAEnD;;;;GAIG;AACU,QAAA,gBAAgB,GAAgD;IAC3E,GAAG,EAAE,oFAAoF;IACzF,KAAK,EAAE,uCAAuC;IAC9C,GAAG,EAAE,mFAAmF;IACxF,KAAK,EACH,mIAAmI;IACrI,IAAI,EAAE,kIAAkI;IACxI,MAAM,EAAE,gCAAgC;IACxC,QAA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} from "./declared-files";
|
|
2
|
+
import type { CargoDiscovery } from "./discovery";
|
|
3
|
+
import type { Input, InputDefinition } from "./inputs";
|
|
4
|
+
import type { RedirectedUse } from "./redirected-uses";
|
|
5
|
+
/** A crate without an Nx project that a crate with a project reaches. */
|
|
6
|
+
export interface PathDependency {
|
|
7
|
+
/** Its package name, or its folder's name where no report describes it. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Its folder relative to the repository root, or its absolute path outside it. */
|
|
10
|
+
folder: string;
|
|
11
|
+
/** Whether Nx sees its files: it lies inside the repository and Nx does not ignore it. */
|
|
12
|
+
seen: boolean;
|
|
13
|
+
/** How the crate reaches it: by a path, or by a `[patch]`, `[replace]` or `paths` entry. */
|
|
14
|
+
via: "path" | "redirection";
|
|
15
|
+
/**
|
|
16
|
+
* The root manifest of the workspace it belongs to, where that is not its
|
|
17
|
+
* own manifest, relative to the repository root and inside it: cargo
|
|
18
|
+
* applies the fields that the crate inherits from there, also when
|
|
19
|
+
* another workspace builds it (`EVD-CARGO-DEPENDENCY-SIDE`).
|
|
20
|
+
*/
|
|
21
|
+
workspaceManifest?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The filesets for the `fileInputs` of its own table and of its
|
|
24
|
+
* workspace's, which travel with its folder (`DES-INPUTS`, "Declared
|
|
25
|
+
* files"); none where no report describes it or Nx does not see it.
|
|
26
|
+
*/
|
|
27
|
+
declared: InputDefinition[];
|
|
28
|
+
/**
|
|
29
|
+
* An `env` input for each variable and a `runtime` input for each command
|
|
30
|
+
* that its own table and its workspace's add with `envInputs` and
|
|
31
|
+
* `runtimeInputs`, each once, which an edge would have brought in its
|
|
32
|
+
* named input (`DES-INPUTS`, "Added variables and commands"): also where
|
|
33
|
+
* Nx does not see its files, and none where no report describes it.
|
|
34
|
+
*/
|
|
35
|
+
added: InputDefinition[];
|
|
36
|
+
}
|
|
37
|
+
/** The crates whose files a crate's inputs name beyond its edges, by the crate's manifest path. */
|
|
38
|
+
export interface CrateFolders {
|
|
39
|
+
/**
|
|
40
|
+
* The crates without a project that the crate reaches, directly or through
|
|
41
|
+
* other crates without a project: by path, or as a crate that a
|
|
42
|
+
* redirection of its workspace may put in place of a dependency. Their
|
|
43
|
+
* folders go into the crate's own named input.
|
|
44
|
+
*/
|
|
45
|
+
withoutProject: Map<string, PathDependency[]>;
|
|
46
|
+
/**
|
|
47
|
+
* The crates with a project that a redirection may put in place of a
|
|
48
|
+
* dependency of the crate, or that lie behind a redirected crate without a
|
|
49
|
+
* project, but whose edge from it `redirectedUses` leaves out, each
|
|
50
|
+
* followed by the crates that cargo builds with it, with a project or
|
|
51
|
+
* without (`RedirectedUse.brings`). Their folders and workspace manifests
|
|
52
|
+
* go onto the crate's targets.
|
|
53
|
+
*/
|
|
54
|
+
leftOutEdges: Map<string, PathDependency[]>;
|
|
55
|
+
/**
|
|
56
|
+
* The path crates outside a crate's workspace that any member of the
|
|
57
|
+
* workspace reaches, with a project or without, which a build of the
|
|
58
|
+
* whole workspace compiles with the crate (`DES-INPUTS`, "Crates outside
|
|
59
|
+
* the workspace"), without those whose folders the crate's inputs hold
|
|
60
|
+
* already, by the key of `wholeWorkspaceKey` in `inputs.ts`: the crate's
|
|
61
|
+
* manifest, or the root manifest of a virtual workspace for its
|
|
62
|
+
* workspace project. Each comes as a path dependency without a project
|
|
63
|
+
* does: its folder, the root manifest of its workspace and its declared
|
|
64
|
+
* files where Nx sees them, and the variables and commands it adds, also
|
|
65
|
+
* where Nx does not. Under the `cargo` and `workspace-build` strategies
|
|
66
|
+
* they go onto the targets that read digests.
|
|
67
|
+
*/
|
|
68
|
+
outsideWorkspace: Map<string, PathDependency[]>;
|
|
69
|
+
/**
|
|
70
|
+
* The problems of the declared files of those crates, each once, which
|
|
71
|
+
* stop graph creation (`declaredFiles` in `declared-files.ts`).
|
|
72
|
+
*/
|
|
73
|
+
problems: string[];
|
|
74
|
+
/** The patterns of the declared files of those crates, for the check of `createDependencies`. */
|
|
75
|
+
patterns: DeclaredPattern[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The crates whose files reach a crate's key through its inputs rather than
|
|
79
|
+
* through an edge (`DES-INPUTS`, "Path dependencies" and "Redirected
|
|
80
|
+
* crates"), for each crate with a project.
|
|
81
|
+
*
|
|
82
|
+
* A crate without a project is excluded by `exclude` on the plugin's entry,
|
|
83
|
+
* ignored by Nx, outside the repository, or a package of a directory source
|
|
84
|
+
* whose folder holds `.cargo-checksum.json`. One that a path dependency or a
|
|
85
|
+
* redirection reaches counts with the crates without a project behind it
|
|
86
|
+
* where a report describes it; without a report, as for such a package or
|
|
87
|
+
* one whose report failed, its folder counts alone. A crate with a project
|
|
88
|
+
* behind such crates is no folder here: the crate has an edge to it
|
|
89
|
+
* (`projectsReachedByPath` in `reached-projects.ts`, and `redirectedUses`
|
|
90
|
+
* behind a redirected crate), and its input, with what lies behind it,
|
|
91
|
+
* reaches the crate through `^` inputs; where `redirectedUses` leaves that
|
|
92
|
+
* edge out, its folder is among the left-out edges.
|
|
93
|
+
* A path names the crate at the real path of its folder, symbolic links
|
|
94
|
+
* resolved, so a path through a link to a crate with a project is that
|
|
95
|
+
* project's.
|
|
96
|
+
*
|
|
97
|
+
* Whether Nx sees a crate's files is whether it sees its manifest, or any
|
|
98
|
+
* file of a folder without one. The files that a crate seen there declares
|
|
99
|
+
* with `fileInputs`, in its own table or its workspace's, travel with its
|
|
100
|
+
* folder, and so do the variables and commands that any of these crates
|
|
101
|
+
* adds there with `envInputs` and `runtimeInputs`, also where Nx does not
|
|
102
|
+
* see its files; they are read from its report, so a crate without one
|
|
103
|
+
* declares and adds none.
|
|
104
|
+
*
|
|
105
|
+
* @param uses The redirected uses of the members (`redirectedUses`), for the
|
|
106
|
+
* projects that this plugin entry creates.
|
|
107
|
+
*/
|
|
108
|
+
export declare function findCrateFolders(discovery: CargoDiscovery, uses: readonly RedirectedUse[]): Promise<CrateFolders>;
|
|
109
|
+
/**
|
|
110
|
+
* The inputs for a crate without an edge: its folder, the root manifest of
|
|
111
|
+
* its workspace and the files it declares, where Nx can see them, and the
|
|
112
|
+
* variables and commands it adds, also where Nx cannot.
|
|
113
|
+
*/
|
|
114
|
+
export declare function crateInputs(crate: PathDependency): Input[];
|
|
115
|
+
/**
|
|
116
|
+
* The warning for a crate without a project whose files Nx does not see
|
|
117
|
+
* (`DES-DIAGNOSTICS`), naming the crate and the dependency.
|
|
118
|
+
*
|
|
119
|
+
* @param crate The crate with a project that reaches it.
|
|
120
|
+
* @param manifest The crate's manifest, relative to the repository root.
|
|
121
|
+
*/
|
|
122
|
+
export declare function unseenPathDependencyWarning(crate: string, manifest: string, dependency: PathDependency): string;
|