@smoothbricks/nx-plugin 0.4.24 → 0.4.26

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.
Files changed (58) hide show
  1. package/README.md +147 -37
  2. package/dist/bin/smoo-nx-exec.js +3 -14
  3. package/dist/cargo-closure-input.d.ts +13 -15
  4. package/dist/cargo-closure-input.d.ts.map +1 -1
  5. package/dist/cargo-closure-input.js +29 -37
  6. package/dist/cargo-source-hash.d.ts +12 -7
  7. package/dist/cargo-source-hash.d.ts.map +1 -1
  8. package/dist/cargo-source-hash.js +416 -32
  9. package/dist/cargo-workspace.d.ts +7 -7
  10. package/dist/cargo-workspace.js +8 -8
  11. package/dist/ensure-built.d.ts +6 -0
  12. package/dist/ensure-built.d.ts.map +1 -1
  13. package/dist/ensure-built.js +79 -6
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +69 -96
  16. package/dist/managed-assets.d.ts +6 -0
  17. package/dist/managed-assets.d.ts.map +1 -1
  18. package/dist/managed-files/files.d.ts.map +1 -1
  19. package/dist/managed-files/files.js +6 -0
  20. package/dist/manifest-hash.d.ts.map +1 -1
  21. package/dist/manifest-hash.js +6 -2
  22. package/dist/workspace-manifest.d.ts +0 -1
  23. package/dist/workspace-manifest.d.ts.map +1 -1
  24. package/managed/raw/envrc +15 -0
  25. package/managed/raw/git-format-staged.yml +1 -0
  26. package/managed/raw/tooling/direnv/developer-links.ts +43 -11
  27. package/managed/raw/tooling/direnv/devenv.smoo.nix +5 -0
  28. package/managed/raw/tooling/direnv/inherited-devenv.ts +665 -0
  29. package/managed/raw/tooling/direnv/setup-environment.ts +123 -7
  30. package/nextest.toml +3 -37
  31. package/package.json +40 -3
  32. package/src/__tests__/counted-cargo-process.ts +286 -0
  33. package/src/__tests__/counted-cargo.ts +711 -0
  34. package/src/__tests__/fixture-cargo-home.ts +36 -0
  35. package/src/__tests__/fixture-nx-env.ts +93 -3
  36. package/src/bin/smoo-nx-exec.ts +3 -14
  37. package/src/bounded-test-policy.test.ts +0 -1
  38. package/src/cargo-closure-input.test.ts +313 -15
  39. package/src/cargo-closure-input.ts +42 -50
  40. package/src/cargo-resolve-cache.test.ts +975 -0
  41. package/src/cargo-source-hash.test.ts +17 -3
  42. package/src/cargo-source-hash.ts +447 -37
  43. package/src/cargo-workspace.ts +8 -8
  44. package/src/ensure-built.test.ts +122 -20
  45. package/src/ensure-built.ts +82 -5
  46. package/src/index.test.ts +203 -107
  47. package/src/index.ts +86 -115
  48. package/src/managed-assets.ts +12 -0
  49. package/src/managed-files/files.ts +6 -0
  50. package/src/manifest-hash.ts +7 -2
  51. package/src/nextest-partitions.test.ts +150 -0
  52. package/src/nx-cache-bound.test.ts +114 -0
  53. package/src/nx-resident-graph-workers.test.ts +121 -0
  54. package/src/nx-store-resolution.test.ts +98 -0
  55. package/src/task-history-namespace.test.ts +183 -0
  56. package/src/workspace-manifest.ts +0 -1
  57. package/test-timings.json +35 -0
  58. package/src/__tests__/in-process-nx-index.ts +0 -9
package/README.md CHANGED
@@ -38,6 +38,18 @@ Keep `targetDefaults.lint` limited to shared cache policy. Smoo's workspace poli
38
38
  commands, dependencies, inputs and outputs because they override source-aware inference for every project. Project-local
39
39
  `nx.targets.lint` declarations retain normal Nx override precedence.
40
40
 
41
+ The plugin's own `nx run nx-plugin:test` aggregates four bounded Bun targets. Each uses Bun's native
42
+ `--timings=test-timings.json --shard=N/4` partition to balance measured per-file work, while normal discovery still runs
43
+ every test file (including newly added files) exactly once. A failed shard fails the aggregate. The shard count and
44
+ standard 120-second target deadline stay unchanged. Refresh the portable timing manifest from this package directory
45
+ with `bun test --timeout=30000 --timings=test-timings.json --update-timings`; it is scheduling data, not a test
46
+ allowlist.
47
+
48
+ Real Nx fixtures own their cache and workspace-data directories and stop their daemon before removing the fixture.
49
+ Fixtures that intentionally strip caller directory overrides declare `cacheDirectory: ".nx/cache"` in their own
50
+ `nx.json`; this keeps the native task database local too, rather than leaving a new `~/.nx/<repoKey>` behind. Offline,
51
+ path-only Cargo fixtures likewise own a temporary `CARGO_HOME`; production commands still keep the caller's Cargo home.
52
+
41
53
  ## Cargo Workspace Layouts
42
54
 
43
55
  The plugin discovers Cargo workspaces beside Nx project manifests at any depth:
@@ -58,6 +70,12 @@ The plugin discovers Cargo workspaces beside Nx project manifests at any depth:
58
70
  compiled a second time. Cargo's own lock serializes the invocations that share the directory. `cargo-lint-cross` keeps
