@convesoft/nx-rust 0.0.0 → 1.0.0-rc.2
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/PLUGIN.md +106 -0
- package/README.md +51 -1
- package/docs/artifacts.mara.md +374 -0
- package/docs/caching.mara.md +999 -0
- package/docs/ci.mara.md +308 -0
- package/docs/configuration.mara.md +508 -0
- package/docs/decisions.mara.md +3267 -0
- package/docs/execution.mara.md +533 -0
- package/docs/index.mara.md +51 -0
- package/docs/product.mara.md +366 -0
- package/docs/release.mara.md +493 -0
- package/docs/setup.mara.md +486 -0
- package/docs/targets.mara.md +704 -0
- package/docs/testing.mara.md +431 -0
- package/docs/verification.mara.md +465 -0
- package/docs/workspaces.mara.md +445 -0
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +17 -4
- package/src/cargo/build-settings.d.ts +61 -0
- package/src/cargo/build-settings.js +103 -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 +114 -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 +90 -0
- package/src/cargo/redirections.js +200 -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/cargo/warnings-setting.d.ts +24 -0
- package/src/cargo/warnings-setting.js +81 -0
- package/src/cargo/warnings-setting.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 +58 -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 +218 -0
- package/src/executors/cargo-output.js +660 -0
- package/src/executors/cargo-output.js.map +1 -0
- package/src/executors/command.d.ts +331 -0
- package/src/executors/command.js +547 -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/denied-warnings.d.ts +99 -0
- package/src/executors/denied-warnings.js +188 -0
- package/src/executors/denied-warnings.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 +601 -0
- package/src/executors/group-run.js.map +1 -0
- package/src/executors/groups.d.ts +118 -0
- package/src/executors/groups.js +304 -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 +189 -0
- package/src/executors/nextest.js +504 -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 +435 -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 +527 -0
- package/src/executors/task.js.map +1 -0
- package/src/executors/test-mode.d.ts +185 -0
- package/src/executors/test-mode.js +397 -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 +121 -0
- package/src/executors/test-steps.js +566 -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 +681 -0
- package/src/graph/caching.js.map +1 -0
- package/src/graph/clippy-input.d.ts +53 -0
- package/src/graph/clippy-input.js +107 -0
- package/src/graph/clippy-input.js.map +1 -0
- package/src/graph/collisions.d.ts +113 -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 +190 -0
- package/src/graph/discovery.js +661 -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 +422 -0
- package/src/graph/inputs.js +756 -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 +193 -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/rustfmt-config.d.ts +42 -0
- package/src/graph/rustfmt-config.js +173 -0
- package/src/graph/rustfmt-config.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 +371 -0
- package/src/graph/targets.js +408 -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,61 @@
|
|
|
1
|
+
/** One value of a key of the `[build]` table in a configuration file that cargo reads. */
|
|
2
|
+
export interface BuildSetting {
|
|
3
|
+
/** The absolute path of the file. */
|
|
4
|
+
file: string;
|
|
5
|
+
/** The value as the file gives it. */
|
|
6
|
+
value: unknown;
|
|
7
|
+
/** Whether cargo reads the file only because another one includes it. */
|
|
8
|
+
included: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A configuration file that cargo reads but that exists and cannot be read
|
|
12
|
+
* or parsed, so that whether it sets a key is unknown.
|
|
13
|
+
*/
|
|
14
|
+
export interface UnreadableFile {
|
|
15
|
+
/** The absolute path of the file. */
|
|
16
|
+
file: string;
|
|
17
|
+
unreadable: true;
|
|
18
|
+
/** Whether cargo reads the file only because another one includes it. */
|
|
19
|
+
included: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The values of `build.<key>` in the configuration files that cargo reads
|
|
23
|
+
* for a command started in `folder`, in descending precedence:
|
|
24
|
+
*
|
|
25
|
+
* - The files are those of `folder`, of each folder above it and of the
|
|
26
|
+
* Cargo home ({@link configFiles}), with the files they include.
|
|
27
|
+
* - A deeper folder comes before the folders above it, a file's own value
|
|
28
|
+
* before the files it includes, and a later include before an earlier
|
|
29
|
+
* one, each with its own includes after it.
|
|
30
|
+
* - Each file of the walk counts in its own place, also where a deeper
|
|
31
|
+
* file includes it too: cargo loads each file of the walk with its own
|
|
32
|
+
* includes, so later versions read such a file in both places, and Cargo
|
|
33
|
+
* 1.91, which ignores `include`, in its own place only
|
|
34
|
+
* (`EVD-CARGO-COMPILER-SELECTION`). Within one file of the walk, a file
|
|
35
|
+
* that several includes name counts once, and the Cargo home counts once
|
|
36
|
+
* where it is also one of the folders.
|
|
37
|
+
* - Files that do not exist, or that exist and cannot be read or parsed,
|
|
38
|
+
* are skipped: graph creation reports the latter, and cargo fails on
|
|
39
|
+
* them. {@link buildSettingsAndUnreadable} names those in their place.
|
|
40
|
+
*
|
|
41
|
+
* Cargo 1.91 ignores `include` and later versions apply it, so each value
|
|
42
|
+
* says whether cargo reads it only through an include: the values that
|
|
43
|
+
* are not are those that Cargo 1.91 reads.
|
|
44
|
+
*
|
|
45
|
+
* @param env Where `CARGO_HOME` is read from.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildSettings(folder: string, env: Readonly<Record<string, string | undefined>>, key: string): BuildSetting[];
|
|
48
|
+
/**
|
|
49
|
+
* The values of `<table>.<key>` in the configuration files that cargo reads
|
|
50
|
+
* for a command started in `folder`, found and ordered as
|
|
51
|
+
* {@link buildSettings} finds those of `build.<key>`, such as the values of
|
|
52
|
+
* `env.CLIPPY_CONF_DIR`.
|
|
53
|
+
*/
|
|
54
|
+
export declare function tableSettings(folder: string, env: Readonly<Record<string, string | undefined>>, table: string, key: string): BuildSetting[];
|
|
55
|
+
/**
|
|
56
|
+
* {@link buildSettings}, with each file that exists but cannot be read or
|
|
57
|
+
* parsed in its place in the order, for a reader that must not guess past
|
|
58
|
+
* it. Only a file that does not exist counts as absent; a file whose folder
|
|
59
|
+
* is no folder, such as a `.cargo` that is a file, counts as unreadable.
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildSettingsAndUnreadable(folder: string, env: Readonly<Record<string, string | undefined>>, key: string, table?: string): (BuildSetting | UnreadableFile)[];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildSettings = buildSettings;
|
|
4
|
+
exports.tableSettings = tableSettings;
|
|
5
|
+
exports.buildSettingsAndUnreadable = buildSettingsAndUnreadable;
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const smol_toml_1 = require("smol-toml");
|
|
9
|
+
const redirections_1 = require("./redirections");
|
|
10
|
+
/**
|
|
11
|
+
* The values of `build.<key>` in the configuration files that cargo reads
|
|
12
|
+
* for a command started in `folder`, in descending precedence:
|
|
13
|
+
*
|
|
14
|
+
* - The files are those of `folder`, of each folder above it and of the
|
|
15
|
+
* Cargo home ({@link configFiles}), with the files they include.
|
|
16
|
+
* - A deeper folder comes before the folders above it, a file's own value
|
|
17
|
+
* before the files it includes, and a later include before an earlier
|
|
18
|
+
* one, each with its own includes after it.
|
|
19
|
+
* - Each file of the walk counts in its own place, also where a deeper
|
|
20
|
+
* file includes it too: cargo loads each file of the walk with its own
|
|
21
|
+
* includes, so later versions read such a file in both places, and Cargo
|
|
22
|
+
* 1.91, which ignores `include`, in its own place only
|
|
23
|
+
* (`EVD-CARGO-COMPILER-SELECTION`). Within one file of the walk, a file
|
|
24
|
+
* that several includes name counts once, and the Cargo home counts once
|
|
25
|
+
* where it is also one of the folders.
|
|
26
|
+
* - Files that do not exist, or that exist and cannot be read or parsed,
|
|
27
|
+
* are skipped: graph creation reports the latter, and cargo fails on
|
|
28
|
+
* them. {@link buildSettingsAndUnreadable} names those in their place.
|
|
29
|
+
*
|
|
30
|
+
* Cargo 1.91 ignores `include` and later versions apply it, so each value
|
|
31
|
+
* says whether cargo reads it only through an include: the values that
|
|
32
|
+
* are not are those that Cargo 1.91 reads.
|
|
33
|
+
*
|
|
34
|
+
* @param env Where `CARGO_HOME` is read from.
|
|
35
|
+
*/
|
|
36
|
+
function buildSettings(folder, env, key) {
|
|
37
|
+
return tableSettings(folder, env, "build", key);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The values of `<table>.<key>` in the configuration files that cargo reads
|
|
41
|
+
* for a command started in `folder`, found and ordered as
|
|
42
|
+
* {@link buildSettings} finds those of `build.<key>`, such as the values of
|
|
43
|
+
* `env.CLIPPY_CONF_DIR`.
|
|
44
|
+
*/
|
|
45
|
+
function tableSettings(folder, env, table, key) {
|
|
46
|
+
return buildSettingsAndUnreadable(folder, env, key, table).filter((entry) => !("unreadable" in entry));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* {@link buildSettings}, with each file that exists but cannot be read or
|
|
50
|
+
* parsed in its place in the order, for a reader that must not guess past
|
|
51
|
+
* it. Only a file that does not exist counts as absent; a file whose folder
|
|
52
|
+
* is no folder, such as a `.cargo` that is a file, counts as unreadable.
|
|
53
|
+
*/
|
|
54
|
+
function buildSettingsAndUnreadable(folder, env, key, table = "build") {
|
|
55
|
+
const entries = [];
|
|
56
|
+
const walked = new Set();
|
|
57
|
+
for (const [legacy, current] of (0, redirections_1.configFiles)(folder, env)) {
|
|
58
|
+
const file = (0, node_fs_1.existsSync)(legacy) ? legacy : current;
|
|
59
|
+
if (!walked.has(file)) {
|
|
60
|
+
walked.add(file);
|
|
61
|
+
// A record of its own, so that a file that a deeper file includes
|
|
62
|
+
// still counts here, where Cargo 1.91 reads it.
|
|
63
|
+
collect(file, table, key, false, new Set(), entries);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return entries;
|
|
67
|
+
}
|
|
68
|
+
// Adds the value of `<tableName>.<key>` in `file` and in the files it
|
|
69
|
+
// includes, in descending precedence: the file's own value, then its
|
|
70
|
+
// includes from the last to the first, each with its own includes after it.
|
|
71
|
+
function collect(file, tableName, key, included, read, entries) {
|
|
72
|
+
if (read.has(file)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
read.add(file);
|
|
76
|
+
let table;
|
|
77
|
+
try {
|
|
78
|
+
table = (0, smol_toml_1.parse)((0, node_fs_1.readFileSync)(file, "utf8"));
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
if (error.code !== "ENOENT") {
|
|
82
|
+
entries.push({ file, unreadable: true, included });
|
|
83
|
+
}
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const settings = asTable(table[tableName]);
|
|
87
|
+
if (settings[key] !== undefined) {
|
|
88
|
+
entries.push({ file, value: settings[key], included });
|
|
89
|
+
}
|
|
90
|
+
const includes = Array.isArray(table.include) ? table.include : [table.include];
|
|
91
|
+
for (const include of [...includes].reverse()) {
|
|
92
|
+
const path = typeof include === "string" ? include : asTable(include).path;
|
|
93
|
+
if (typeof path === "string") {
|
|
94
|
+
collect((0, node_path_1.resolve)((0, node_path_1.dirname)(file), path), tableName, key, true, read, entries);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function asTable(value) {
|
|
99
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
100
|
+
? value
|
|
101
|
+
: {};
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=build-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-settings.js","sourceRoot":"","sources":["../../../../nx-rust/src/cargo/build-settings.ts"],"names":[],"mappings":";;AAqDA,sCAMC;AAQD,sCASC;AAQD,gEAkBC;AAtGD,qCAAmD;AACnD,yCAA6C;AAC7C,yCAAkC;AAClC,iDAA6C;AAwB7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,aAAa,CAC3B,MAAc,EACd,GAAiD,EACjD,GAAW;IAEX,OAAO,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAC3B,MAAc,EACd,GAAiD,EACjD,KAAa,EACb,GAAW;IAEX,OAAO,0BAA0B,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,MAAM,CAC/D,CAAC,KAAK,EAAyB,EAAE,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,CAAC,CAC3D,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,MAAc,EACd,GAAiD,EACjD,GAAW,EACX,KAAK,GAAG,OAAO;IAEf,MAAM,OAAO,GAAsC,EAAE,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAA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C;QAChC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChF,KAAK,MAAM,OAAO,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;QAC3E,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAA,mBAAO,EAAC,IAAA,mBAAO,EAAC,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAE,KAAiC;QACpC,CAAC,CAAC,EAAE,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Where a runner for the host is or may be configured, as a task's output names it. */
|
|
2
|
+
export interface ConfiguredRunner {
|
|
3
|
+
/** The variable or the absolute path of the file. */
|
|
4
|
+
source: string;
|
|
5
|
+
/** What it sets, or why it counts. */
|
|
6
|
+
detail: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The name of the variable through which cargo takes a runner for `triple`:
|
|
10
|
+
* `CARGO_TARGET_<TRIPLE>_RUNNER`, with the triple in capitals and `-` and `.`
|
|
11
|
+
* replaced by `_`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runnerVariable(triple: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Where a runner for the host is or may be configured for a cargo command
|
|
16
|
+
* started in `workspaceRoot` with `env` (`DES-TEST-RUN`, "A runner the user
|
|
17
|
+
* configured"), the first that the plugin finds, or `undefined`:
|
|
18
|
+
*
|
|
19
|
+
* - `CARGO_TARGET_<HOST>_RUNNER` in `env`, whatever its value;
|
|
20
|
+
* - a configuration file that cargo may read there that sets `runner` in the
|
|
21
|
+
* table `target.<host>`, or in any table under `target` whose key starts
|
|
22
|
+
* with `cfg(`, whether or not its expression matches the host. The files
|
|
23
|
+
* are `.cargo/config` and `.cargo/config.toml` in `workspaceRoot` and in
|
|
24
|
+
* each folder above it, both where both exist; `config` and `config.toml`
|
|
25
|
+
* in the Cargo home that `CARGO_HOME` in `env` names, or else in `.cargo`
|
|
26
|
+
* in the home folder; and every file that one of them adds with
|
|
27
|
+
* `include`, in any form and whatever the cargo version reads, with paths
|
|
28
|
+
* taken from the folder of the file that includes it;
|
|
29
|
+
* - such a file that exists and cannot be read or parsed, so that whether it
|
|
30
|
+
* sets a runner is unknown.
|
|
31
|
+
*
|
|
32
|
+
* Reading the user's runner as cargo applies it is not attempted: no reading
|
|
33
|
+
* gives what cargo uses in every case on Cargo 1.91 and 1.100
|
|
34
|
+
* (`EVD-WORKSPACE-TEST-SELECTION`), so every place where one may be counts.
|
|
35
|
+
*/
|
|
36
|
+
export declare function configuredRunner(workspaceRoot: string, env: Readonly<Record<string, string | undefined>>, host: string): ConfiguredRunner | undefined;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runnerVariable = runnerVariable;
|
|
4
|
+
exports.configuredRunner = configuredRunner;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const smol_toml_1 = require("smol-toml");
|
|
8
|
+
const redirections_1 = require("./redirections");
|
|
9
|
+
/**
|
|
10
|
+
* The name of the variable through which cargo takes a runner for `triple`:
|
|
11
|
+
* `CARGO_TARGET_<TRIPLE>_RUNNER`, with the triple in capitals and `-` and `.`
|
|
12
|
+
* replaced by `_`.
|
|
13
|
+
*/
|
|
14
|
+
function runnerVariable(triple) {
|
|
15
|
+
return `CARGO_TARGET_${triple.toUpperCase().replace(/[-.]/g, "_")}_RUNNER`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Where a runner for the host is or may be configured for a cargo command
|
|
19
|
+
* started in `workspaceRoot` with `env` (`DES-TEST-RUN`, "A runner the user
|
|
20
|
+
* configured"), the first that the plugin finds, or `undefined`:
|
|
21
|
+
*
|
|
22
|
+
* - `CARGO_TARGET_<HOST>_RUNNER` in `env`, whatever its value;
|
|
23
|
+
* - a configuration file that cargo may read there that sets `runner` in the
|
|
24
|
+
* table `target.<host>`, or in any table under `target` whose key starts
|
|
25
|
+
* with `cfg(`, whether or not its expression matches the host. The files
|
|
26
|
+
* are `.cargo/config` and `.cargo/config.toml` in `workspaceRoot` and in
|
|
27
|
+
* each folder above it, both where both exist; `config` and `config.toml`
|
|
28
|
+
* in the Cargo home that `CARGO_HOME` in `env` names, or else in `.cargo`
|
|
29
|
+
* in the home folder; and every file that one of them adds with
|
|
30
|
+
* `include`, in any form and whatever the cargo version reads, with paths
|
|
31
|
+
* taken from the folder of the file that includes it;
|
|
32
|
+
* - such a file that exists and cannot be read or parsed, so that whether it
|
|
33
|
+
* sets a runner is unknown.
|
|
34
|
+
*
|
|
35
|
+
* Reading the user's runner as cargo applies it is not attempted: no reading
|
|
36
|
+
* gives what cargo uses in every case on Cargo 1.91 and 1.100
|
|
37
|
+
* (`EVD-WORKSPACE-TEST-SELECTION`), so every place where one may be counts.
|
|
38
|
+
*/
|
|
39
|
+
// @mara implements DES-TEST-RUN
|
|
40
|
+
function configuredRunner(workspaceRoot, env, host) {
|
|
41
|
+
const variable = runnerVariable(host);
|
|
42
|
+
if (env[variable] !== undefined) {
|
|
43
|
+
return { source: variable, detail: "is set" };
|
|
44
|
+
}
|
|
45
|
+
const read = new Set();
|
|
46
|
+
for (const pair of (0, redirections_1.configFiles)(workspaceRoot, env)) {
|
|
47
|
+
for (const file of pair) {
|
|
48
|
+
const found = fileRunner(file, host, read);
|
|
49
|
+
if (found !== undefined) {
|
|
50
|
+
return found;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
// The runner that `file`, or a file that it includes, sets or may set.
|
|
57
|
+
function fileRunner(file, host, read) {
|
|
58
|
+
if (read.has(file) || !(0, node_fs_1.existsSync)(file)) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
read.add(file);
|
|
62
|
+
let table;
|
|
63
|
+
try {
|
|
64
|
+
table = (0, smol_toml_1.parse)((0, node_fs_1.readFileSync)(file, "utf8"));
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return {
|
|
68
|
+
source: file,
|
|
69
|
+
detail: `cannot be read or parsed (${error instanceof Error ? error.message.split("\n")[0] : String(error)}), so it may set one`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const targets = asTable(table.target);
|
|
73
|
+
for (const [key, value] of Object.entries(targets)) {
|
|
74
|
+
if ((key === host || key.startsWith("cfg(")) && asTable(value).runner !== undefined) {
|
|
75
|
+
return { source: file, detail: `sets runner under [target.${quotedKey(key)}]` };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const includes = Array.isArray(table.include) ? table.include : [table.include];
|
|
79
|
+
for (const include of includes) {
|
|
80
|
+
const path = typeof include === "string" ? include : asTable(include).path;
|
|
81
|
+
if (typeof path === "string") {
|
|
82
|
+
const found = fileRunner((0, node_path_1.resolve)((0, node_path_1.dirname)(file), path), host, read);
|
|
83
|
+
if (found !== undefined) {
|
|
84
|
+
return found;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
// A key of the `target` table as a TOML table header writes it.
|
|
91
|
+
function quotedKey(key) {
|
|
92
|
+
return /^[A-Za-z0-9_-]+$/.test(key) ? key : `'${key}'`;
|
|
93
|
+
}
|
|
94
|
+
function asTable(value) {
|
|
95
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
96
|
+
? value
|
|
97
|
+
: {};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=configured-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configured-runner.js","sourceRoot":"","sources":["../../../../nx-rust/src/cargo/configured-runner.ts"],"names":[],"mappings":";;AAkBA,wCAEC;AAyBD,4CAmBC;AAhED,qCAAmD;AACnD,yCAA6C;AAC7C,yCAAkC;AAClC,iDAA6C;AAU7C;;;;GAIG;AACH,SAAgB,cAAc,CAAC,MAAc;IAC3C,OAAO,gBAAgB,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC;AAC7E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,gCAAgC;AAChC,SAAgB,gBAAgB,CAC9B,aAAqB,EACrB,GAAiD,EACjD,IAAY;IAEZ,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAChD,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,IAAA,0BAAW,EAAC,aAA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
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The programs that `build.rustc` and `build.rustdoc` in Cargo's
|
|
3
|
+
* configuration name for a command started in a workspace root, which cargo
|
|
4
|
+
* runs in place of `rustc` and `rustdoc` unless `RUSTC`, `CARGO_BUILD_RUSTC`,
|
|
5
|
+
* `RUSTDOC` or `CARGO_BUILD_RUSTDOC` names another (`DES-INPUTS`,
|
|
6
|
+
* `EVD-CARGO-COMPILER-SELECTION`).
|
|
7
|
+
*
|
|
8
|
+
* Each list names every program that a setting makes cargo run, once: none
|
|
9
|
+
* where no file sets the key, and otherwise the one that the files give.
|
|
10
|
+
* Where a file that `include` adds sets it, Cargo 1.91, which ignores
|
|
11
|
+
* `include`, may take another value than later versions, and the list then
|
|
12
|
+
* also names that one; where 1.91 finds none, it runs `rustc` or `rustdoc`
|
|
13
|
+
* as without a setting. A program is an absolute path, or a bare name that
|
|
14
|
+
* cargo looks up on `PATH`.
|
|
15
|
+
*/
|
|
16
|
+
export interface ConfiguredTools {
|
|
17
|
+
rustc: string[];
|
|
18
|
+
rustdoc: string[];
|
|
19
|
+
}
|
|
20
|
+
/** The tools of a workspace whose configuration names neither. */
|
|
21
|
+
export declare const noConfiguredTools: ConfiguredTools;
|
|
22
|
+
/**
|
|
23
|
+
* The programs that `build.rustc` and `build.rustdoc` name in the
|
|
24
|
+
* configuration files that cargo reads in `workspaceRoot`, read with the
|
|
25
|
+
* precedence of {@link buildSettings} and resolved as cargo resolves them: a
|
|
26
|
+
* value with a `/` against the folder above the one that holds the file,
|
|
27
|
+
* which for `.cargo/config.toml` is the folder that holds `.cargo` and for
|
|
28
|
+
* the Cargo home's `config.toml` the Cargo home's parent; a value without one
|
|
29
|
+
* stays a bare name. The value of the file with the highest precedence
|
|
30
|
+
* counts, and cargo fails on one that is no string, which names nothing here.
|
|
31
|
+
*
|
|
32
|
+
* @param env Where `CARGO_HOME` is read from; the variables that name a
|
|
33
|
+
* compiler are read by the toolchain input with the task's environment.
|
|
34
|
+
*/
|
|
35
|
+
export declare function configuredTools(workspaceRoot: string, env: NodeJS.ProcessEnv): ConfiguredTools;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.noConfiguredTools = void 0;
|
|
4
|
+
exports.configuredTools = configuredTools;
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const build_settings_1 = require("./build-settings");
|
|
7
|
+
/** The tools of a workspace whose configuration names neither. */
|
|
8
|
+
exports.noConfiguredTools = { rustc: [], rustdoc: [] };
|
|
9
|
+
/**
|
|
10
|
+
* The programs that `build.rustc` and `build.rustdoc` name in the
|
|
11
|
+
* configuration files that cargo reads in `workspaceRoot`, read with the
|
|
12
|
+
* precedence of {@link buildSettings} and resolved as cargo resolves them: a
|
|
13
|
+
* value with a `/` against the folder above the one that holds the file,
|
|
14
|
+
* which for `.cargo/config.toml` is the folder that holds `.cargo` and for
|
|
15
|
+
* the Cargo home's `config.toml` the Cargo home's parent; a value without one
|
|
16
|
+
* stays a bare name. The value of the file with the highest precedence
|
|
17
|
+
* counts, and cargo fails on one that is no string, which names nothing here.
|
|
18
|
+
*
|
|
19
|
+
* @param env Where `CARGO_HOME` is read from; the variables that name a
|
|
20
|
+
* compiler are read by the toolchain input with the task's environment.
|
|
21
|
+
*/
|
|
22
|
+
// @mara implements DES-INPUTS
|
|
23
|
+
function configuredTools(workspaceRoot, env) {
|
|
24
|
+
return {
|
|
25
|
+
rustc: configuredPrograms((0, build_settings_1.buildSettings)(workspaceRoot, env, "rustc")),
|
|
26
|
+
rustdoc: configuredPrograms((0, build_settings_1.buildSettings)(workspaceRoot, env, "rustdoc")),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// The program that the settings name with includes applied, and the one
|
|
30
|
+
// without them, as Cargo 1.91 reads them, each once.
|
|
31
|
+
function configuredPrograms(settings) {
|
|
32
|
+
const programs = [
|
|
33
|
+
program(settings[0]),
|
|
34
|
+
program(settings.find((setting) => !setting.included)),
|
|
35
|
+
].filter((found) => found !== undefined);
|
|
36
|
+
return [...new Set(programs)];
|
|
37
|
+
}
|
|
38
|
+
function program(setting) {
|
|
39
|
+
if (setting === undefined || typeof setting.value !== "string") {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
return setting.value.includes("/")
|
|
43
|
+
? (0, node_path_1.resolve)((0, node_path_1.dirname)((0, node_path_1.dirname)(setting.file)), setting.value)
|
|
44
|
+
: setting.value;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=configured-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configured-tools.js","sourceRoot":"","sources":["../../../../nx-rust/src/cargo/configured-tools.ts"],"names":[],"mappings":";;;AAwCA,0CAKC;AA7CD,yCAA6C;AAC7C,qDAA+D;AAsB/D,kEAAkE;AACrD,QAAA,iBAAiB,GAAoB,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAE7E;;;;;;;;;;;;GAYG;AACH,8BAA8B;AAC9B,SAAgB,eAAe,CAAC,aAAqB,EAAE,GAAsB;IAC3E,OAAO;QACL,KAAK,EAAE,kBAAkB,CAAC,IAAA,8BAAa,EAAC,aAAa,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACrE,OAAO,EAAE,kBAAkB,CAAC,IAAA,8BAAa,EAAC,aAAa,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,wEAAwE;AACxE,qDAAqD;AACrD,SAAS,kBAAkB,CAAC,QAAiC;IAC3D,MAAM,QAAQ,GAAG;QACf,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;KACvD,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,OAAO,CAAC,OAAiC;IAChD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/D,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC,IAAA,mBAAO,EAAC,IAAA,mBAAO,EAAC,IAAA,mBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC;QACxD,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The folder that `build.dep-info-basedir` gives a cargo command started in
|
|
3
|
+
* `folder` with the environment `env`, as an absolute path; `undefined`
|
|
4
|
+
* where nothing sets it or a file that would decide cannot be read.
|
|
5
|
+
*
|
|
6
|
+
* Cargo takes the setting from `CARGO_BUILD_DEP_INFO_BASEDIR`, relative to
|
|
7
|
+
* the folder it starts in, or else from the first configuration file that
|
|
8
|
+
* sets it to a string, in the order of {@link buildSettingsAndUnreadable}:
|
|
9
|
+
* that of `folder` and of each folder above it, then that of the Cargo
|
|
10
|
+
* home, reading `.cargo/config` where it exists and `.cargo/config.toml`
|
|
11
|
+
* otherwise. A file's own value comes before those of the files it
|
|
12
|
+
* includes, and a later include before an earlier one. A path in a file is
|
|
13
|
+
* relative to the folder above the one that holds the file. A file that
|
|
14
|
+
* exists but cannot be read, met before the deciding one, leaves the folder
|
|
15
|
+
* unknown. The plugin's `build` passes cargo no `--config`, so nothing else
|
|
16
|
+
* sets it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function configuredDepInfoBasedir(folder: string, env: Readonly<Record<string, string | undefined>>): string | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configuredDepInfoBasedir = configuredDepInfoBasedir;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const build_settings_1 = require("./build-settings");
|
|
6
|
+
/**
|
|
7
|
+
* The folder that `build.dep-info-basedir` gives a cargo command started in
|
|
8
|
+
* `folder` with the environment `env`, as an absolute path; `undefined`
|
|
9
|
+
* where nothing sets it or a file that would decide cannot be read.
|
|
10
|
+
*
|
|
11
|
+
* Cargo takes the setting from `CARGO_BUILD_DEP_INFO_BASEDIR`, relative to
|
|
12
|
+
* the folder it starts in, or else from the first configuration file that
|
|
13
|
+
* sets it to a string, in the order of {@link buildSettingsAndUnreadable}:
|
|
14
|
+
* that of `folder` and of each folder above it, then that of the Cargo
|
|
15
|
+
* home, reading `.cargo/config` where it exists and `.cargo/config.toml`
|
|
16
|
+
* otherwise. A file's own value comes before those of the files it
|
|
17
|
+
* includes, and a later include before an earlier one. A path in a file is
|
|
18
|
+
* relative to the folder above the one that holds the file. A file that
|
|
19
|
+
* exists but cannot be read, met before the deciding one, leaves the folder
|
|
20
|
+
* unknown. The plugin's `build` passes cargo no `--config`, so nothing else
|
|
21
|
+
* sets it.
|
|
22
|
+
*/
|
|
23
|
+
function configuredDepInfoBasedir(folder, env) {
|
|
24
|
+
const fromEnvironment = env.CARGO_BUILD_DEP_INFO_BASEDIR;
|
|
25
|
+
if (fromEnvironment !== undefined && fromEnvironment !== "") {
|
|
26
|
+
return (0, node_path_1.resolve)(folder, fromEnvironment);
|
|
27
|
+
}
|
|
28
|
+
for (const entry of (0, build_settings_1.buildSettingsAndUnreadable)(folder, env, "dep-info-basedir")) {
|
|
29
|
+
if ("unreadable" in entry) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
if (typeof entry.value === "string") {
|
|
33
|
+
return (0, node_path_1.resolve)((0, node_path_1.dirname)((0, node_path_1.dirname)(entry.file)), entry.value);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=dep-info-basedir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dep-info-basedir.js","sourceRoot":"","sources":["../../../../nx-rust/src/cargo/dep-info-basedir.ts"],"names":[],"mappings":";;AAoBA,4DAiBC;AArCD,yCAA6C;AAC7C,qDAA8D;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,wBAAwB,CACtC,MAAc,EACd,GAAiD;IAEjD,MAAM,eAAe,GAAG,GAAG,CAAC,4BAA4B,CAAC;IACzD,IAAI,eAAe,KAAK,SAAS,IAAI,eAAe,KAAK,EAAE,EAAE,CAAC;QAC5D,OAAO,IAAA,mBAAO,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1C,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,IAAA,2CAA0B,EAAC,MAAM,EAAE,GAAG,EAAE,kBAAkB,CAAC,EAAE,CAAC;QAChF,IAAI,YAAY,IAAI,KAAK,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACpC,OAAO,IAAA,mBAAO,EAAC,IAAA,mBAAO,EAAC,IAAA,mBAAO,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Cargo's two directories for commands in one workspace root, as cargo reports them. */
|
|
2
|
+
export interface CargoDirectories {
|
|
3
|
+
/** The artifact directory (`target_directory`). */
|
|
4
|
+
artifact: string;
|
|
5
|
+
/** The build directory (`build_directory`), the artifact directory where cargo reports none. */
|
|
6
|
+
build: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The environment variables that move Cargo's artifact directory without a
|
|
10
|
+
* change to a file inside the repository: the directory itself, and the
|
|
11
|
+
* Cargo home, whose `config.toml` can set `build.target-dir`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const directoryVariableNames: readonly ["CARGO_TARGET_DIR", "CARGO_BUILD_TARGET_DIR", "CARGO_HOME"];
|
|
14
|
+
/** The {@link directoryVariableNames} that `env` sets, with their values. */
|
|
15
|
+
export declare function directoryVariables(env: NodeJS.ProcessEnv): Record<string, string>;
|
|
16
|
+
/** Cargo could not report its directories. */
|
|
17
|
+
export declare class DirectoryReportError extends Error {
|
|
18
|
+
/** What cargo wrote to standard error. */
|
|
19
|
+
readonly stderr: string;
|
|
20
|
+
constructor(message: string,
|
|
21
|
+
/** What cargo wrote to standard error. */
|
|
22
|
+
stderr: string);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The directories that cargo uses for a command started in `workspaceRoot`
|
|
26
|
+
* with `env`, from its `cargo metadata --no-deps` report, as graph creation
|
|
27
|
+
* reads them from its own report (`DES-METADATA-REPORT`). Cargo resolves
|
|
28
|
+
* every source of them itself: `CARGO_TARGET_DIR`, `CARGO_BUILD_TARGET_DIR`,
|
|
29
|
+
* `CARGO_BUILD_BUILD_DIR`, the configuration files of the folder, of the
|
|
30
|
+
* folders above it and of the Cargo home that `CARGO_HOME` names, the files
|
|
31
|
+
* they include as the cargo version reads them, and the templates of
|
|
32
|
+
* `build.build-dir` (`EVD-CARGO-DIRECTORIES`). With `--no-deps` cargo needs
|
|
33
|
+
* no network and leaves `Cargo.lock` alone.
|
|
34
|
+
*
|
|
35
|
+
* @param env The whole environment of the call, also where rustup may
|
|
36
|
+
* install a toolchain for it.
|
|
37
|
+
* @throws {DirectoryReportError} When cargo cannot be started, fails or
|
|
38
|
+
* prints no report.
|
|
39
|
+
*/
|
|
40
|
+
export declare function reportedDirectories(workspaceRoot: string, env: NodeJS.ProcessEnv): CargoDirectories;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DirectoryReportError = exports.directoryVariableNames = void 0;
|
|
4
|
+
exports.directoryVariables = directoryVariables;
|
|
5
|
+
exports.reportedDirectories = reportedDirectories;
|
|
6
|
+
const node_child_process_1 = require("node:child_process");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const metadata_1 = require("./metadata");
|
|
9
|
+
/**
|
|
10
|
+
* The environment variables that move Cargo's artifact directory without a
|
|
11
|
+
* change to a file inside the repository: the directory itself, and the
|
|
12
|
+
* Cargo home, whose `config.toml` can set `build.target-dir`.
|
|
13
|
+
*/
|
|
14
|
+
exports.directoryVariableNames = [
|
|
15
|
+
"CARGO_TARGET_DIR",
|
|
16
|
+
"CARGO_BUILD_TARGET_DIR",
|
|
17
|
+
"CARGO_HOME",
|
|
18
|
+
];
|
|
19
|
+
/** The {@link directoryVariableNames} that `env` sets, with their values. */
|
|
20
|
+
function directoryVariables(env) {
|
|
21
|
+
const set = {};
|
|
22
|
+
for (const name of exports.directoryVariableNames) {
|
|
23
|
+
const value = env[name];
|
|
24
|
+
if (value !== undefined) {
|
|
25
|
+
set[name] = value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return set;
|
|
29
|
+
}
|
|
30
|
+
/** Cargo could not report its directories. */
|
|
31
|
+
class DirectoryReportError extends Error {
|
|
32
|
+
constructor(message,
|
|
33
|
+
/** What cargo wrote to standard error. */
|
|
34
|
+
stderr) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.stderr = stderr;
|
|
37
|
+
this.name = "DirectoryReportError";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.DirectoryReportError = DirectoryReportError;
|
|
41
|
+
/**
|
|
42
|
+
* The directories that cargo uses for a command started in `workspaceRoot`
|
|
43
|
+
* with `env`, from its `cargo metadata --no-deps` report, as graph creation
|
|
44
|
+
* reads them from its own report (`DES-METADATA-REPORT`). Cargo resolves
|
|
45
|
+
* every source of them itself: `CARGO_TARGET_DIR`, `CARGO_BUILD_TARGET_DIR`,
|
|
46
|
+
* `CARGO_BUILD_BUILD_DIR`, the configuration files of the folder, of the
|
|
47
|
+
* folders above it and of the Cargo home that `CARGO_HOME` names, the files
|
|
48
|
+
* they include as the cargo version reads them, and the templates of
|
|
49
|
+
* `build.build-dir` (`EVD-CARGO-DIRECTORIES`). With `--no-deps` cargo needs
|
|
50
|
+
* no network and leaves `Cargo.lock` alone.
|
|
51
|
+
*
|
|
52
|
+
* @param env The whole environment of the call, also where rustup may
|
|
53
|
+
* install a toolchain for it.
|
|
54
|
+
* @throws {DirectoryReportError} When cargo cannot be started, fails or
|
|
55
|
+
* prints no report.
|
|
56
|
+
*/
|
|
57
|
+
// @mara implements DES-OUTPUTS
|
|
58
|
+
function reportedDirectories(workspaceRoot, env) {
|
|
59
|
+
const run = (0, node_child_process_1.spawnSync)("cargo", (0, metadata_1.metadataArguments)((0, node_path_1.join)(workspaceRoot, "Cargo.toml")), {
|
|
60
|
+
cwd: workspaceRoot,
|
|
61
|
+
env,
|
|
62
|
+
encoding: "utf8",
|
|
63
|
+
// The report lists every member with its targets and dependencies.
|
|
64
|
+
maxBuffer: 1024 * 1024 * 1024,
|
|
65
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
66
|
+
});
|
|
67
|
+
if (run.error !== undefined) {
|
|
68
|
+
const code = run.error.code;
|
|
69
|
+
throw new DirectoryReportError(code === "ENOENT" ? `cargo was not found on PATH (${run.error.message})` : run.error.message, "");
|
|
70
|
+
}
|
|
71
|
+
if (run.status !== 0) {
|
|
72
|
+
throw new DirectoryReportError(run.signal ? `cargo was stopped by ${run.signal}` : `cargo exited with status ${run.status}`, run.stderr);
|
|
73
|
+
}
|
|
74
|
+
let report;
|
|
75
|
+
try {
|
|
76
|
+
report = JSON.parse(run.stdout);
|
|
77
|
+
}
|
|
78
|
+
catch (_a) {
|
|
79
|
+
report = {};
|
|
80
|
+
}
|
|
81
|
+
if (typeof (report === null || report === void 0 ? void 0 : report.target_directory) !== "string") {
|
|
82
|
+
throw new DirectoryReportError("cargo printed no report with a target_directory", run.stderr);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
artifact: report.target_directory,
|
|
86
|
+
build: typeof report.build_directory === "string" ? report.build_directory : report.target_directory,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=directories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directories.js","sourceRoot":"","sources":["../../../../nx-rust/src/cargo/directories.ts"],"names":[],"mappings":";;;AAwBA,gDASC;AA+BD,kDAuCC;AAvGD,2DAA+C;AAC/C,yCAAiC;AACjC,yCAAmE;AAUnE;;;;GAIG;AACU,QAAA,sBAAsB,GAAG;IACpC,kBAAkB;IAClB,wBAAwB;IACxB,YAAY;CACJ,CAAC;AAEX,6EAA6E;AAC7E,SAAgB,kBAAkB,CAAC,GAAsB;IACvD,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,IAAI,IAAI,8BAAsB,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,8CAA8C;AAC9C,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YACE,OAAe;IACf,0CAA0C;IACjC,MAAc;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,WAAM,GAAN,MAAM,CAAQ;QAGvB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AATD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AN,MAAM,CAAE,gBAAgB,CAAA,KAAK,QAAQ,EAAE,CAAC;QACjD,MAAM,IAAI,oBAAoB,CAAC,iDAAiD,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAChG,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,gBAAgB;QACjC,KAAK,EACH,OAAO,MAAM,CAAC,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB;KAChG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The host's triple, as `rustc -vV` names it after `host:` in `cwd`, the
|
|
3
|
+
* folder where a task's cargo starts, with the task's environment, so that
|
|
4
|
+
* the toolchain that the folder selects answers; `undefined` where rustc
|
|
5
|
+
* fails or names none. rustup installs no toolchain for it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function hostTriple(cwd: string, env: NodeJS.ProcessEnv): string | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hostTriple = hostTriple;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
/**
|
|
6
|
+
* The host's triple, as `rustc -vV` names it after `host:` in `cwd`, the
|
|
7
|
+
* folder where a task's cargo starts, with the task's environment, so that
|
|
8
|
+
* the toolchain that the folder selects answers; `undefined` where rustc
|
|
9
|
+
* fails or names none. rustup installs no toolchain for it.
|
|
10
|
+
*/
|
|
11
|
+
function hostTriple(cwd, env) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const run = (0, node_child_process_1.spawnSync)("rustc", ["-vV"], {
|
|
14
|
+
cwd,
|
|
15
|
+
env: Object.assign(Object.assign({}, env), { RUSTUP_AUTO_INSTALL: "0" }),
|
|
16
|
+
encoding: "utf8",
|
|
17
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
18
|
+
});
|
|
19
|
+
return run.status === 0 ? (_b = /^host: (\S+)$/m.exec((_a = run.stdout) !== null && _a !== void 0 ? _a : "")) === null || _b === void 0 ? void 0 : _b[1] : undefined;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=host-triple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-triple.js","sourceRoot":"","sources":["../../../../nx-rust/src/cargo/host-triple.ts"],"names":[],"mappings":";;AAQA,gCAQC;AAhBD,2DAA+C;AAE/C;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,GAAW,EAAE,GAAsB;;IAC5D,MAAM,GAAG,GAAG,IAAA,8BAAS,EAAC,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE;QACtC,GAAG;QACH,GAAG,kCAAO,GAAG,KAAE,mBAAmB,EAAE,GAAG,GAAE;QACzC,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;KACpC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAA,gBAAgB,CAAC,IAAI,CAAC,MAAA,GAAG,CAAC,MAAM,mCAAI,EAAE,CAAC,0CAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACrF,CAAC"}
|