@zackees/soldr 0.8.20 → 0.8.22

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 (2) hide show
  1. package/README.md +45 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -169,13 +169,19 @@ When you run `soldr`, the tool should do the obvious thing:
169
169
  - pick MSVC on Windows by default
170
170
  - fetch the tool you asked for
171
171
  - cache it locally
172
- - fetch and manage zccache so Rust builds get transparent caching without manual wrapper setup
172
+ - host its embedded zccache service so Rust builds get transparent caching
173
+ without manual wrapper or daemon setup
173
174
 
174
175
  If soldr solves that one problem well, it becomes a super tool: the command you reach for first, because it makes the rest of the stack behave.
175
176
 
176
177
  - **Tool acquisition** (the crgx half): Need `maturin`, `cargo-dylint`, or any crate binary? soldr fetches a pre-built binary from GitHub Releases in seconds. No `cargo install` from source. Cached locally for instant reuse. On `0.5.x`, this is still an upstream trust decision rather than a repo-side trust guarantee; see [docs/TRUST_BOUNDARIES.md](./docs/TRUST_BOUNDARIES.md).
177
178
 
178
- - **Compilation caching** (the zccache half): `soldr cargo ...` now fetches and manages a pinned `zccache` release for Rust builds. soldr owns the zccache daemon/session wiring and keeps managed zccache artifacts under Soldr's cache root.
179
+ - **Compilation caching** (the zccache half): `soldr cargo ...` routes rustc
180
+ invocations through the zccache service embedded in `soldr-daemon`. zccache
181
+ is compiled into the Soldr binaries; there is no separately downloaded or
182
+ standalone zccache daemon. Soldr owns the build-session wiring and keeps its
183
+ object store under the active Soldr root at
184
+ `cache/zccache/daemon-state/embedded-v1/<zccache-version>/objects`.
179
185
 
180
186
  ```bash
181
187
  # Build through soldr's front door:
@@ -203,6 +209,11 @@ soldr cargo-dylint check
203
209
  soldr rustfmt src/main.rs
204
210
  ```
205
211
 
212
+ Rustfmt still runs through Soldr. Recursive invocations always execute the real
213
+ formatter because Cargo's explicit crate-root argv does not include child
214
+ modules that rustfmt discovers itself. A content-marker shortcut is used only
215
+ for invocations that explicitly set `skip_children=true`.
216
+
206
217
  ## Use soldr as your PEP 517 build backend (instead of maturin)
207
218
 
208
219
  For Rust+Python packages, point `pyproject.toml` at soldr instead of
@@ -252,7 +263,10 @@ to stderr. Set `SOLDR_PEP517_STATS=off` to silence it; `SOLDR_PEP517_STATS=full`
252
263
  statistics payload.
253
264
 
254
265
  Soldr also caches the last successful wheel for each project/build mode under
255
- `~/.soldr/pep517/wheels/`. Before packaging it scans source and staged-artifact
266
+ `<effective-soldr-root>/pep517/wheels/`. The backend asks the selected soldr
267
+ binary for this root, so official (`.soldr`), development (`.soldr-dev`), and
268
+ custom roots remain separate even when `SOLDR_CACHE_DIR` was initially unset.
269
+ Before packaging it scans source and staged-artifact
256
270
  metadata (relative path, size, and modification time); an unchanged tree
257
271
  hardlinks the cached wheel into pip's requested output directory and skips
258
272
  wheel rebuilding/compression. Set `SOLDR_PEP517_WHEEL_CACHE=off` to opt out.
@@ -302,7 +316,11 @@ flowchart TD
302
316
  B -->|"anything else<br/>maturin · cargo-nextest · cbindgen · ..."| E["<b>Tool-fetch mode</b><br/>resolve via known_tools,<br/>download from GitHub Releases,<br/>exec the fetched binary."]
303
317
  ```
304
318
 
305
- When you run `soldr cargo build`, the two other modes both come into play. soldr acts as the dispatch-mode front door, then cargo re-invokes soldr once per crate as the RUSTC_WRAPPER — that second soldr is the cache-mode instance that talks to the managed zccache daemon:
319
+ When you run `soldr cargo build`, the two other modes both come into play.
320
+ soldr acts as the dispatch-mode front door, then cargo re-invokes soldr once
321
+ per crate as the `RUSTC_WRAPPER` — that second soldr is the cache-mode
322
+ instance that sends the compile to the zccache service embedded in
323
+ `soldr-daemon`:
306
324
 
307
325
  ```mermaid
308
326
  sequenceDiagram
@@ -311,24 +329,27 @@ sequenceDiagram
311
329
  participant S1 as soldr (front door)
312
330
  participant C as cargo
313
331
  participant S2 as soldr (RUSTC_WRAPPER)