59
71
  `target/cargo-lint-cross`: a foreign triple's units are distinct anyway, and its own lock keeps the cross check from
60
72
  queueing behind host builds.
73
+ - **Scheduling:** inference never throttles Nx. It sets no `parallelism: false` or `parallel: false`, no cap, and no
74
+ edge whose only purpose is keeping two cargo writers off one `target/`: Cargo owns that lock, and a second process
75
+ waits inside cargo. An edge states a real consumer — fetch before frozen cargo, the archive before the runners,
76
+ `napi-debug` before the tests that load its addon. A producer and its consumer inside one task are one `&&` command
77
+ (`mkdir` then the archive, `cargo build` then `wasm-bindgen`); independent commands (`cargo fmt` and clippy,
78
+ per-manifest `cargo fetch`, Biome and ESLint) stay in a `commands` list that Nx runs side by side.
61
79
  - **Overrides:** normal Nx merging applies. Explicit `nx.targets` fields replace inferred fields, while omitted fields
62
80
  retain their inferred base. Use `"dependsOn": ["...", "extra"]` to preserve inferred prerequisites when adding an
63
81
  edge; replacing the array makes its author responsible for fetching before frozen Cargo commands.
@@ -103,8 +121,35 @@ in that declaration, or in the named input it uses, or a toolchain bump will not
103
121
 
104
122
  Cargo keeps the caller's `CARGO_HOME`. Moving configuration into an isolated home can change relative paths or lose
105
123
  source replacement, credentials, and toolchain settings; forwarding it with `--config` changes precedence. Registry
106
- access may consequently serialize on Cargo's package-cache lock. Clippy's dedicated target directory keeps its check
107
- artifacts out of the test build directory without splitting one directory per crate.
124
+ access may consequently wait on Cargo's package-cache lock, which Cargo arbitrates itself; Nx adds no ordering for it.
125
+
126
+ Graph inference persists locked, offline Cargo resolution in Nx's workspace-data directory. Its content key includes the
127
+ canonical workspace and manifest paths, the complete indexed manifest set, local path-dependency and governing
128
+ manifests, lockfiles, Cargo configuration (including ancestor and `CARGO_HOME` configuration), toolchain pins, the
129
+ resolved Cargo executable, and explicit rustup toolchain selection. Changing only Rust sources, other files, or file
130
+ timestamps reuses the resolved closure without starting Cargo. The configuration identity here is a local
131
+ resolution-cache key, not a machine-specific task input.
132
+
133
+ Concurrent graph computations share one in-flight resolution per workspace. A native Nx file lock serializes workers;
134
+ after acquiring it, a worker checks the persisted result again before starting Cargo. A caller with changed inputs waits
135
+ for the current flight and resolves the new content rather than accepting the old closure. Successful cache writes use
136
+ atomic rename; failed resolutions are never cached. A corrupt cache is reported and resolved again. Inputs that change
137
+ during resolution are retried at most three times, then refused with the cause intact. A WASM-only Nx host cannot
138
+ provide the native lock and receives a typed refusal rather than an unserialized fallback.
139
+
140
+ A plugin worker's normal exit, host disconnect, or handled termination kills Cargo children it still owns; on POSIX it
141
+ kills the whole process group, including wrapper descendants. Standalone callers also forward unhandled termination
142
+ signals to their owned groups. An uncatchable `SIGKILL` cannot run an exit hook; the kernel still releases its file
143
+ lock.
144
+
145
+ The `@smoothbricks/nx-plugin:cargo-resolve` diagnostics channel reports `{ phase: "join", manifest }` when a caller
146
+ joins an existing flight. With no subscribers, inference neither allocates nor publishes an event. The cache regressions
147
+ use this readiness signal and Cargo control-channel events to prove concurrency and child teardown without sleep-based
148
+ timing assumptions; their outer hang guards report still-open test spans and process/gate state.
149
+
150
+ Keep workspace-owned runtime state outside Nx's source index. In a cowshed workspace, the root `.nxignore` must include
151
+ `.cowshed/`: Nx's watcher reads the root ignore files, not Git's `.git/info/exclude`. Watching the daemon's own log,
152
+ plugin sockets or job records turns each graph computation into another file event and another graph computation.
108
153
 
109
154
  ### Cargo source runtime inputs
110
155
 
@@ -122,8 +167,8 @@ For a package-root Cargo workspace, pass its manifest relative to the Nx root:
122
167
  `smoo-nx-cargo-hash packages/example/Cargo.toml`. A shared input covering several Cargo workspaces includes one runtime
123
168
  entry per manifest.
124
169
 
125
- By default, the command queries `cargo metadata --locked --offline` and hashes the resolved external path packages,
126
- including transitive dependencies, Rust sources, target source files, governing Cargo manifests, and Cargo
170
+ By default, the command uses the content-keyed `cargo metadata --locked --offline` resolution and hashes external path
171
+ packages, including transitive dependencies, Rust sources, target source files, governing Cargo manifests, and Cargo
127
172
  configuration. It also covers path packages under `node_modules`, which Nx's normal file map ignores. Packages inside
128
173
  both the Nx and Cargo workspaces are left to the plugin's inferred file inputs. Adding or moving a dependency does not
