@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,459 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hakariConfigurationFiles = exports.workspaceBuildStrategy = void 0;
|
|
4
|
+
exports.hakariConfigurationFile = hakariConfigurationFile;
|
|
5
|
+
exports.hackCrateName = hackCrateName;
|
|
6
|
+
exports.memberNames = memberNames;
|
|
7
|
+
exports.workspaceStrategy = workspaceStrategy;
|
|
8
|
+
exports.workspaceStrategies = workspaceStrategies;
|
|
9
|
+
exports.memberCheck = memberCheck;
|
|
10
|
+
exports.outsideCheck = outsideCheck;
|
|
11
|
+
exports.configurationCheck = configurationCheck;
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
13
|
+
const node_path_1 = require("node:path");
|
|
14
|
+
const smol_toml_1 = require("smol-toml");
|
|
15
|
+
const host_triple_1 = require("../cargo/host-triple");
|
|
16
|
+
const discovery_1 = require("./discovery");
|
|
17
|
+
const real_path_1 = require("./real-path");
|
|
18
|
+
/** The strategy of a workspace that uses `workspace-build` without being checked. */
|
|
19
|
+
exports.workspaceBuildStrategy = {
|
|
20
|
+
featureUnification: "workspace-build",
|
|
21
|
+
warnings: [],
|
|
22
|
+
};
|
|
23
|
+
/** The configuration files that cargo-hakari reads, in its order (`EVD-HAKARI-UNIFICATION`). */
|
|
24
|
+
exports.hakariConfigurationFiles = [".config/hakari.toml", ".guppy/hakari.toml"];
|
|
25
|
+
/**
|
|
26
|
+
* The configuration file that cargo-hakari reads in the workspace root
|
|
27
|
+
* `root`, relative to it: `.config/hakari.toml`, or else
|
|
28
|
+
* `.guppy/hakari.toml`; `undefined` where neither exists.
|
|
29
|
+
*/
|
|
30
|
+
function hakariConfigurationFile(root) {
|
|
31
|
+
return exports.hakariConfigurationFiles.find((file) => (0, node_fs_1.existsSync)((0, node_path_1.join)(root, file)));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The package name of the hack crate of the Cargo workspace in `root`,
|
|
35
|
+
* whatever its strategy (`DES-RELEASE`, "Hack crate"): the `hakari-package`
|
|
36
|
+
* of the configuration file that cargo-hakari reads there, where that file
|
|
37
|
+
* parses and the name is one of `members`, the package names of the
|
|
38
|
+
* workspace's members; `undefined` otherwise. A configuration that does not
|
|
39
|
+
* parse names no hack crate here; graph creation warns about it where the
|
|
40
|
+
* strategy is `hakari` by default or by setting ({@link workspaceStrategy}).
|
|
41
|
+
*/
|
|
42
|
+
// @mara implements DES-RELEASE
|
|
43
|
+
// @mara implements DES-UNIFICATION
|
|
44
|
+
function hackCrateName(root, members) {
|
|
45
|
+
const found = hakariConfigurationFile(root);
|
|
46
|
+
if (found === undefined) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
let name;
|
|
50
|
+
try {
|
|
51
|
+
name = (0, smol_toml_1.parse)((0, node_fs_1.readFileSync)((0, node_path_1.join)(root, found), "utf8"))["hakari-package"];
|
|
52
|
+
}
|
|
53
|
+
catch (_a) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
return typeof name === "string" && members.includes(name) ? name : undefined;
|
|
57
|
+
}
|
|
58
|
+
/** The package names of the members of `workspace`. */
|
|
59
|
+
function memberNames(workspace) {
|
|
60
|
+
return workspaceMembers(workspace).map((member) => member.name);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The feature-unification strategy of a workspace (`DES-UNIFICATION`, "When
|
|
64
|
+
* the hack crate is enough", "Fallback"): `cargo` and `workspace-build` where
|
|
65
|
+
* the settings choose them, unchecked; otherwise `hakari` where the
|
|
66
|
+
* workspace has a configuration that cargo-hakari reads, which parses and
|
|
67
|
+
* whose `hakari-package` names a member, and passes the four checks, made
|
|
68
|
+
* in their order:
|
|
69
|
+
*
|
|
70
|
+
* 1. no member asks a feature of another member, in any form, and no
|
|
71
|
+
* member's dev-dependency on itself has features;
|
|
72
|
+
* 2. `platforms` lists the host's triple, as `rustc -vV` names it in the
|
|
73
|
+
* workspace root;
|
|
74
|
+
* 3. no crate outside the workspace reaches a member through normal or build
|
|
75
|
+
* dependencies, as far as the reports show, with a redirection to a
|
|
76
|
+
* member and a crate without a report counting as failing;
|
|
77
|
+
* 4. every key of the configuration is one that leaves nothing to the
|
|
78
|
+
* selection, with a value that experiments found safe.
|
|
79
|
+
*
|
|
80
|
+
* Where one fails, or where the settings ask for `hakari` and the workspace
|
|
81
|
+
* has no such configuration, the workspace uses `workspace-build` and gets
|
|
82
|
+
* the fallback warning, which names the workspace, the check and the first
|
|
83
|
+
* member, crate, entry or setting that fails it. A workspace without a
|
|
84
|
+
* configuration whose settings choose nothing uses `workspace-build`
|
|
85
|
+
* without a warning. Under `hakari`, a non-host triple that graph creation
|
|
86
|
+
* knows and `platforms` does not list gets a warning of its own; its tasks
|
|
87
|
+
* run one crate per command (`groupSelection` in `groups.ts`).
|
|
88
|
+
*
|
|
89
|
+
* @param setting The `featureUnification` that the workspace table or the
|
|
90
|
+
* plugin options set; `undefined` for the default.
|
|
91
|
+
*/
|
|
92
|
+
// @mara implements DES-UNIFICATION
|
|
93
|
+
// @mara implements DES-DIAGNOSTICS
|
|
94
|
+
function workspaceStrategy(workspace, setting, context) {
|
|
95
|
+
var _a, _b, _c, _d;
|
|
96
|
+
if (setting === "cargo" || setting === "workspace-build") {
|
|
97
|
+
return { featureUnification: setting, warnings: [] };
|
|
98
|
+
}
|
|
99
|
+
const root = workspace.report.workspace_root;
|
|
100
|
+
const found = hakariConfigurationFile(root);
|
|
101
|
+
const describe = (0, discovery_1.describeWorkspaces)([workspace.root]);
|
|
102
|
+
if (found === undefined) {
|
|
103
|
+
return setting === "hakari"
|
|
104
|
+
? fallback(workspace, "it has no configuration of cargo-hakari", `featureUnification is "hakari", but neither .config/hakari.toml nor .guppy/hakari.toml exists in its root. Create one with \`cargo hakari init\`, fill in platforms and run \`cargo hakari generate\` and \`cargo hakari manage-deps\``)
|
|
105
|
+
: exports.workspaceBuildStrategy;
|
|
106
|
+
}
|
|
107
|
+
const repositoryRoot = context.discovery.workspaceRoot;
|
|
108
|
+
const configFile = posixPath((0, node_path_1.relative)(repositoryRoot, (0, node_path_1.join)(root, found)));
|
|
109
|
+
let config;
|
|
110
|
+
try {
|
|
111
|
+
config = (0, smol_toml_1.parse)((0, node_fs_1.readFileSync)((0, node_path_1.join)(root, found), "utf8"));
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
return fallback(workspace, "its configuration of cargo-hakari cannot be read", `${configFile} is no valid TOML (${error instanceof Error ? error.message.split("\n")[0] : String(error)}). Correct it`);
|
|
115
|
+
}
|
|
116
|
+
const members = workspaceMembers(workspace);
|
|
117
|
+
const hackName = config["hakari-package"];
|
|
118
|
+
const hack = typeof hackName === "string" ? members.find((member) => member.name === hackName) : undefined;
|
|
119
|
+
if (hack === undefined) {
|
|
120
|
+
return fallback(workspace, "its configuration of cargo-hakari names no member as the hack crate", typeof hackName === "string"
|
|
121
|
+
? `hakari-package in ${configFile} is "${hackName}", which is no member of ${describe}. Name the hack crate there, or run \`cargo hakari init\``
|
|
122
|
+
: `${configFile} has no hakari-package. Name the hack crate there, as \`cargo hakari init\` writes it`);
|
|
123
|
+
}
|
|
124
|
+
const members1 = memberCheck(members, repositoryRoot);
|
|
125
|
+
if (members1 !== undefined) {
|
|
126
|
+
return fallback(workspace, "a member asks a feature of another member", members1);
|
|
127
|
+
}
|
|
128
|
+
const platforms = (_a = config.platforms) !== null && _a !== void 0 ? _a : [];
|
|
129
|
+
if (!Array.isArray(platforms) || !platforms.every((entry) => typeof entry === "string")) {
|
|
130
|
+
return fallback(workspace, "platforms in its configuration of cargo-hakari is no list of triples", `platforms in ${configFile} is ${JSON.stringify(platforms)}. Write it as a list of target triples that holds the host's, such as platforms = ["x86_64-unknown-linux-gnu"], and run \`cargo hakari generate\``);
|
|
131
|
+
}
|
|
132
|
+
const host = ((_b = context.host) !== null && _b !== void 0 ? _b : ((folder) => { var _a; return (0, host_triple_1.hostTriple)(folder, (_a = context.env) !== null && _a !== void 0 ? _a : process.env); }))(root);
|
|
133
|
+
if (host === undefined) {
|
|
134
|
+
return fallback(workspace, "the host's triple is unknown", `\`rustc -vV\` in the workspace root names no host triple, so @convesoft/nx-rust cannot tell whether platforms in ${configFile} lists it. Make sure that rustc runs there`);
|
|
135
|
+
}
|
|
136
|
+
if (!platforms.includes(host)) {
|
|
137
|
+
return fallback(workspace, "platforms does not list the host's triple", `platforms in ${configFile} ${platforms.length === 0 ? "is empty" : `lists ${platforms.join(", ")}`} and not the host's triple ${host}, so the hack crate does not unify the features of the dependencies that cargo compiles for the host. Add "${host}" to platforms and run \`cargo hakari generate\``);
|
|
138
|
+
}
|
|
139
|
+
const outside = outsideCheck(workspace, context.discovery);
|
|
140
|
+
if (outside !== undefined) {
|
|
141
|
+
return fallback(workspace, "a crate outside the workspace may reach a member", `${outside}, and cargo-hakari leaves such a crate out of the hack crate, so what it asks of the member and of third-party crates would follow the crates that a command selects`);
|
|
142
|
+
}
|
|
143
|
+
const setting4 = configurationCheck(config, configFile);
|
|
144
|
+
if (setting4 !== undefined) {
|
|
145
|
+
return fallback(workspace, "its configuration of cargo-hakari has a setting that @convesoft/nx-rust does not accept", setting4);
|
|
146
|
+
}
|
|
147
|
+
const known = [
|
|
148
|
+
...(((_c = workspace.triples) === null || _c === void 0 ? void 0 : _c.kind) === "triples" ? workspace.triples.triples : []),
|
|
149
|
+
...((_d = context.tableTriples) !== null && _d !== void 0 ? _d : []),
|
|
150
|
+
];
|
|
151
|
+
const unlisted = [...new Set(known)].filter((triple) => triple !== host && !platforms.includes(triple));
|
|
152
|
+
return {
|
|
153
|
+
featureUnification: "hakari",
|
|
154
|
+
hakari: {
|
|
155
|
+
configFile,
|
|
156
|
+
hackManifest: posixPath((0, node_path_1.relative)(repositoryRoot, hack.manifest_path)),
|
|
157
|
+
hackPackage: hack.name,
|
|
158
|
+
platforms: [...platforms],
|
|
159
|
+
},
|
|
160
|
+
warnings: unlisted.map((triple) => unlistedTripleWarning(workspace, triple, configFile)),
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The strategy of each workspace of a graph computation, by the workspace's
|
|
165
|
+
* root folder ({@link workspaceStrategy}), with the `featureUnification`
|
|
166
|
+
* that its settings give and the triples that the metadata tables of its
|
|
167
|
+
* members and workspace project give a target or a configuration.
|
|
168
|
+
*/
|
|
169
|
+
// @mara implements DES-UNIFICATION
|
|
170
|
+
function workspaceStrategies(discovery, settings, context = {}) {
|
|
171
|
+
const strategies = new Map();
|
|
172
|
+
for (const workspace of discovery.workspaces) {
|
|
173
|
+
const projects = [
|
|
174
|
+
...workspace.members.map((pkg) => settings.crate(pkg)),
|
|
175
|
+
...(workspace.rootManifestHanded &&
|
|
176
|
+
!workspace.report.packages.some((pkg) => pkg.manifest_path === (0, node_path_1.join)(workspace.report.workspace_root, "Cargo.toml"))
|
|
177
|
+
? [settings.workspaceProject(workspace)]
|
|
178
|
+
: []),
|
|
179
|
+
];
|
|
180
|
+
strategies.set(workspace.root, workspaceStrategy(workspace, settings.workspace(workspace).featureUnification, Object.assign(Object.assign({}, context), { discovery, tableTriples: tableTriples(projects) })));
|
|
181
|
+
}
|
|
182
|
+
return strategies;
|
|
183
|
+
}
|
|
184
|
+
// The triples that target tables give in their options or configurations.
|
|
185
|
+
function tableTriples(projects) {
|
|
186
|
+
var _a;
|
|
187
|
+
const triples = new Set();
|
|
188
|
+
const add = (options) => {
|
|
189
|
+
const triple = options === null || options === void 0 ? void 0 : options.targetTriple;
|
|
190
|
+
if (typeof triple === "string" &&
|
|
191
|
+
triple !== "" &&
|
|
192
|
+
triple !== "host-tuple" &&
|
|
193
|
+
!triple.endsWith(".json")) {
|
|
194
|
+
triples.add(triple);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
for (const project of projects) {
|
|
198
|
+
for (const table of project.targets) {
|
|
199
|
+
add(table.target.options);
|
|
200
|
+
for (const configuration of Object.values((_a = table.target.configurations) !== null && _a !== void 0 ? _a : {})) {
|
|
201
|
+
add(configuration);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return [...triples].sort();
|
|
206
|
+
}
|
|
207
|
+
// The fallback of `DES-UNIFICATION`: the workspace uses `workspace-build`,
|
|
208
|
+
// with the warning that names the check, what fails it and what would
|
|
209
|
+
// change the outcome.
|
|
210
|
+
function fallback(workspace, check, detail) {
|
|
211
|
+
return {
|
|
212
|
+
featureUnification: "workspace-build",
|
|
213
|
+
warnings: [
|
|
214
|
+
[
|
|
215
|
+
`nx-rust: ${(0, discovery_1.describeWorkspaces)([workspace.root])} uses the feature strategy workspace-build in place of hakari, because ${check}: ${detail}.`,
|
|
216
|
+
`Until then its groups build the whole workspace, and a change to Cargo.lock runs every crate of it again.`,
|
|
217
|
+
`If that is how the workspace is meant to build, set featureUnification = "workspace-build" in [workspace.metadata.nx] of ${workspace.rootManifest}, which ends this warning.`,
|
|
218
|
+
].join(" "),
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
// The warning for a non-host triple that `platforms` does not list.
|
|
223
|
+
function unlistedTripleWarning(workspace, triple, configFile) {
|
|
224
|
+
return `nx-rust: ${(0, discovery_1.describeWorkspaces)([workspace.root])} builds for the triple ${triple}, which platforms in ${configFile} does not list, so the hack crate does not unify the features that cargo compiles for it: the tasks for ${triple} run one crate per cargo command. Add "${triple}" to platforms and run \`cargo hakari generate\` to let them share commands.`;
|
|
225
|
+
}
|
|
226
|
+
// Every member of the workspace, also those without a project, by the path
|
|
227
|
+
// of their manifests.
|
|
228
|
+
function workspaceMembers(workspace) {
|
|
229
|
+
const ids = new Set(workspace.report.workspace_members);
|
|
230
|
+
return workspace.report.packages
|
|
231
|
+
.filter((pkg) => ids.has(pkg.id))
|
|
232
|
+
.sort((a, b) => a.manifest_path < b.manifest_path ? -1 : a.manifest_path > b.manifest_path ? 1 : 0);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* The first check of `DES-UNIFICATION`: the first member, by the path of
|
|
236
|
+
* its manifest, that asks a feature of another member, with what it asks,
|
|
237
|
+
* or `undefined` where none does. A dependency on another member's folder,
|
|
238
|
+
* of every kind and under every platform table, fails where it has a
|
|
239
|
+
* `features` list, or turns off default features of a member whose
|
|
240
|
+
* `features` table declares `default`; a member's dev-dependency on itself
|
|
241
|
+
* fails where it has a `features` list; and an entry of a member's
|
|
242
|
+
* `features` table fails where it names a feature of another member as
|
|
243
|
+
* `<name>/<feature>` or `<name>?/<feature>`, by the dependency's name or
|
|
244
|
+
* its rename.
|
|
245
|
+
*/
|
|
246
|
+
// @mara implements DES-UNIFICATION
|
|
247
|
+
function memberCheck(members, repositoryRoot) {
|
|
248
|
+
var _a, _b, _c, _d;
|
|
249
|
+
const byFolder = new Map(members.map((member) => [(0, real_path_1.realPath)((0, node_path_1.dirname)(member.manifest_path)), member]));
|
|
250
|
+
for (const member of members) {
|
|
251
|
+
const manifest = posixPath((0, node_path_1.relative)(repositoryRoot, member.manifest_path));
|
|
252
|
+
const own = (0, real_path_1.realPath)((0, node_path_1.dirname)(member.manifest_path));
|
|
253
|
+
const named = new Map();
|
|
254
|
+
for (const dependency of member.dependencies) {
|
|
255
|
+
if (dependency.path === undefined) {
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
const folder = (0, real_path_1.realPath)(dependency.path);
|
|
259
|
+
const target = byFolder.get(folder);
|
|
260
|
+
if (target === undefined) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
const kind = dependency.kind === null ? "dependency" : `${dependency.kind}-dependency`;
|
|
264
|
+
const where = dependency.target ? ` under [target.'${dependency.target}']` : "";
|
|
265
|
+
const features = (_a = dependency.features) !== null && _a !== void 0 ? _a : [];
|
|
266
|
+
if (folder === own) {
|
|
267
|
+
if (features.length > 0) {
|
|
268
|
+
return `${manifest} has a dev-dependency on its own crate ${member.name}${where} with the features ${features.join(", ")}, which cargo then turns on for every crate of a command that links it. Remove the features there`;
|
|
269
|
+
}
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
named.set((_b = dependency.rename) !== null && _b !== void 0 ? _b : dependency.name, target);
|
|
273
|
+
if (features.length > 0) {
|
|
274
|
+
return `${manifest} asks the member ${target.name} for the features ${features.join(", ")} in a ${kind}${where}, so ${target.name} compiles with other features depending on what else a command selects. Turn those features on in ${target.name}'s own default features, or set featureUnification = "workspace-build"`;
|
|
275
|
+
}
|
|
276
|
+
if (dependency.uses_default_features === false && ((_c = target.features) === null || _c === void 0 ? void 0 : _c.default) !== undefined) {
|
|
277
|
+
return `${manifest} turns off the default features of the member ${target.name} in a ${kind}${where}, while ${target.name} declares a default feature, so ${target.name} compiles with the feature default or without it depending on what else a command selects. Remove default-features = false there`;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
for (const [feature, entries] of Object.entries((_d = member.features) !== null && _d !== void 0 ? _d : {})) {
|
|
281
|
+
for (const entry of entries) {
|
|
282
|
+
const match = /^([^/?]+)\??\/(.+)$/.exec(entry);
|
|
283
|
+
if (match === null) {
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
const target = named.get(match[1]);
|
|
287
|
+
if (target !== undefined) {
|
|
288
|
+
return `the feature ${feature} of ${manifest} turns on "${entry}", a feature of the member ${target.name}, so ${target.name} compiles with other features depending on what else a command selects. Turn it on in ${target.name} itself, or set featureUnification = "workspace-build"`;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The third check of `DES-UNIFICATION`: the first crate outside the
|
|
297
|
+
* workspace, by the path of its manifest, that reaches a member through
|
|
298
|
+
* normal or build dependencies, directly or through other such crates, or
|
|
299
|
+
* whose dependencies the plugin cannot know, or the first redirection whose
|
|
300
|
+
* crate is a member; `undefined` where none does. The crates outside the
|
|
301
|
+
* workspace are those whose reports graph creation requests anyway: the
|
|
302
|
+
* path crates that the members reach through dependencies of every kind,
|
|
303
|
+
* and behind those through normal and build dependencies, and the crates
|
|
304
|
+
* that the workspace's `[patch]`, `[replace]` and `paths` entries name, with
|
|
305
|
+
* those behind them.
|
|
306
|
+
*/
|
|
307
|
+
// @mara implements DES-UNIFICATION
|
|
308
|
+
function outsideCheck(workspace, discovery) {
|
|
309
|
+
var _a, _b, _c;
|
|
310
|
+
const repositoryRoot = discovery.workspaceRoot;
|
|
311
|
+
const shown = (folder) => {
|
|
312
|
+
const inside = posixPath((0, node_path_1.relative)((0, real_path_1.realPath)(repositoryRoot), folder));
|
|
313
|
+
return inside.startsWith("..") ? folder : inside === "" ? "." : inside;
|
|
314
|
+
};
|
|
315
|
+
const members = workspaceMembers(workspace);
|
|
316
|
+
const memberFolders = new Map(members.map((member) => [(0, real_path_1.realPath)((0, node_path_1.dirname)(member.manifest_path)), member]));
|
|
317
|
+
const reports = new Map();
|
|
318
|
+
for (const report of [
|
|
319
|
+
...discovery.workspaces.map((entry) => entry.report),
|
|
320
|
+
...discovery.pathDependencyReports.map((entry) => entry.report),
|
|
321
|
+
]) {
|
|
322
|
+
for (const pkg of report.packages) {
|
|
323
|
+
const folder = (0, real_path_1.realPath)((0, node_path_1.dirname)(pkg.manifest_path));
|
|
324
|
+
if (!reports.has(folder)) {
|
|
325
|
+
reports.set(folder, pkg);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
const failures = [];
|
|
330
|
+
const queue = [];
|
|
331
|
+
for (const member of members) {
|
|
332
|
+
for (const dependency of member.dependencies) {
|
|
333
|
+
if (dependency.path !== undefined) {
|
|
334
|
+
const folder = (0, real_path_1.realPath)(dependency.path);
|
|
335
|
+
if (!memberFolders.has(folder)) {
|
|
336
|
+
queue.push(folder);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
for (const redirection of workspace.redirections) {
|
|
342
|
+
const candidates = redirection.table === "paths"
|
|
343
|
+
? ((_b = (_a = workspace.pathsCrates) === null || _a === void 0 ? void 0 : _a.get(redirection.folder)) !== null && _b !== void 0 ? _b : [])
|
|
344
|
+
: [redirection.folder];
|
|
345
|
+
for (const candidate of candidates) {
|
|
346
|
+
const folder = (0, real_path_1.realPath)(candidate);
|
|
347
|
+
const member = memberFolders.get(folder);
|
|
348
|
+
if (member !== undefined) {
|
|
349
|
+
const entry = redirection.table === "paths"
|
|
350
|
+
? `the paths entry for ${shown((0, real_path_1.realPath)(redirection.folder))}`
|
|
351
|
+
: `the [${redirection.table}${redirection.key === undefined ? "" : `.${redirection.key}`}] entry`;
|
|
352
|
+
failures.push({
|
|
353
|
+
key: member.manifest_path,
|
|
354
|
+
message: `${entry} in ${shown(redirection.file)} redirects to the member ${member.name}, so any registry or git crate that depends on ${member.name} depends on the member, which only Cargo.lock shows`,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
queue.push(folder);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const visited = new Set();
|
|
363
|
+
while (queue.length > 0) {
|
|
364
|
+
const folder = queue.shift();
|
|
365
|
+
if (visited.has(folder) || memberFolders.has(folder)) {
|
|
366
|
+
continue;
|
|
367
|
+
}
|
|
368
|
+
visited.add(folder);
|
|
369
|
+
const pkg = reports.get(folder);
|
|
370
|
+
const manifest = (0, node_path_1.join)(folder, "Cargo.toml");
|
|
371
|
+
if (pkg === undefined || (0, node_fs_1.existsSync)((0, node_path_1.join)(folder, ".cargo-checksum.json"))) {
|
|
372
|
+
failures.push({
|
|
373
|
+
key: manifest,
|
|
374
|
+
message: `@convesoft/nx-rust has no report of the crate in ${shown(folder)} outside the workspace${(0, node_fs_1.existsSync)((0, node_path_1.join)(folder, ".cargo-checksum.json"))
|
|
375
|
+
? ", whose folder holds .cargo-checksum.json"
|
|
376
|
+
: discovery.unreportedPathDependencies.has(folder)
|
|
377
|
+
? ", which cargo refused to report"
|
|
378
|
+
: ""}, so it cannot tell whether that crate depends on a member`,
|
|
379
|
+
});
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
for (const dependency of pkg.dependencies) {
|
|
383
|
+
if (dependency.path === undefined || dependency.kind === "dev") {
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
const target = (0, real_path_1.realPath)(dependency.path);
|
|
387
|
+
const member = memberFolders.get(target);
|
|
388
|
+
if (member !== undefined) {
|
|
389
|
+
failures.push({
|
|
390
|
+
key: pkg.manifest_path,
|
|
391
|
+
message: `the crate ${pkg.name} in ${shown(folder)}, outside the workspace, depends on the member ${member.name} through a ${dependency.kind === "build" ? "build" : "normal"} dependency`,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
queue.push(target);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
failures.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
|
|
400
|
+
return (_c = failures[0]) === null || _c === void 0 ? void 0 : _c.message;
|
|
401
|
+
}
|
|
402
|
+
/** The values of each key of cargo-hakari's configuration that the fourth check accepts. */
|
|
403
|
+
const acceptedValues = {
|
|
404
|
+
"hakari-package": (value) => typeof value === "string",
|
|
405
|
+
platforms: (value) => Array.isArray(value),
|
|
406
|
+
resolver: (value) => value === "1" || value === "2" || value === "3",
|
|
407
|
+
"unify-target-host": (value) => value === "auto" ||
|
|
408
|
+
value === "none" ||
|
|
409
|
+
value === "unify-if-both" ||
|
|
410
|
+
value === "replicate-target-on-host",
|
|
411
|
+
"dep-format-version": (value) => value === "1" || value === "2" || value === "3" || value === "4",
|
|
412
|
+
"exact-versions": (value) => typeof value === "boolean",
|
|
413
|
+
"output-single-feature": (value) => typeof value === "boolean",
|
|
414
|
+
"workspace-hack-line-style": (value) => value === "full" || value === "workspace-dotted",
|
|
415
|
+
"traversal-excludes": isEmpty,
|
|
416
|
+
"final-excludes": isEmpty,
|
|
417
|
+
registries: isEmpty,
|
|
418
|
+
};
|
|
419
|
+
/**
|
|
420
|
+
* The fourth check of `DES-UNIFICATION`: the first key of the configuration,
|
|
421
|
+
* in the file's order, that is not one of those that the plugin accepts or
|
|
422
|
+
* has a value that it does not accept, with what to change; `undefined`
|
|
423
|
+
* where every key passes.
|
|
424
|
+
*/
|
|
425
|
+
// @mara implements DES-UNIFICATION
|
|
426
|
+
function configurationCheck(config, configFile) {
|
|
427
|
+
for (const [key, value] of Object.entries(config)) {
|
|
428
|
+
const accepts = acceptedValues[key];
|
|
429
|
+
if (accepts === undefined) {
|
|
430
|
+
return `${configFile} sets ${key} = ${JSON.stringify(value)}, a setting that @convesoft/nx-rust does not know to leave nothing to the crates that a command selects. Remove it, or set featureUnification = "workspace-build"`;
|
|
431
|
+
}
|
|
432
|
+
if (!accepts(value)) {
|
|
433
|
+
const why = key === "traversal-excludes" || key === "final-excludes"
|
|
434
|
+
? ", which leaves crates out of the hack crate's unification"
|
|
435
|
+
: key === "workspace-hack-line-style"
|
|
436
|
+
? ", with which the members' dependency on the hack crate names no path"
|
|
437
|
+
: key === "registries"
|
|
438
|
+
? ", which @convesoft/nx-rust has not tried"
|
|
439
|
+
: ", a value that @convesoft/nx-rust does not know to leave nothing to the crates that a command selects";
|
|
440
|
+
return `${configFile} sets ${key} = ${JSON.stringify(value)}${why}. Remove it or change it, or set featureUnification = "workspace-build"`;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return undefined;
|
|
444
|
+
}
|
|
445
|
+
// Whether a value holds nothing: an empty list, or a table whose values all
|
|
446
|
+
// hold nothing.
|
|
447
|
+
function isEmpty(value) {
|
|
448
|
+
if (Array.isArray(value)) {
|
|
449
|
+
return value.length === 0;
|
|
450
|
+
}
|
|
451
|
+
if (typeof value === "object" && value !== null && !(value instanceof Date)) {
|
|
452
|
+
return Object.values(value).every(isEmpty);
|
|
453
|
+
}
|
|
454
|
+
return false;
|
|
455
|
+
}
|
|
456
|
+
function posixPath(path) {
|
|
457
|
+
return path.split("\\").join("/");
|
|
458
|
+
}
|
|
459
|
+
//# sourceMappingURL=unification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unification.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/unification.ts"],"names":[],"mappings":";;;AAqDA,0DAEC;AAaD,sCAcC;AAGD,kCAEC;AAqDD,8CAyGC;AASD,kDA0BC;AAkFD,kCAmDC;AAeD,oCAmGC;AA4BD,gDAsBC;AAjkBD,qCAAmD;AACnD,yCAAoD;AACpD,yCAAkC;AAClC,sDAAkD;AAGlD,2CAAiD;AACjD,2CAAuC;AAgCvC,qFAAqF;AACxE,QAAA,sBAAsB,GAAsB;IACvD,kBAAkB,EAAE,iBAAiB;IACrC,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,gGAAgG;AACnF,QAAA,wBAAwB,GAAG,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAC;AAEtF;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,IAAY;IAClD,OAAO,gCAAwB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED;;;;;;;;GAQG;AACH,+BAA+B;AAC/B,mCAAmC;AACnC,SAAgB,aAAa,CAAC,IAAY,EAAE,OAA0B;IACpE,MAAM,KAAK,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACH,IAAI,GAAI,IAAA,iBAAK,EAAC,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAA6B,CAChF,gBAAgB,CACjB,CAAC;IACJ,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,SAAS,CAAC;I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AC,CAAC,GAAG,KAAK,YAAY;wBACpB,CAAC,CAAC,0CAA0C;wBAC5C,CAAC,CAAC,uGAAuG,CAAC;YAClH,OAAO,GAAG,UAAU,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,yEAAyE,CAAC;QAC7I,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4EAA4E;AAC5E,gBAAgB;AAChB,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,KAAK,YAAY,IAAI,CAAC,EAAE,CAAC;QAC5E,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CargoWorkspace } from "./discovery";
|
|
2
|
+
/**
|
|
3
|
+
* The warnings for Cargo's build and artifact directories that lie inside
|
|
4
|
+
* the repository and that no `.gitignore` or `.nxignore` file and none of
|
|
5
|
+
* Nx's fixed folders leave out of the files that Nx reads, as Nx itself
|
|
6
|
+
* applies those rules ({@link nxIgnoreRules}): Nx then hashes Cargo's
|
|
7
|
+
* output with the sources, and hands the plugin the manifests that
|
|
8
|
+
* `cargo package` leaves there. A directory that the repository root itself
|
|
9
|
+
* is, or that lies outside the repository, is not one of them.
|
|
10
|
+
*
|
|
11
|
+
* A directory is the folder that cargo writes to, which the system reaches
|
|
12
|
+
* through the path that cargo reports ({@link folderInside}): that folder
|
|
13
|
+
* decides whether it lies inside the repository and whether Nx ignores it,
|
|
14
|
+
* and the warning names it, adding the reported path where symbolic links
|
|
15
|
+
* make the two differ.
|
|
16
|
+
*
|
|
17
|
+
* Each directory gets one warning, which names it, its role and the
|
|
18
|
+
* workspaces whose directory it is, and advises the line to add to the
|
|
19
|
+
* root `.gitignore`. Every workspace whose directory it is gets that
|
|
20
|
+
* warning; none gets one where the installed Nx cannot tell what it
|
|
21
|
+
* ignores.
|
|
22
|
+
*
|
|
23
|
+
* @returns The warnings of each workspace that has any.
|
|
24
|
+
*/
|
|
25
|
+
export declare function unignoredDirectoryWarnings(workspaces: readonly CargoWorkspace[], workspaceRoot: string): Map<CargoWorkspace, string[]>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unignoredDirectoryWarnings = unignoredDirectoryWarnings;
|
|
4
|
+
const discovery_1 = require("./discovery");
|
|
5
|
+
const nx_internals_1 = require("./nx-internals");
|
|
6
|
+
const real_path_1 = require("./real-path");
|
|
7
|
+
/**
|
|
8
|
+
* The warnings for Cargo's build and artifact directories that lie inside
|
|
9
|
+
* the repository and that no `.gitignore` or `.nxignore` file and none of
|
|
10
|
+
* Nx's fixed folders leave out of the files that Nx reads, as Nx itself
|
|
11
|
+
* applies those rules ({@link nxIgnoreRules}): Nx then hashes Cargo's
|
|
12
|
+
* output with the sources, and hands the plugin the manifests that
|
|
13
|
+
* `cargo package` leaves there. A directory that the repository root itself
|
|
14
|
+
* is, or that lies outside the repository, is not one of them.
|
|
15
|
+
*
|
|
16
|
+
* A directory is the folder that cargo writes to, which the system reaches
|
|
17
|
+
* through the path that cargo reports ({@link folderInside}): that folder
|
|
18
|
+
* decides whether it lies inside the repository and whether Nx ignores it,
|
|
19
|
+
* and the warning names it, adding the reported path where symbolic links
|
|
20
|
+
* make the two differ.
|
|
21
|
+
*
|
|
22
|
+
* Each directory gets one warning, which names it, its role and the
|
|
23
|
+
* workspaces whose directory it is, and advises the line to add to the
|
|
24
|
+
* root `.gitignore`. Every workspace whose directory it is gets that
|
|
25
|
+
* warning; none gets one where the installed Nx cannot tell what it
|
|
26
|
+
* ignores.
|
|
27
|
+
*
|
|
28
|
+
* @returns The warnings of each workspace that has any.
|
|
29
|
+
*/
|
|
30
|
+
// @mara implements DES-DIAGNOSTICS
|
|
31
|
+
function unignoredDirectoryWarnings(workspaces, workspaceRoot) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
const directories = new Map();
|
|
34
|
+
for (const workspace of workspaces) {
|
|
35
|
+
const { build_directory: build, target_directory: artifact } = workspace.report;
|
|
36
|
+
const found = [
|
|
37
|
+
["build", build],
|
|
38
|
+
["artifact", artifact],
|
|
39
|
+
];
|
|
40
|
+
for (const [role, path] of found) {
|
|
41
|
+
const folder = typeof path === "string" ? (0, real_path_1.folderInside)(path, workspaceRoot) : undefined;
|
|
42
|
+
if (folder === undefined || folder.path === ".") {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const directory = folder.path;
|
|
46
|
+
const entry = (_a = directories.get(directory)) !== null && _a !== void 0 ? _a : {
|
|
47
|
+
roles: new Set(),
|
|
48
|
+
workspaces: [],
|
|
49
|
+
written: new Set(),
|
|
50
|
+
};
|
|
51
|
+
entry.roles.add(role);
|
|
52
|
+
if (folder.written !== undefined) {
|
|
53
|
+
entry.written.add(folder.written);
|
|
54
|
+
}
|
|
55
|
+
if (!entry.workspaces.includes(workspace)) {
|
|
56
|
+
entry.workspaces.push(workspace);
|
|
57
|
+
}
|
|
58
|
+
directories.set(directory, entry);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const warnings = new Map();
|
|
62
|
+
const ignores = directories.size === 0 ? undefined : (0, nx_internals_1.nxIgnoreRules)(workspaceRoot);
|
|
63
|
+
if (ignores === undefined) {
|
|
64
|
+
return warnings;
|
|
65
|
+
}
|
|
66
|
+
for (const [directory, { roles, workspaces: owners, written }] of directories) {
|
|
67
|
+
if (ignores(directory)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const role = roles.size === 2 ? "build and artifact directory" : `${[...roles][0]} directory`;
|
|
71
|
+
const through = written.size === 0 ? "" : ` (reached through ${list([...written])})`;
|
|
72
|
+
const message = [
|
|
73
|
+
`nx-rust: ${directory}${through}, Cargo's ${role} of ${(0, discovery_1.describeWorkspaces)(owners.map((owner) => owner.root))}, lies inside the repository, and no .gitignore or .nxignore leaves it out of the files that Nx reads.`,
|
|
74
|
+
"Nx then hashes every file that Cargo writes there, counts those inside a project's folder among the project's files, so that a build can change the cache keys of its tasks, and hands nx-rust the Cargo.toml files that `cargo package` leaves there.",
|
|
75
|
+
`Add the line /${directory}/ to the .gitignore at the repository root.`,
|
|
76
|
+
].join("\n");
|
|
77
|
+
for (const owner of owners) {
|
|
78
|
+
warnings.set(owner, [...((_b = warnings.get(owner)) !== null && _b !== void 0 ? _b : []), message]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return warnings;
|
|
82
|
+
}
|
|
83
|
+
// "a", "a and b", "a, b and c"
|
|
84
|
+
function list(items) {
|
|
85
|
+
return items.length <= 1
|
|
86
|
+
? items.join("")
|
|
87
|
+
: `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=unignored-directories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unignored-directories.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/unignored-directories.ts"],"names":[],"mappings":";;AA+BA,gEAwDC;AAvFD,2CAAiE;AACjE,iDAA+C;AAC/C,2CAA2C;AAK3C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,mCAAmC;AACnC,SAAgB,0BAA0B,CACxC,UAAqC,EACrC,aAAqB;;IAErB,MAAM,WAAW,GAAG,IAAI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AAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,+BAA+B;AAC/B,SAAS,IAAI,CAAC,KAAwB;IACpC,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC;QACtB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of `files`, relative to the repository root, are in the files that
|
|
3
|
+
* Nx sees: those that `.gitignore` and `.nxignore` files and Nx's fixed
|
|
4
|
+
* exclusions leave in its workspace context. Nx hashes no other file, and a
|
|
5
|
+
* fileset that names one has no effect (`EVD-NX-24-FILE-INPUTS`).
|
|
6
|
+
*
|
|
7
|
+
* It asks Nx's workspace context, through the daemon where one serves the
|
|
8
|
+
* command, as Nx's own plugins do. Where the installed Nx lacks that part,
|
|
9
|
+
* every file counts as seen.
|
|
10
|
+
*/
|
|
11
|
+
export declare function filesNxSees(workspaceRoot: string, files: readonly string[]): Promise<Set<string>>;
|
|
12
|
+
/**
|
|
13
|
+
* Which of `folders`, relative to the repository root, Nx sees: a folder
|
|
14
|
+
* with a `Cargo.toml` where Nx sees that file, and another folder where Nx
|
|
15
|
+
* sees any file below it ({@link filesNxSees}).
|
|
16
|
+
*/
|
|
17
|
+
export declare function foldersNxSees(workspaceRoot: string, folders: readonly string[]): Promise<Set<string>>;
|