@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,526 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StageError = exports.stageFolderName = void 0;
|
|
4
|
+
exports.stageFlags = stageFlags;
|
|
5
|
+
exports.tomlString = tomlString;
|
|
6
|
+
exports.createStage = createStage;
|
|
7
|
+
exports.removeStage = removeStage;
|
|
8
|
+
exports.removeStaleStages = removeStaleStages;
|
|
9
|
+
exports.stagedFinalFiles = stagedFinalFiles;
|
|
10
|
+
exports.moveStagedFiles = moveStagedFiles;
|
|
11
|
+
exports.currentOwner = currentOwner;
|
|
12
|
+
exports.processState = processState;
|
|
13
|
+
exports.processStart = processStart;
|
|
14
|
+
exports.pathInStage = pathInStage;
|
|
15
|
+
exports.isStagePath = isStagePath;
|
|
16
|
+
exports.stagesCommand = stagesCommand;
|
|
17
|
+
exports.withStage = withStage;
|
|
18
|
+
exports.sharedBuildFolders = sharedBuildFolders;
|
|
19
|
+
const node_child_process_1 = require("node:child_process");
|
|
20
|
+
const node_fs_1 = require("node:fs");
|
|
21
|
+
const node_path_1 = require("node:path");
|
|
22
|
+
const targets_1 = require("../graph/targets");
|
|
23
|
+
/**
|
|
24
|
+
* The folder in the artifact directory that holds the stages of staged
|
|
25
|
+
* commands (`DES-BATCH`, "Staged builds"): on the file system of the files
|
|
26
|
+
* that a stage's files replace, among Cargo's directories, and removed by
|
|
27
|
+
* `cargo clean`.
|
|
28
|
+
*/
|
|
29
|
+
exports.stageFolderName = ".nx-rust-stage";
|
|
30
|
+
/** The marker that names the process that owns a stage. */
|
|
31
|
+
const ownerFileName = ".nx-rust-owner";
|
|
32
|
+
/** A stage's folder name: the owning process's id and its counter. */
|
|
33
|
+
const stageNamePattern = /^(\d+)-(\d+)$/;
|
|
34
|
+
/** A stage could not be made. */
|
|
35
|
+
class StageError extends Error {
|
|
36
|
+
constructor(message) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.name = "StageError";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.StageError = StageError;
|
|
42
|
+
/**
|
|
43
|
+
* The flags that make a cargo command build into `stage` (`DES-INVOCATION`):
|
|
44
|
+
* `--target-dir` with the stage, and `build.build-dir` with the build
|
|
45
|
+
* directory that cargo would use anyway, so that it builds and reuses
|
|
46
|
+
* exactly what it would without the stage (`EVD-STAGED-BUILDS`).
|
|
47
|
+
*/
|
|
48
|
+
// @mara implements DES-INVOCATION
|
|
49
|
+
function stageFlags(stage) {
|
|
50
|
+
return [
|
|
51
|
+
"--target-dir",
|
|
52
|
+
stage.path,
|
|
53
|
+
"--config",
|
|
54
|
+
`build.build-dir=${tomlString(stage.directories.build)}`,
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
/** `value` as a TOML basic string, which `--config` reads. */
|
|
58
|
+
function tomlString(value) {
|
|
59
|
+
var _a;
|
|
60
|
+
let text = '"';
|
|
61
|
+
for (const character of value) {
|
|
62
|
+
const code = (_a = character.codePointAt(0)) !== null && _a !== void 0 ? _a : 0;
|
|
63
|
+
if (character === '"' || character === "\\") {
|
|
64
|
+
text += `\\${character}`;
|
|
65
|
+
}
|
|
66
|
+
else if (code < 0x20 || code === 0x7f) {
|
|
67
|
+
text += `\\u${code.toString(16).padStart(4, "0")}`;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
text += character;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return `${text}"`;
|
|
74
|
+
}
|
|
75
|
+
let counter = 0;
|
|
76
|
+
/**
|
|
77
|
+
* Makes a new, empty stage in the artifact directory of `directories` for
|
|
78
|
+
* this process (`DES-BATCH`, "Staged builds", and "Files that a test batch
|
|
79
|
+
* puts back" for a test group's kept files), after removing the stages
|
|
80
|
+
* that processes which no longer run left there ({@link removeStaleStages}).
|
|
81
|
+
* A folder of this process's id that this process did not make is the
|
|
82
|
+
* leftover of an earlier process with the same id, and is removed too.
|
|
83
|
+
*
|
|
84
|
+
* @throws {StageError} Where the folder cannot be made or marked.
|
|
85
|
+
*/
|
|
86
|
+
// @mara implements DES-BATCH
|
|
87
|
+
function createStage(directories, owner = currentOwner(), liveness = processState) {
|
|
88
|
+
const parent = (0, node_path_1.join)(directories.artifact, exports.stageFolderName);
|
|
89
|
+
removeStaleStages(directories.artifact, owner, liveness);
|
|
90
|
+
try {
|
|
91
|
+
(0, node_fs_1.mkdirSync)(parent, { recursive: true });
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw new StageError(`could not make ${parent}: ${messageOf(error)}`);
|
|
95
|
+
}
|
|
96
|
+
for (;;) {
|
|
97
|
+
const path = (0, node_path_1.join)(parent, `${owner.pid}-${counter++}`);
|
|
98
|
+
if (!makeFolder(path, owner)) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
(0, node_fs_1.writeFileSync)((0, node_path_1.join)(path, ownerFileName), `${JSON.stringify(owner)}\n`);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
(0, node_fs_1.rmSync)(path, { recursive: true, force: true });
|
|
106
|
+
throw new StageError(`could not mark the stage ${path}: ${messageOf(error)}`);
|
|
107
|
+
}
|
|
108
|
+
return { path, directories };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Removes a stage and everything in it, where `stage.path` is a stage of
|
|
113
|
+
* its artifact directory: a folder named `<process id>-<counter>` in its
|
|
114
|
+
* `.nx-rust-stage` folder, and nothing else.
|
|
115
|
+
*
|
|
116
|
+
* @returns The problem where the folder could not be removed.
|
|
117
|
+
*/
|
|
118
|
+
function removeStage(stage) {
|
|
119
|
+
if (!isStagePath(stage.path, stage.directories.artifact)) {
|
|
120
|
+
return `@convesoft/nx-rust did not remove ${stage.path}, which is no stage of ${stage.directories.artifact}`;
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
(0, node_fs_1.rmSync)(stage.path, { recursive: true, force: true });
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
return `@convesoft/nx-rust could not remove the stage ${stage.path}: ${messageOf(error)}`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Removes the stages in `artifactDirectory` that processes which no longer
|
|
132
|
+
* run left there, such as an interrupted command's. A stage belongs to a
|
|
133
|
+
* running process where the process of its id runs and, where both are
|
|
134
|
+
* known, started when the stage's marker says, so that a process that got
|
|
135
|
+
* a dead owner's id does not keep the dead owner's stage. A stage whose
|
|
136
|
+
* marker is missing or unreadable belongs to the process of its id while
|
|
137
|
+
* that runs, which covers the moment between making the folder and
|
|
138
|
+
* marking it. Stages of this process are left alone.
|
|
139
|
+
*/
|
|
140
|
+
function removeStaleStages(artifactDirectory, owner = currentOwner(), liveness = processState) {
|
|
141
|
+
const parent = (0, node_path_1.join)(artifactDirectory, exports.stageFolderName);
|
|
142
|
+
let names;
|
|
143
|
+
try {
|
|
144
|
+
names = (0, node_fs_1.readdirSync)(parent);
|
|
145
|
+
}
|
|
146
|
+
catch (_a) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
for (const name of names) {
|
|
150
|
+
const match = stageNamePattern.exec(name);
|
|
151
|
+
if (match === null) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const path = (0, node_path_1.join)(parent, name);
|
|
155
|
+
const pid = Number(match[1]);
|
|
156
|
+
const marked = readOwner(path);
|
|
157
|
+
if (pid === owner.pid && (marked === undefined || sameOwner(marked, owner))) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const state = liveness(pid);
|
|
161
|
+
const stale = state === "dead" ||
|
|
162
|
+
(marked !== undefined &&
|
|
163
|
+
marked.start !== undefined &&
|
|
164
|
+
state.start !== undefined &&
|
|
165
|
+
marked.start !== state.start);
|
|
166
|
+
if (stale) {
|
|
167
|
+
(0, node_fs_1.rmSync)(path, { recursive: true, force: true });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The final artifacts of the packages `packageIds` that a staged `build`
|
|
173
|
+
* command linked into `stage` (`DES-BATCH`, "Staged builds"; `DES-OUTPUTS`):
|
|
174
|
+
* from cargo's `compiler-artifact` messages in `output`, the files of each
|
|
175
|
+
* `bin`, `cdylib` and `staticlib` target that lie in the stage, the
|
|
176
|
+
* split-debuginfo files among them, and never an `rlib`, `rmeta` or the
|
|
177
|
+
* file of a `dylib` or proc macro; and the dependency record that cargo
|
|
178
|
+
* wrote beside a file of any target of the packages, where there is one,
|
|
179
|
+
* which the build input check reads, also a library's that is only an
|
|
180
|
+
* `rlib` (`DES-BUILD-INPUT-CHECK`). A file that a message names outside the
|
|
181
|
+
* stage, such as a library's `rmeta` in the build directory, is not the
|
|
182
|
+
* command's to move.
|
|
183
|
+
*/
|
|
184
|
+
// @mara implements DES-BATCH
|
|
185
|
+
function stagedFinalFiles(output, stage, packageIds) {
|
|
186
|
+
var _a;
|
|
187
|
+
const files = new Map();
|
|
188
|
+
const add = (from, packageId) => {
|
|
189
|
+
const inside = withinFolder(stage.path, from);
|
|
190
|
+
if (inside !== undefined && !files.has(from)) {
|
|
191
|
+
files.set(from, { from, to: (0, node_path_1.join)(stage.directories.artifact, inside), packageId });
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
for (const line of output.split("\n")) {
|
|
195
|
+
if (!line.startsWith("{")) {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
let message;
|
|
199
|
+
try {
|
|
200
|
+
message = JSON.parse(line);
|
|
201
|
+
}
|
|
202
|
+
catch (_b) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (message.reason !== "compiler-artifact" ||
|
|
206
|
+
typeof message.package_id !== "string" ||
|
|
207
|
+
!packageIds.has(message.package_id) ||
|
|
208
|
+
!Array.isArray((_a = message.target) === null || _a === void 0 ? void 0 : _a.kind) ||
|
|
209
|
+
!Array.isArray(message.filenames)) {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const kinds = message.target.kind;
|
|
213
|
+
for (const file of message.filenames) {
|
|
214
|
+
if (typeof file !== "string") {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (finalArtifact(kinds, file)) {
|
|
218
|
+
add(file, message.package_id);
|
|
219
|
+
}
|
|
220
|
+
const record = recordBeside(file);
|
|
221
|
+
if (withinFolder(stage.path, file) !== undefined && (0, node_fs_1.existsSync)(record)) {
|
|
222
|
+
add(record, message.package_id);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return [...files.values()];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Moves each staged file to its place in the artifact directory, a staged
|
|
230
|
+
* build's file or a test group's kept one (`DES-BATCH`), by rename,
|
|
231
|
+
* which replaces a file there in one step, or, where the two lie on
|
|
232
|
+
* different file systems, by a copy beside the place that is then renamed
|
|
233
|
+
* onto it. Nothing outside the stage is taken and nothing outside the
|
|
234
|
+
* artifact directory is written.
|
|
235
|
+
*
|
|
236
|
+
* @returns A problem for each file that could not be moved, by the package
|
|
237
|
+
* whose target it is.
|
|
238
|
+
*/
|
|
239
|
+
// @mara implements DES-BATCH
|
|
240
|
+
function moveStagedFiles(stage, files) {
|
|
241
|
+
const problems = new Map();
|
|
242
|
+
const fail = (file, problem) => {
|
|
243
|
+
var _a;
|
|
244
|
+
problems.set(file.packageId, [...((_a = problems.get(file.packageId)) !== null && _a !== void 0 ? _a : []), problem]);
|
|
245
|
+
};
|
|
246
|
+
for (const file of files) {
|
|
247
|
+
const inside = withinFolder(stage.path, file.from);
|
|
248
|
+
if (inside === undefined ||
|
|
249
|
+
file.to !== (0, node_path_1.join)(stage.directories.artifact, inside) ||
|
|
250
|
+
withinFolder((0, node_path_1.join)(stage.directories.artifact, exports.stageFolderName), file.to) !== undefined) {
|
|
251
|
+
fail(file, `${file.from} is no file of the stage ${stage.path}`);
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
try {
|
|
255
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(file.to), { recursive: true });
|
|
256
|
+
try {
|
|
257
|
+
(0, node_fs_1.renameSync)(file.from, file.to);
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
if (error.code !== "EXDEV") {
|
|
261
|
+
throw error;
|
|
262
|
+
}
|
|
263
|
+
const copy = (0, node_path_1.join)((0, node_path_1.dirname)(file.to), `.${(0, node_path_1.basename)(file.to)}.nx-rust-${process.pid}`);
|
|
264
|
+
try {
|
|
265
|
+
(0, node_fs_1.copyFileSync)(file.from, copy);
|
|
266
|
+
(0, node_fs_1.renameSync)(copy, file.to);
|
|
267
|
+
}
|
|
268
|
+
catch (copyError) {
|
|
269
|
+
(0, node_fs_1.rmSync)(copy, { force: true });
|
|
270
|
+
throw copyError;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
fail(file, `could not move ${file.from} to ${file.to}: ${messageOf(error)}`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return problems;
|
|
279
|
+
}
|
|
280
|
+
/** This process, as a stage's marker records it. */
|
|
281
|
+
function currentOwner() {
|
|
282
|
+
return { pid: process.pid, start: processStart(process.pid) };
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Whether the process `pid` runs, and when it started: `"dead"` where the
|
|
286
|
+
* system has no such process; where it has one that another user owns, it
|
|
287
|
+
* runs.
|
|
288
|
+
*/
|
|
289
|
+
function processState(pid) {
|
|
290
|
+
try {
|
|
291
|
+
process.kill(pid, 0);
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
if (error.code === "ESRCH") {
|
|
295
|
+
return "dead";
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return { pid, start: processStart(pid) };
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* When the process `pid` started, as the system tells it, so that two
|
|
302
|
+
* readings of one process agree and a process that got another's id
|
|
303
|
+
* differs: on Linux, field 22 of `/proc/<pid>/stat`, in clock ticks since
|
|
304
|
+
* boot; elsewhere, `ps -o lstart=`. `undefined` where neither tells it.
|
|
305
|
+
*/
|
|
306
|
+
function processStart(pid) {
|
|
307
|
+
try {
|
|
308
|
+
const stat = (0, node_fs_1.readFileSync)(`/proc/${pid}/stat`, "utf8");
|
|
309
|
+
// The command name, field 2, is in parentheses and may hold spaces.
|
|
310
|
+
const fields = stat.slice(stat.lastIndexOf(")") + 2).split(" ");
|
|
311
|
+
const ticks = fields[19];
|
|
312
|
+
if (ticks !== undefined && /^\d+$/.test(ticks)) {
|
|
313
|
+
return `ticks:${ticks}`;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
catch (_a) {
|
|
317
|
+
// No /proc, as on macOS.
|
|
318
|
+
}
|
|
319
|
+
const run = (0, node_child_process_1.spawnSync)("ps", ["-o", "lstart=", "-p", String(pid)], {
|
|
320
|
+
encoding: "utf8",
|
|
321
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
322
|
+
});
|
|
323
|
+
const started = run.status === 0 ? run.stdout.trim() : "";
|
|
324
|
+
return started === "" ? undefined : `lstart:${started}`;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Where `file`, a path inside the stage's artifact directory, lies in the
|
|
328
|
+
* stage: at the same path relative to the artifact directory, as a staged
|
|
329
|
+
* command's files lie relative to the stage. `undefined` for a file
|
|
330
|
+
* outside the artifact directory, or in its folder of stages.
|
|
331
|
+
*/
|
|
332
|
+
function pathInStage(stage, file) {
|
|
333
|
+
const inside = withinFolder(stage.directories.artifact, file);
|
|
334
|
+
return inside === undefined ||
|
|
335
|
+
withinFolder((0, node_path_1.join)(stage.directories.artifact, exports.stageFolderName), file) !== undefined
|
|
336
|
+
? undefined
|
|
337
|
+
: (0, node_path_1.join)(stage.path, inside);
|
|
338
|
+
}
|
|
339
|
+
/** Whether `path` is a stage of `artifactDirectory`. */
|
|
340
|
+
function isStagePath(path, artifactDirectory) {
|
|
341
|
+
return ((0, node_path_1.dirname)(path) === (0, node_path_1.join)(artifactDirectory, exports.stageFolderName) &&
|
|
342
|
+
stageNamePattern.test((0, node_path_1.basename)(path)));
|
|
343
|
+
}
|
|
344
|
+
// Whether `file` of a target of `kinds` is a final artifact that `build`
|
|
345
|
+
// declares (`DES-OUTPUTS`): an executable, or the file of a `cdylib` or
|
|
346
|
+
// `staticlib`, with its split-debuginfo file; not an `rlib` or `rmeta`, nor
|
|
347
|
+
// the library of a `dylib` or proc macro that shares a name with a `cdylib`'s.
|
|
348
|
+
function finalArtifact(kinds, file) {
|
|
349
|
+
if (/\.(rlib|rmeta)$/.test(file)) {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
if (kinds.includes("bin")) {
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
if (/\.(a|lib)(\.dwp)?$/.test(file)) {
|
|
356
|
+
return kinds.includes("staticlib");
|
|
357
|
+
}
|
|
358
|
+
return kinds.includes("cdylib");
|
|
359
|
+
}
|
|
360
|
+
// The dependency record that cargo writes beside a file that it links into
|
|
361
|
+
// the artifact directory: `<name>.d` for `<name>`, `<name>.wasm`,
|
|
362
|
+
// `lib<name>.so`, `.dylib`, `.a` or `.rlib`, and their split-debuginfo files.
|
|
363
|
+
function recordBeside(file) {
|
|
364
|
+
const name = (0, node_path_1.basename)(file)
|
|
365
|
+
.replace(/\.dwp$/, "")
|
|
366
|
+
.replace(/\.(so|dylib|a|lib|dll|wasm|exe|rlib|rmeta)$/, "");
|
|
367
|
+
return (0, node_path_1.join)((0, node_path_1.dirname)(file), `${name}.d`);
|
|
368
|
+
}
|
|
369
|
+
// `path` relative to `folder`, where it lies inside it.
|
|
370
|
+
function withinFolder(folder, path) {
|
|
371
|
+
if (!(0, node_path_1.isAbsolute)(path)) {
|
|
372
|
+
return undefined;
|
|
373
|
+
}
|
|
374
|
+
const inside = (0, node_path_1.relative)(folder, path);
|
|
375
|
+
return inside === "" || inside === ".." || inside.startsWith(`..${node_path_1.sep}`) || (0, node_path_1.isAbsolute)(inside)
|
|
376
|
+
? undefined
|
|
377
|
+
: inside;
|
|
378
|
+
}
|
|
379
|
+
// Makes the stage folder `path`; `false` where this process made it
|
|
380
|
+
// before, so that the caller takes the next name. A folder of this process's
|
|
381
|
+
// id that this process did not make is an earlier process's leftover, which
|
|
382
|
+
// is removed first.
|
|
383
|
+
function makeFolder(path, owner) {
|
|
384
|
+
try {
|
|
385
|
+
(0, node_fs_1.mkdirSync)(path);
|
|
386
|
+
return true;
|
|
387
|
+
}
|
|
388
|
+
catch (error) {
|
|
389
|
+
if (error.code !== "EEXIST") {
|
|
390
|
+
throw new StageError(`could not make the stage ${path}: ${messageOf(error)}`);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
if (sameOwner(readOwner(path), owner)) {
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
(0, node_fs_1.rmSync)(path, { recursive: true, force: true });
|
|
397
|
+
try {
|
|
398
|
+
(0, node_fs_1.mkdirSync)(path);
|
|
399
|
+
return true;
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
throw new StageError(`could not make the stage ${path}: ${messageOf(error)}`);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function readOwner(path) {
|
|
406
|
+
try {
|
|
407
|
+
const owner = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(path, ownerFileName), "utf8"));
|
|
408
|
+
return typeof owner.pid === "number"
|
|
409
|
+
? { pid: owner.pid, start: typeof owner.start === "string" ? owner.start : undefined }
|
|
410
|
+
: undefined;
|
|
411
|
+
}
|
|
412
|
+
catch (_a) {
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function sameOwner(a, b) {
|
|
417
|
+
return a !== undefined && a.pid === b.pid && a.start === b.start;
|
|
418
|
+
}
|
|
419
|
+
function messageOf(error) {
|
|
420
|
+
return error instanceof Error ? error.message : String(error);
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Whether a group's cargo command builds in a stage (`DES-BATCH`, "Staged
|
|
424
|
+
* builds"): a `build` that selects the whole workspace, which would link
|
|
425
|
+
* every member's final artifacts, and every compile of `napi-build` and
|
|
426
|
+
* `wasm-build`, which moves none. A `build` that selects its crates with
|
|
427
|
+
* `-p` writes only theirs, and `test`, `bench`, `check`, `lint` and `doc`
|
|
428
|
+
* are never staged: `cargo test` would fix the stage's path into
|
|
429
|
+
* `CARGO_BIN_EXE_<name>` (`EVD-STAGED-BUILDS`).
|
|
430
|
+
*/
|
|
431
|
+
// @mara implements DES-BATCH
|
|
432
|
+
function stagesCommand(target, selection) {
|
|
433
|
+
return ((target === "build" && selection.kind === "workspace") ||
|
|
434
|
+
target === "napi-build" ||
|
|
435
|
+
target === "wasm-build");
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* The group's command with the flags of `stage` after the target's own
|
|
439
|
+
* arguments of every step, and, where `recordsInStage`, as for a
|
|
440
|
+
* `napi-build` or `wasm-build` compile, which moves nothing out of the
|
|
441
|
+
* stage, the build input check reading the records there.
|
|
442
|
+
*/
|
|
443
|
+
function withStage(invocation, stage, recordsInStage = false) {
|
|
444
|
+
var _a;
|
|
445
|
+
const flags = stageFlags(stage);
|
|
446
|
+
const add = (args) => {
|
|
447
|
+
const separator = args.indexOf("--");
|
|
448
|
+
return separator === -1
|
|
449
|
+
? [...args, ...flags]
|
|
450
|
+
: [...args.slice(0, separator), ...flags, ...args.slice(separator)];
|
|
451
|
+
};
|
|
452
|
+
return Object.assign(Object.assign(Object.assign({}, invocation), { unstagedArgs: (_a = invocation.unstagedArgs) !== null && _a !== void 0 ? _a : invocation.args, args: add(invocation.args), steps: invocation.steps.map((step) => (Object.assign(Object.assign({}, step), { args: add(step.args) }))) }), (invocation.inputCheck === undefined || !recordsInStage
|
|
453
|
+
? {}
|
|
454
|
+
: { inputCheck: Object.assign(Object.assign({}, invocation.inputCheck), { recordsFolder: stage.path }) }));
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* The `build` tasks of `ids` that share a folder of the artifact directory
|
|
458
|
+
* with another `build` task of the same project in the command, each with
|
|
459
|
+
* its message (`DES-BATCH`, "Files that a batch stores"). The folder is
|
|
460
|
+
* judged by what Nx itself resolved: the outputs of the tasks in the
|
|
461
|
+
* command's task graph, for the task and its peers alike, which name the
|
|
462
|
+
* artifact directory, the triple folder and the profile folder
|
|
463
|
+
* (`DES-OUTPUTS`). Two tasks collide where an output of one is an output of
|
|
464
|
+
* the other or lies inside it, so that each would store what the other's
|
|
465
|
+
* cargo command wrote, which no stage keeps apart. A task whose outputs name
|
|
466
|
+
* nothing, such as an uncached `build`, is not judged: Nx stores nothing for
|
|
467
|
+
* it. The maintainer decided on 20 November 2026 that such tasks fail with
|
|
468
|
+
* guidance instead of sharing a command.
|
|
469
|
+
*/
|
|
470
|
+
// @mara implements DES-BATCH
|
|
471
|
+
// @mara implements DES-DIAGNOSTICS
|
|
472
|
+
function sharedBuildFolders(ids, context) {
|
|
473
|
+
var _a, _b, _c, _d;
|
|
474
|
+
const graph = (_b = (_a = context.taskGraph) === null || _a === void 0 ? void 0 : _a.tasks) !== null && _b !== void 0 ? _b : {};
|
|
475
|
+
const builds = Object.entries(graph).filter(([, task]) => {
|
|
476
|
+
var _a, _b, _c, _d, _e;
|
|
477
|
+
const { project, target } = task.target;
|
|
478
|
+
const metadata = (_e = (_d = (_c = (_b = (_a = context.projectGraph) === null || _a === void 0 ? void 0 : _a.nodes[project]) === null || _b === void 0 ? void 0 : _b.data.targets) === null || _c === void 0 ? void 0 : _c[target]) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e[targets_1.targetCargoMetadataKey];
|
|
479
|
+
return (metadata === null || metadata === void 0 ? void 0 : metadata.target) === "build";
|
|
480
|
+
});
|
|
481
|
+
const refused = new Map();
|
|
482
|
+
for (const id of ids) {
|
|
483
|
+
const task = graph[id];
|
|
484
|
+
if (task === undefined) {
|
|
485
|
+
continue;
|
|
486
|
+
}
|
|
487
|
+
const own = ((_c = task.outputs) !== null && _c !== void 0 ? _c : []).map((output) => (0, node_path_1.normalize)(output));
|
|
488
|
+
const folders = new Set();
|
|
489
|
+
const others = [];
|
|
490
|
+
for (const [otherId, other] of builds) {
|
|
491
|
+
if (otherId === id || other.target.project !== task.target.project) {
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
const shared = sharedOutput(own, ((_d = other.outputs) !== null && _d !== void 0 ? _d : []).map((output) => (0, node_path_1.normalize)(output)));
|
|
495
|
+
if (shared !== undefined) {
|
|
496
|
+
others.push(otherId);
|
|
497
|
+
folders.add(shared);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
if (others.length > 0) {
|
|
501
|
+
const named = [...folders].join(" and ");
|
|
502
|
+
refused.set(id, `${id}: ${others.join(" and ")} of this command ${others.length === 1 ? "builds" : "build"} the same crate into the same folder of its artifact directory, ${named}, so that each would store the files that the other's cargo command wrote. The task does not run, so that Nx stores no result for it. Run these tasks in separate nx commands.`);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return refused;
|
|
506
|
+
}
|
|
507
|
+
// The folder of an output that two lists share, an output of one being one
|
|
508
|
+
// of the other or lying inside it, as the outputs name it relative to the
|
|
509
|
+
// repository; `undefined` where they share none.
|
|
510
|
+
function sharedOutput(a, b) {
|
|
511
|
+
for (const x of a) {
|
|
512
|
+
for (const y of b) {
|
|
513
|
+
if (x === y) {
|
|
514
|
+
return (0, node_path_1.dirname)(x);
|
|
515
|
+
}
|
|
516
|
+
if (x.startsWith(`${y}/`)) {
|
|
517
|
+
return y;
|
|
518
|
+
}
|
|
519
|
+
if (y.startsWith(`${x}/`)) {
|
|
520
|
+
return x;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return undefined;
|
|
525
|
+
}
|
|
526
|
+
//# sourceMappingURL=stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/stage.ts"],"names":[],"mappings":";;;AAmEA,gCAOC;AAGD,gCAaC;AAeD,kCAyBC;AASD,kCAUC;AAYD,8CAkCC;AA0BD,4CAmDC;AAcD,0CAqCC;AAGD,oCAEC;AAOD,oCASC;AAQD,oCAkBC;AAQD,kCAMC;AAGD,kCAKC;AAgGD,sCAMC;AAQD,8BAqBC;AAkBD,gDA2CC;AAxkBD,2DAA+C;AAC/C,qCASiB;AACjB,yCAA0F;AAG1F,8CAA0D;AAI1D;;;;;GAKG;AACU,QAAA,eAAe,GAAG,gBAAgB,CAAC;AAEhD,2DAA2D;AAC3D,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,sEAAsE;AACtE,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAsBzC,iCAAiC;AACjC,MAAa,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC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C;gBACzB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACrB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CACT,EAAE,EACF,GAAG,EAAE,KAAK,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,mEAAmE,KAAK,gLAAgL,CACnV,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,2EAA2E;AAC3E,0EAA0E;AAC1E,iDAAiD;AACjD,SAAS,YAAY,CAAC,CAAoB,EAAE,CAAoB;IAC9D,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAClB,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACZ,OAAO,IAAA,mBAAO,EAAC,CAAC,CAAC,CAAC;YACpB,CAAC;YACD,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC1B,OAAO,CAAC,CAAC;YACX,CAAC;YACD,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC1B,OAAO,CAAC,CAAC;YACX,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type GroupMember, type LiveOutput, type MemberResult } from "./group-run";
|
|
2
|
+
import type { GroupSelection } from "./groups";
|
|
3
|
+
/**
|
|
4
|
+
* Runs a group of tasks with the runner of its target, in a batch or as a
|
|
5
|
+
* task run on its own: `runNapiGroup` for `napi-build`, `runWasmGroup` for
|
|
6
|
+
* `wasm-build` and `runGroup` for every other target (`DES-NAPI`,
|
|
7
|
+
* `DES-WASM`). A whole-workspace `build` and every compile of `napi-build`
|
|
8
|
+
* and `wasm-build` build in a stage of their own (`DES-BATCH`, "Staged
|
|
9
|
+
* builds"): a `build` moves its own crates' final artifacts and records out
|
|
10
|
+
* of it right after cargo, before the checks that read them, and a
|
|
11
|
+
* `napi-build` or `wasm-build` post-processes and checks from the stage. The
|
|
12
|
+
* stage is removed once the group is done, whatever happened. Where the
|
|
13
|
+
* stage cannot be made, every task fails before cargo; where a file of a
|
|
14
|
+
* task's crate cannot be moved, the task fails.
|
|
15
|
+
*
|
|
16
|
+
* @returns One result per member, in order.
|
|
17
|
+
*/
|
|
18
|
+
export declare function runTargetGroup(members: readonly GroupMember[], selection: GroupSelection, verbose: boolean, live?: LiveOutput): Promise<MemberResult[]>;
|
|
19
|
+
/**
|
|
20
|
+
* The message of a task whose staged group could not make its stage, get
|
|
21
|
+
* Cargo's directories for it, or move a file of the task's crate out of it
|
|
22
|
+
* (`DES-BATCH`, "Staged builds"; `DES-DIAGNOSTICS`).
|
|
23
|
+
*/
|
|
24
|
+
export declare function stageMessage(task: string, problems: readonly string[]): string;
|