129
174
  require maintaining a second list of source roots. The command refuses missing dependencies or an unavailable locked
@@ -148,24 +193,30 @@ it in each custom Cargo target's `inputs`, alongside `cargoToolchain`, the targe
148
193
  }
149
194
  ```
150
195
 
151
- Cargo decides the closure. Once per project-graph computation, `cargo metadata --locked --offline` resolves the local
152
- packages under the project's root and every mutable local package they reach through normal, build or dev dependencies;
153
- an edit to a workspace member outside that closure leaves the key alone. The members Nx's file index holds become
154
- filesets: each package's `.rs` files, `Cargo.toml` files and `.cargo/config[.toml]` below its directory (skipping
155
- `target/` and the other directories the hash command skips), target sources outside it, its governing workspace
156
- manifest, the `Cargo.toml` and `.cargo/config[.toml]` of every directory from the package up to the Nx root, and the
157
- workspace's `Cargo.lock`. Nx hashes those from the file hashes it already keeps, so hashing a task over an unchanged
158
- tree starts no process; the graph computation pays one `cargo metadata` instead.
196
+ Cargo decides the closure. Graph inference checks the content-keyed locked offline resolution of the local packages
197
+ under the project's root and every mutable local package they reach through normal, build or dev dependencies; an edit
198
+ to a workspace member outside that closure leaves the task key alone. The members Nx's file index holds become filesets:
199
+ each package's `.rs` files, `Cargo.toml` files and `.cargo/config[.toml]` below its directory (skipping `target/` and
200
+ the other directories the hash command skips), target sources outside it, its governing workspace manifest, the
201
+ `Cargo.toml` and `.cargo/config[.toml]` of every directory from the package up to the Nx root, and the workspace's
202
+ `Cargo.lock`. Nx hashes those from the file hashes it already keeps, so hashing these inputs starts no process. A graph
203
+ with unchanged resolution inputs starts no Cargo process either.
159
204
 
160
205
  Members the file index cannot hold, outside the Nx workspace or under `node_modules`, are hashed by one runtime
161
- `smoo-nx-cargo-hash --closure <projectRoot> <Cargo.toml>` entry, present only while such members exist. It resolves the
162
- closure again when it runs, so a member that only an edit outside the workspace brings in is still covered.
206
+ `smoo-nx-cargo-hash --closure <projectRoot> <Cargo.toml>` entry, present only while such members exist. Its cached
207
+ resolution checks external manifests too, so a dependency introduced by an external manifest edit is still covered.
208
+
209
+ Cargo resolution failures (no `cargo` on PATH, a stale `Cargo.lock`, or an unavailable locked dependency) fail graph
210
+ inference with `CargoMetadataError`, including the manifest path and Cargo's cause. A member inside the workspace
211
+ missing from Nx's file index, or another closure Nx cannot express precisely, fails with `CargoClosureInputError`.
212
+ Neither condition falls back to a whole-workspace runtime hash or silently reuses an older closure.
163
213
 
164
- When the closure cannot be expressed that way, `cargoClosure` is the complete runtime hash,
165
- `smoo-nx-cargo-hash --include-workspace --closure <projectRoot> <Cargo.toml>`, and the plugin says why on stderr: Cargo
166
- could not resolve the workspace during graph computation (no `cargo` on PATH, a stale `Cargo.lock`, an unfetched
167
- dependency), or a member inside the workspace is missing from the file index (an ignored directory). The command reports
168
- the same Cargo failure wherever a task needs it.
214
+ Resolution therefore needs the packages `Cargo.lock` pins already in `CARGO_HOME`, before any task can run: the graph's
215
+ own `cargo-fetch` target cannot supply them. The managed shell entry (`tooling/direnv/setup-environment.ts`) runs
216
+ `cargo fetch --locked` for every project whose `Cargo.toml` declares `[workspace]`, once per change to that workspace's
217
+ `Cargo.toml`, `Cargo.lock` or `.cargo/config[.toml]`, with its stamp in `CARGO_HOME/smoo-fetched`. In CI a failed fetch
218
+ fails the shell; locally it prints Cargo's cause, loads the shell, and retries on the next entry, while graph inference
219
+ keeps refusing with that same cause.
169
220
 
170
221
  In-workspace members follow Nx's file semantics, which differ from the command's own walk in two places: a symlinked
171
222
  directory inside a package is not followed, and manifests and Cargo configuration above the Nx root (a
@@ -286,30 +337,32 @@ Concrete targets come from concrete files:
286
337
  serves every checkout of the same commit; nextest re-points `CARGO_BIN_EXE_<name>`/`NEXTEST_BIN_EXE_<name>` at the
287
338
  extracted binaries at runtime, but a test that reads them through the compile-time `env!` macro keeps the producing
288
339
  tree's path. Per-crate runners accept an empty nextest selection because a valid workspace member may have no tests
289
- and a hash partition may legitimately be empty. `napi-debug` stays behind `cargo-test-compile`, and a crate in the
290
- project that builds the debug cdylib runs after it. A crate declaring `[package.metadata.smoothbricks.wasm-bindgen]`
291
- also receives the cacheable `cargo-wasm` output target in its owning project.
340
+ and a hash partition may legitimately be empty. A crate in the project that builds the debug cdylib runs after
341
+ `napi-debug`, because its tests load that addon from `target/debug`. A crate declaring
342
+ `[package.metadata.smoothbricks.wasm-bindgen]` also receives the cacheable `cargo-wasm` output target in its owning
343
+ project.
292
344
  - The plugin's own `nextest.toml` is passed as `--tool-config-file "smoo:$PWD/<path>"`, so it is a layer BENEATH the
293
345
  repository's `<cargo-workspace>/.config/nextest.toml` rather than a replacement for it: a repository can raise a
294
- timeout, add a test group, or declare `archive.include` for a cdylib or fixture the archived test binaries need, and
295
- its settings win. That file is an input of both the archive and every runner, so changing it invalidates the verdicts
296
- it governs. `$PWD` keeps the command text identical across checkouts while satisfying nextest's requirement that a
297
- tool config path be absolute; `--user-config-file none` still holds, because a developer's `~/.config/nextest` must
298
- not decide a cached verdict.
346
+ timeout or declare `archive.include` for a cdylib or fixture the archived test binaries need, and its settings win.
347
+ That file is an input of both the archive and every runner, so changing it invalidates the verdicts it governs. `$PWD`
348
+ keeps the command text identical across checkouts while satisfying nextest's requirement that a tool config path be
349
+ absolute; `--user-config-file none` still holds, because a developer's `~/.config/nextest` must not decide a cached
350
+ verdict.
299
351
  - A crate whose suite outgrows one bounded window declares `[package.metadata.smoothbricks.test] shards = N`, and gets
300
352
  `cargo-test-<package>-shard1..N`, each running `--partition hash:i/N` with the full bound. nextest assigns a test to a
301
353
  shard by hashing its name, so the shards stay an exact partition of the crate as tests and test binaries are added,
302
354
  and a stale `N` can only make a target slow — never drop a test. Omitting the key means one target, as before.
303
- - Tests that a `nextest.toml` override singles out are lifted out of the hash into `cargo-test-<package>-exceptions`,
304
- and the shards run the complement. An override marks a class that does not behave like the rest of the suite, and each
305
- kind breaks a shard differently: a `test-group` only holds within one nextest run, so leaving its members to the hash
306
- would scatter them across runs and dissolve the mutex; a raised `slow-timeout` marks a test whose cost is not the
307
- suite's, such as a compile-fail test that rustc's a fixture for 25.6s on a cold target directory against 1.8s warm —
308
- and every CI runner is cold. One target holds both classes, not one each: they occupy different threads, so its wall
309
- is the max of the classes rather than their sum. The pin is derived by reading the overrides back out of
310
- `nextest.toml`, so declaring one there is the whole change. Only a sharded crate gets this target — an unsharded crate
311
- already runs its whole suite in a single process — and it passes on an empty set, which is the correct answer for a
312
- platform where the singled-out tests are `cfg`-ed out.
355
+ - Tests that a `nextest.toml` override singles out run separately in `cargo-test-<package>-exceptions-shard1..N`, using
356
+ the same declared partition count. Ordinary shards run the complement, so the union still covers every test exactly
357
+ once. The plugin's own overrides raise `slow-timeout` for compile-fail tests and for the real-APFS full-lifecycle
358
+ tests; lifting them out keeps their raised bound from delaying an ordinary shard, and partitioning the class keeps
359
+ every target inside its deadline without relaxing it. Exceptional shards are scheduled like the ordinary ones: nothing
360
+ is exclusive, and isolation between concurrent real-APFS fixtures is the production backend's per-image lease, not Nx
361
+ scheduling. The exceptional filter is derived from the overrides in `nextest.toml`, so adding an override is the whole
362
+ classification change. Only sharded crates need these targets; an unsharded crate already runs its whole suite in one
363
+ process. Empty partitions pass, including platforms where the tests are `cfg`-ed out. `nextest-partitions.test.ts`
364
+ executes the inferred archive and shard commands over 26 tests and asserts that the ordinary shards ran exactly the 13
365
+ ordinary tests once and the exceptional shards exactly the 13 exceptional ones.
313
366
  - Canonical `napi` package metadata provides a host `cargo-napi` target and named release targets for each configured
314
367
  triple. Linux `--use-napi-cross` targets compile C/C++ dependencies with Clang; the NAPI CLI supplies its downloaded
315
368
  GNU sysroot and toolchain flags. This avoids the bundled GCC's unsupported diagnostics-color flag without disabling
@@ -425,6 +478,13 @@ It is deliberately not `nx run <target> && exec`:
425
478
  Pass `--workspace-root <dir>` before `--` when invoking the wrapper outside the workspace. The binary path resolves
426
479
  against the caller's current directory.
427
480
 
481
+ Nx state belongs to one workspace. The wrapper's own Nx is the one `NX_WORKSPACE_ROOT_PATH` names, else the nearest
482
+ `nx.json` above the current directory. When that is not the requested root, `NX_SOCKET_DIR`, `NX_DAEMON_SOCKET_DIR`,
483
+ `NX_WORKSPACE_DATA_DIRECTORY` and `NX_CACHE_DIRECTORY` are not passed on, so the root's daemon, task database and cache
484
+ stay its own instead of landing on the socket and database of the workspace that exported them. The managed shell and
485
+ Cowshed supervisor publish `NX_WORKSPACE_ROOT_PATH` beside those overrides, so a child entering a scratch root still
486
+ knows which workspace owns its inherited state. Without a managed owner, the wrapper derives the root from cwd.
487
+
428
488
  Without `--` and a binary, the wrapper only makes the target current and exits 0, or with the failed run's status:
429
489
 
430
490
  ```bash