314
- participant Z as zccache daemon
332
+ participant D as soldr-daemon
333
+ participant Z as embedded zccache
315
334
  participant R as real rustc
316
335
 
317
336
  U->>S1: soldr cargo build --release
318
337
  S1->>S1: dispatch mode: cargo verb
319
- S1->>Z: start managed zccache if needed
320
338
  S1->>C: exec cargo (RUSTC_WRAPPER=soldr)
321
339
  loop per crate
322
340
  C->>S2: soldr [path-to-rustc] [args]
323
- S2->>Z: query cache (hash of inputs)
341
+ S2->>D: stream compile request
342
+ D->>Z: compile (hash inputs)
324
343
  alt cache hit
325
- Z-->>S2: cached artifact
344
+ Z-->>D: cached artifact
345
+ D-->>S2: streamed result
326
346
  S2-->>C: emit artifact, exit 0
327
347
  else cache miss
328
348
  Z->>R: forward to rustc
329
349
  R-->>Z: fresh artifact
330
350
  Z->>Z: store keyed by input hash
331
- Z-->>S2: artifact
351
+ Z-->>D: artifact
352
+ D-->>S2: streamed result
332
353
  S2-->>C: emit artifact, exit 0
333
354
  end
334
355
  end
@@ -336,6 +357,11 @@ sequenceDiagram
336
357
  S1-->>U: exit
337
358
  ```
338
359
 
360
+ The wrapper may run from a compiler-named multicall shim, but daemon recovery
361
+ always executes a canonical `soldr-daemon` alias. A daemon-lifetime singleton
362
+ lock, bind-before-publish startup, and PID/socket ownership checks prevent an
363
+ older or idle-timed-out process from deleting a newer daemon's endpoint.
364
+
339
365
  Tool fetches are much simpler — no cargo, no rustc, no wrapper handshake:
340
366
 
341
367
  ```text
@@ -375,11 +401,17 @@ If you also have many separate test binaries, consider consolidating them under
375
401
 
376
402
  ## Design goals
377
403
 
378
- - **One obvious command**: Fetch tools, pick the right Windows target, and run through managed zccache through the same entry point.
404
+ - **One obvious command**: Fetch tools, pick the right Windows target, and run through Soldr's embedded zccache service through the same entry point.
379
405
  - **Front-door builds**: `soldr cargo ...` is the primary build UX.
380
- - **Invisible caching**: `soldr cargo ...` uses a soldr-managed zccache by default, with `soldr --no-cache cargo ...` as the opt-out.
381
- - **Real cache controls**: `soldr status`, `soldr cache`, and `soldr clean` report and manage the soldr-managed zccache state, while `soldr purge` removes all Soldr-managed cache artifacts for bug clearing and benchmarking.
382
- - **One cache boundary**: soldr keeps its own tools, zccache session state, and managed zccache artifacts under `~/.soldr/` by default. Use `SOLDR_CACHE_DIR` to move that root.
406
+ - **Invisible caching**: `soldr cargo ...` uses the zccache service embedded in `soldr-daemon` by default, with `soldr --no-cache cargo ...` as the opt-out.
407
+ - **Real cache controls**: `soldr status`, `soldr cache`, and `soldr clean` report and manage embedded-zccache state, while `soldr purge` removes all Soldr-managed cache artifacts for bug clearing and benchmarking.
408
+ - **One cache boundary**: official soldr keeps its tools and cache state under `~/.soldr/`; development builds use `~/.soldr-dev/`. Use `SOLDR_CACHE_DIR` to select an explicit root.
409
+ - **Bounded while idle**: the long-lived daemon owns only its selected root,
410
+ checks pressure every five minutes, expires old state daily, and installs no
411
+ OS scheduler. Embedded zccache defaults to 5% of the filesystem clamped to
412
+ 40–200 GiB, becomes aggressive for entries older than four days near full,
413
+ and expires artifacts after 30 days. Production, development (`.soldr-dev`),
414
+ custom, and standalone `.zccache` roots never sweep one another.
383
415
  - **Disposable-worktree friendly on Windows**: for build orchestration, soldr can relocate itself under `~/.soldr/runtime/soldr-self/` so `RUSTC_WRAPPER` does not keep using a worktree-local `soldr.exe`; stale runtime copies are cleaned up periodically.
384
416
  - **Pre-built first**: Download a pre-built binary before compiling from source. Fall back gracefully.
385
417
  - **Cargo-compatible**: soldr preserves normal cargo arguments instead of forcing a separate workflow.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zackees/soldr",
3
- "version": "0.8.20",
3
+ "version": "0.8.22",
4
4
  "description": "Instant Rust tools and builds from one command.",
5
5
  "license": "BSD-3-Clause",
6
6
  "homepage": "https://github.com/zackees/soldr",