@@ -434,6 +494,56 @@ smoo-nx-exec my-cli:build --workspace-root "$root"
434
494
  A hit prints nothing, where `nx run` would replay every task's cached log. A miss prints Nx's run of the target on
435
495
  stderr.
436
496
 
497
+ ## Nx 23.2.1 Runtime Patch
498
+
499
+ The repository installs Nx 23.2.1 with [`patches/nx@23.2.1.patch`](../../patches/nx@23.2.1.patch) applied, from an
500
+ immutable release tarball: the root `package.json` keeps `devDependencies.nx` at `23.2.1` and sets `overrides.nx` to the
501
+ release asset's URL, and `bun.lock` pins its sha512. `tooling/patched-nx.ts` builds the tarball reproducibly from the
502
+ registry tarball and the patch; the `Patched Nx` workflow publishes it once from `main`, under a tag named for the
503
+ uncompressed tar's sha256, and verifies the served asset on every later run. A tarball, unlike a `patchedDependencies`
504
+ entry, stays in Bun's read-only global store (`~/.bun/install/cache/links`), so a sandbox can run Nx without being able
505
+ to write it.
506
+
507
+ `@nx/js` imports `nx` (`nx/release`, `nx/src/…`) without declaring it
508
+ ([nrwl/nx#34087](https://github.com/nrwl/nx/issues/34087)), and a global-store entry links only declared dependencies,
509
+ so `@nx/js` in that store cannot find Nx: its version actions, and this plugin's that extend them, would fail.
510
+ `patches/@nx%2Fjs@23.2.1.patch` declares the peer. Being patched, `@nx/js` installs project-local under
511
+ `node_modules/.bun/`, where `nx` resolves through the hoisted `node_modules/.bun/node_modules/nx` link to the same
512
+ tarball entry; Bun's lock still records only the registry peers, so the placement is what makes the import resolve.
513
+
514
+ The Nx patch repairs upstream Nx runtime behavior, separately from this plugin's workspace-owner checks:
515
+
516
+ - **Task history uses the client's native database connection.** Task details and history must share that connection; a
517
+ daemon can have frozen a different database namespace before a later client supplies workspace-data overrides. The
518
+ patch removes the obsolete history RPCs and retains native errors, including post-run failures. See
519
+ [upstream Nx #37268](https://github.com/nrwl/nx/pull/37268).
520
+ - **The default cache limit uses the cache's own filesystem.** It takes ten percent of `statfs(cacheDir)` capacity, or
521
+ its nearest existing ancestor when the directory has not been created. This avoids synchronously inventorying every
522
+ mounted disk. Explicit `NX_MAX_CACHE_SIZE` and `nx.json.maxCacheSize` retain their precedence; filesystem errors other
523
+ than a missing directory still fail the operation. See [upstream Nx #37269](https://github.com/nrwl/nx/pull/37269).
524
+ - **The daemon keeps graph plugin workers running.** Nx stops an isolated plugin worker after the last phase it has
525
+ hooks for, which for a graph-only plugin is every graph; the daemon recomputes the graph on every tracked file change,
526
+ so each change spawned and loaded every graph plugin's worker again (median 199 ms against 63 ms from edit to graph in
527
+ a one-project fixture, 0.9–1.5 s per worker under a gate's load). On the daemon a worker with graph hooks now lives as
528
+ long as the daemon; one-shot clients and task-only plugins keep the eager shutdown. See
529
+ [upstream Nx #37271](https://github.com/nrwl/nx/pull/37271).
530
+ - **Nx resolves typescript and release version actions from the workspace.** Nx 23.2.1 loads both with a plain `require`
531
+ from its own location, which in Bun's global store holds only Nx's own dependencies. There it finds no `typescript`,
532
+ so its dependency analysis skips every source import without a warning (this repository lost 12 of 44 graph edges),
533
+ and `release version` cannot resolve `@nx/js`'s version actions. The patch resolves both through `getNxRequirePaths`
534
+ (the workspace first), falling back to Nx's own location. See
535
+ [upstream Nx #37272](https://github.com/nrwl/nx/pull/37272).
536
+
537
+ Publishing or installing `@smoothbricks/nx-plugin` does **not** change a consumer's Nx. A consumer needing these repairs
538
+ sets the same `overrides.nx` URL in its root `package.json`, registers the same `@nx/js` patch in its
539
+ `patchedDependencies`, regenerates its lockfile, and proves a frozen install and its affected normal Nx gates. Do not
540
+ replace the registry dependency with a local link or hide a failure by resetting the database or disabling the daemon.
541
+
542
+ The patch is version-specific. A changed patch publishes a new release, and consumers move to its URL. On an Nx upgrade,
543
+ remove each hunk only when the installed upstream release contains that repair and the task-history namespace,
544
+ cache-bound, resident-worker and store-resolution regressions pass; preserve any repair not yet released. When every
545
+ hunk is upstream, drop the override, the patch, `tooling/patched-nx.ts` and the workflow together.
546
+
437
547
  ## Bun Test Tracing Generator
438
548
 
439
549
  Configure a package for the Bun test tracing + no-emit test typechecking pattern used in this repo.
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync } from 'node:fs';
3
- import { dirname, isAbsolute, join, resolve } from 'node:path';
2
+ import { isAbsolute, resolve } from 'node:path';
4
3
  import { inspect } from 'node:util';
5
- import { describeMiss, ensureBuilt, parseTargetSelector } from '../ensure-built.js';
4
+ import { describeMiss, ensureBuilt, findNxWorkspaceRoot, parseTargetSelector } from '../ensure-built.js';
6
5
  const USAGE = 'usage: smoo-nx-exec <project:target[:configuration]> [--workspace-root <dir>] [-- <binary> [args...]]';
7
6
  /** Argument and environment problems all exit 2, the shell's "usage" code. */
8
7
  function usageError(message) {
@@ -38,17 +37,7 @@ function tokenize(args) {
38
37
  return tokens;
39
38
  }
40
39
  function findWorkspaceRoot(from) {
41
- let directory = from;
42
- for (;;) {
43
- if (existsSync(join(directory, 'nx.json'))) {
44
- return directory;
45
- }
46
- const parent = dirname(directory);
47
- if (parent === directory) {
48
- return usageError(`no nx.json at or above ${from}; pass --workspace-root`);
49
- }
50
- directory = parent;
51
- }
40
+ return findNxWorkspaceRoot(from) ?? usageError(`no nx.json at or above ${from}; pass --workspace-root`);
52
41
  }
53
42
  const argv = process.argv.slice(2);
54
43
  const separator = argv.indexOf('--');
@@ -7,22 +7,23 @@ import { type CargoResolve } from './cargo-source-hash.js';
7
7
  */
8
8
  export declare const CARGO_CLOSURE_INPUT = "cargoClosure";
9
9
  type Input = NonNullable<TargetConfiguration['inputs']>[number];
10
+ /** A closure Nx cannot express exactly is a refusal, never a broader cache key. */
11
+ export declare class CargoClosureInputError extends Error {
12
+ readonly projectRoot: string;
13
+ constructor(projectRoot: string, cause: unknown);
14
+ }
10
15
  /**
11
16
  * One Cargo workspace as one project-graph computation sees it. `manifest` is
12
17
  * the workspace's root manifest relative to the Nx workspace root.
13
18
  */
14
- export type CargoClosureSource = {
15
- readonly kind: 'resolved';
19
+ export interface CargoClosureSource {
16
20
  readonly manifest: string;
17
21
  /** The canonical Nx workspace root. */
18
22
  readonly root: string;
19
23
  readonly cargo: CargoResolve;
20
24
  /** Every `Cargo.toml` in Nx's file index, relative to the workspace root. */
21
25
  readonly indexed: ReadonlySet<string>;
22
- } | {
23
- readonly kind: 'unresolved';
24
- readonly manifest: string;
25
- };
26
+ }
26
27
  /**
27
28
  * Every `Cargo.toml` Nx's workspace file index holds: .gitignore and .nxignore
28
29
  * applied, `node_modules` never entered. A package whose manifest is missing
@@ -30,11 +31,9 @@ export type CargoClosureSource = {
30
31
  */
31
32
  export declare function indexedCargoManifests(workspaceRoot: string): Promise<ReadonlySet<string>>;
32
33
  /**
33
- * Locked, offline `cargo metadata` for one Cargo workspace, once per graph
34
- * computation. Never rejects: a workspace Cargo cannot resolve right now (no
35
- * cargo on PATH, a stale lockfile, an unfetched dependency) still gets its
36
- * closure inputs, hashed at run time by the command that reports the same
37
- * failure wherever a task needs it. Said once here, not once per project.
34
+ * Content-keyed locked offline metadata. A refusal fails graph inference:
35
+ * a stale closure or runtime whole-workspace fallback cannot establish the
36
+ * precise set of cache inputs.
38
37
  */
39
38
  export declare function resolveCargoClosureSource(manifest: string, workspaceRoot: string, indexed: Promise<ReadonlySet<string>>): Promise<CargoClosureSource>;
40
39
  /**
@@ -53,10 +52,9 @@ export declare function resolveCargoClosureSource(manifest: string, workspaceRoo
53
52
  * exist. That command resolves the closure again when it runs, so a member
54
53
  * that only an edit outside the workspace brings in is still covered.
55
54
  *
56
- * When the closure cannot be expressed that way — Cargo could not resolve it
57
- * here, or a member inside the workspace is missing from Nx's file index —
58
- * the definition is the complete runtime hash instead: correct, slower, and
59
- * reported on stderr.
55
+ * An in-workspace member missing from Nx's file index is a typed refusal,
56
+ * never a whole-workspace runtime hash. Only outside-workspace members need
57
+ * the external-only runtime input.
60
58
  */
61
59
  export declare function cargoClosureInputs(projectRoot: string, sources: readonly CargoClosureSource[]): Promise<Input[]>;
62
60
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"cargo-closure-input.d.ts","sourceRoot":"","sources":["../src/cargo-closure-input.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,EAEL,KAAK,YAAY,EAKlB,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD,KAAK,KAAK,GAAG,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAgBhE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACvC,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,Y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,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAM/F;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GACpC,OAAO,CAAC,kBAAkB,CAAC,CAI7B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,OAAO,CAAC,KAAK,EAAE,CAAC,CAelB"}
@@ -1,13 +1,25 @@
1
1
  import { realpath } from 'node:fs/promises';
2
2
  import { isAbsolute, join, posix, relative, sep } from 'node:path';
3
- import { globWithWorkspaceContext } from 'nx/src/utils/workspace-context.js';
4
- import { CARGO_ANCESTOR_INPUTS, dependencyClosure, governingManifest, HASH_SKIPPED_DIRECTORIES, readCargoResolve, } from './cargo-source-hash.js';
3
+ import { globWithWorkspaceContext, globWithWorkspaceContextSync } from 'nx/src/utils/workspace-context.js';
4
+ import { workspaceRoot as daemonWorkspaceRoot } from 'nx/src/utils/workspace-root.js';
5
+ import { CARGO_ANCESTOR_INPUTS, dependencyClosure, HASH_SKIPPED_DIRECTORIES, readCargoResolve, } from './cargo-source-hash.js';
5
6
  /**
6
7
  * The named input the plugin infers for every project with crates of a Cargo
7
8
  * workspace under its root: the mutable sources of the Cargo-resolved
8
9
  * dependency closure of those crates, and the lockfile that pins the rest.
9
10
  */
10
11
  export const CARGO_CLOSURE_INPUT = 'cargoClosure';
12
+ /** A closure Nx cannot express exactly is a refusal, never a broader cache key. */
13
+ export class CargoClosureInputError extends Error {
14
+ projectRoot;
15
+ constructor(projectRoot, cause) {
16
+ super(`Cannot infer ${CARGO_CLOSURE_INPUT} for ${projectRoot}: ${cause instanceof Error ? cause.message : String(cause)}`, {
17
+ cause,
18
+ });
19
+ this.name = 'CargoClosureInputError';
20
+ this.projectRoot = projectRoot;
21
+ }
22
+ }
11
23
  /**
12
24
  * How a runtime input reaches the hash command. Nx runs it with `sh -c` from
13
25
  * the workspace root and puts no `node_modules/.bin` on its PATH; a plugin Nx
@@ -26,34 +38,20 @@ const GLOB_SYNTAX = /[*?[\]{}()!,]/;
26
38
  * here has no files a fileset input can hash.
27
39
  */
28
40
  export async function indexedCargoManifests(workspaceRoot) {
29
- return new Set(await globWithWorkspaceContext(workspaceRoot, ['**/Cargo.toml']));
41
+ const manifests = workspaceRoot === daemonWorkspaceRoot
42
+ ? await globWithWorkspaceContext(workspaceRoot, ['**/Cargo.toml'])
43
+ : globWithWorkspaceContextSync(workspaceRoot, ['**/Cargo.toml']);
44
+ return new Set(manifests);
30
45
  }
31
46
  /**
32
- * Locked, offline `cargo metadata` for one Cargo workspace, once per graph
33
- * computation. Never rejects: a workspace Cargo cannot resolve right now (no
34
- * cargo on PATH, a stale lockfile, an unfetched dependency) still gets its
35
- * closure inputs, hashed at run time by the command that reports the same
36
- * failure wherever a task needs it. Said once here, not once per project.
47
+ * Content-keyed locked offline metadata. A refusal fails graph inference:
48
+ * a stale closure or runtime whole-workspace fallback cannot establish the
49
+ * precise set of cache inputs.
37
50
  */
38
51
  export async function resolveCargoClosureSource(manifest, workspaceRoot, indexed) {
39
- try {
40
- // One Promise.all, entered before any await, so a failed index listing is
41
- // handled here even when it settles before Cargo does.
42
- const [{ root, cargo }, index] = await Promise.all([
43
- realpath(workspaceRoot).then(async (root) => ({
44
- root,
45
- cargo: await readCargoResolve(join(root, manifest), root),
46
- })),
47
- indexed,
48
- ]);
49
- return { kind: 'resolved', manifest, root, cargo, indexed: index };
50
- }
51
- catch (error) {
52
- const message = error instanceof Error ? error.message : String(error);
53
- process.stderr.write(`@smoothbricks/nx-plugin: resolving ${manifest} failed (${message.trim().split('\n').slice(0, 3).join(' ')}); ` +
54
- `every ${CARGO_CLOSURE_INPUT} under it runs smoo-nx-cargo-hash on each hash instead of reading Nx's file index.\n`);
55
- return { kind: 'unresolved', manifest };
56
- }
52
+ const [root, index] = await Promise.all([realpath(workspaceRoot), indexed]);
53
+ const cargo = await readCargoResolve(join(root, manifest), root, index);
54
+ return { manifest, root, cargo, indexed: index };
57
55
  }
58
56
  /**
59
57
  * The `cargoClosure` definition for the project at `projectRoot`: for each
@@ -71,10 +69,9 @@ export async function resolveCargoClosureSource(manifest, workspaceRoot, indexed
71
69
  * exist. That command resolves the closure again when it runs, so a member
72
70
  * that only an edit outside the workspace brings in is still covered.
73
71
  *
74
- * When the closure cannot be expressed that way — Cargo could not resolve it
75
- * here, or a member inside the workspace is missing from Nx's file index —
76
- * the definition is the complete runtime hash instead: correct, slower, and
77
- * reported on stderr.
72
+ * An in-workspace member missing from Nx's file index is a typed refusal,
73
+ * never a whole-workspace runtime hash. Only outside-workspace members need
74
+ * the external-only runtime input.
78
75
  */
79
76
  export async function cargoClosureInputs(projectRoot, sources) {
80
77
  const inputs = [];
@@ -94,9 +91,6 @@ export async function cargoClosureInputs(projectRoot, sources) {
94
91
  async function workspaceClosureInputs(projectRoot, source) {
95
92
  const lock = posix.join('{workspaceRoot}', posix.dirname(source.manifest), 'Cargo.lock');
96
93
  const closureArguments = `--closure ${shellWord(projectRoot)} ${shellWord(source.manifest)}`;
97
- const runtimeHash = [lock, { runtime: `${CARGO_HASH_COMMAND} --include-workspace ${closureArguments}` }];
98
- if (source.kind === 'unresolved')
99
- return runtimeHash;
100
94
  const { root, cargo, indexed } = source;
101
95
  const packageDirectories = [];
102
96
  const files = [];
@@ -115,7 +109,7 @@ async function workspaceClosureInputs(projectRoot, source) {
115
109
  throw new Error(`the Cargo package ${directory} is not in Nx's file index (an ignored directory)`);
116
110
  }
117
111
  packageDirectories.push(directory);
118
- for (const file of [...pkg.sources, await governingManifest(cargo, pkg, root)]) {
112
+ for (const file of [...pkg.sources, pkg.governingManifest]) {
119
113
  const path = indexablePath(root, file);
120
114
  if (path === null)
121
115
  throw new Error(`${directory} compiles ${file}, which Nx's file index cannot hold`);
@@ -127,9 +121,7 @@ async function workspaceClosureInputs(projectRoot, source) {
127
121
  throw new Error(`${unglobbable} contains glob syntax, so no fileset can name it`);
128
122
  }
129
123
  catch (error) {
130
- process.stderr.write(`@smoothbricks/nx-plugin: ${projectRoot}'s ${CARGO_CLOSURE_INPUT} runs smoo-nx-cargo-hash on each hash ` +
131
- `instead of reading Nx's file index: ${error instanceof Error ? error.message : String(error)}\n`);
132
- return runtimeHash;
124
+ throw new CargoClosureInputError(projectRoot, error);
133
125
  }
134
126
  // A package nested in another member's directory is already covered by it.
135
127
  const directories = [...new Set(packageDirectories)]
@@ -5,6 +5,7 @@ export interface LocalCargoPackage {
5
5
  readonly manifest: string;
6
6
  /** Every target's source file: library, binaries, tests, build script. A target may live outside `directory`. */
7
7
  readonly sources: readonly string[];
8
+ readonly governingManifest: string;
8
9
  }
9
10
  /** What locked, offline `cargo metadata` reports about one Cargo workspace's mutable packages. */
10
11
  export interface CargoResolve {
@@ -29,15 +30,19 @@ export interface CargoPathInputsOptions {
29
30
  export declare const HASH_SKIPPED_DIRECTORIES: readonly ['target', '.git', 'node_modules', '.cache', '.cowshed', '.fseventsd', '.TemporaryItems', '.Trashes', '.Spotlight-V100', '.DocumentRevisions-V100'];
30
31
  /** Files in every ancestor of a package directory that Cargo reads while building it. */
31
32
  export declare const CARGO_ANCESTOR_INPUTS: readonly ['Cargo.toml', '.cargo/config', '.cargo/config.toml'];
32
- /** Locked, offline `cargo metadata` for the workspace `manifestPath` names, run from `cwd`. */
33
- export declare function readCargoResolve(manifestPath: string, cwd: string): Promise<CargoResolve>;
33
+ /** A Cargo resolution refusal: no stale closure or runtime whole-workspace substitute is safe. */
34
+ export declare class CargoMetadataError extends Error {
35
+ readonly manifestPath: string;
36
+ constructor(manifestPath: string, cause: unknown);
37
+ }
34
38
  /**
35
- * The canonical root manifest of the Cargo workspace that governs `pkg`.
36
- * Metadata's `workspace_root` describes only the invoking workspace, which is
37
- * the answer for its own members. Any other path package asks Cargo, which
38
- * resolves an explicit `package.workspace` as well as the ancestor search.
39
+ * One content-keyed resolution per Cargo workspace, across concurrent graph
40
+ * calls and workers. Nx's kernel FileLock releases even if its worker dies;
41
+ * in-process callers join before taking that lock, so a synchronous lock()
42
+ * cannot block the continuation that owns it. A changed key queues behind
43
+ * the old child instead of receiving its stale answer.
39
44
  */
40
- export declare function governingManifest(cargo: CargoResolve, pkg: LocalCargoPackage, cwd: string): Promise<string>;
45
+ export declare function readCargoResolve(manifestPath: string, cwd: string, indexed?: ReadonlySet<string>): Promise<CargoResolve>;
41
46
  export declare function hashCargoPathInputs(manifestPath: string, workspaceRoot: string, options?: CargoPathInputsOptions): Promise<string>;
42
47
  /**
43
48
  * The ids Cargo's resolve graph reaches from the local packages under
@@ -1 +1 @@
1
- {"version":3,"file":"cargo-source-hash.d.ts","sourceRoot":"","sources":["../src/cargo-source-hash.ts"],"names":[],"mappings":"AAgEA,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iHAAiH;IACjH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,kGAAkG;AAClG,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC7C,sFAAsF;IACtF,QAAQ,C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