@zackees/soldr 0.7.5 → 0.7.7

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/README.md CHANGED
@@ -56,12 +56,11 @@ the published `SHA256SUMS` file, and exposes the `soldr` command.
56
56
 
57
57
  ## GitHub Actions setup
58
58
 
59
- The current GitHub Actions entry point is the repository root action in this repository:
59
+ The current GitHub Actions entry point is the public `setup-soldr` action:
60
60
 
61
61
  ```yaml
62
- - uses: zackees/soldr@<ref>
62
+ - uses: zackees/setup-soldr@v0
63
63
  with:
64
- version: 0.7.4
65
64
  cache: true
66
65
 
67
66
  - run: soldr cargo build --locked --release
@@ -74,17 +73,16 @@ That action:
74
73
  - bootstraps `rustup` into the cached runner-local root when the runner does not already have it
75
74
  - preinstalls the exact Rust toolchain from `rust-toolchain.toml` by default via `rustup`
76
75
  - restores a cacheable runner-local root for Soldr, Cargo, and rustup state
77
- - restores and saves the zccache compilation artifact cache at `~/.zccache` by default; set `build-cache: false` to disable it
78
- - restores and saves the Cargo target directory by default for no-op CI fast paths; set `target-cache: false` to disable it or `target-dir:` to choose another target directory
76
+ - restores and saves the Soldr-owned zccache compilation artifact cache under `SOLDR_CACHE_DIR` by default; set `build-cache: false` to disable it
77
+ - restores and saves a bounded hot Cargo target cache by default for no-op CI fast paths; set `target-cache: false` to disable it, `target-cache-mode: full` to opt into whole-target caching, or `target-dir:` to choose another target directory
79
78
  - puts `soldr` on `PATH` for later steps
80
- - is the extraction source for the planned public `zackees/setup-soldr` action product
81
79
 
82
80
  If your project pins Rust in `rust-toolchain.toml`, let the action read that file or pass the exact value with `toolchain:`. Do not preinstall a different generic toolchain such as `stable` and assume `soldr` will reconcile it later. The action exports `RUSTUP_TOOLCHAIN` after installation so later `cargo`, `rustc`, and `soldr cargo ...` steps stay on the toolchain it just installed instead of asking `rustup` to resolve a pinned file lazily.
83
81
 
84
82
  On GitHub-hosted runners, this means you usually do not need a separate toolchain setup action for the normal path. The action still uses `rustup` under the hood today, but it bootstraps `rustup` itself when the runner does not already have it.
85
83
  On runners without `rustup`, the action downloads and installs it into the cached runner-local root before provisioning the requested toolchain.
86
84
 
87
- For same-repository validation, use `uses: ./`. This repository smoke-tests that path in [setup-soldr-action.yml](./.github/workflows/setup-soldr-action.yml). GitHub Marketplace publication still requires extracting this action into a separate public action repository because GitHub requires a single root `action.yml` and no workflow files in the published repository. The repo-contained extraction plan and intended `zackees/setup-soldr@v1` contract live in [docs/SETUP_SOLDR_PUBLIC_ACTION.md](./docs/SETUP_SOLDR_PUBLIC_ACTION.md). Until that public repo exists, treat `zackees/soldr@<ref>` as the current contract and pin a full commit SHA or explicit release tag instead of assuming `@v1`. For fuller examples and fallback patterns, see [INTEGRATION.md](./INTEGRATION.md).
85
+ The public action lives in [`zackees/setup-soldr`](https://github.com/zackees/setup-soldr) and is generated from this repository's root action source. This repository dogfoods `zackees/setup-soldr@v0` in [setup-soldr-action.yml](./.github/workflows/setup-soldr-action.yml). For fuller examples and fallback patterns, see [INTEGRATION.md](./INTEGRATION.md).
88
86
 
89
87
  ### CI cache lineage
90
88
 
@@ -124,13 +122,14 @@ If soldr solves that one problem well, it becomes a super tool: the command you
124
122
 
125
123
  - **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).
126
124
 
127
- - **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; zccache's artifact store still uses its current default cache root.
125
+ - **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.
128
126
 
129
127
  ```bash
130
128
  # Build through soldr's front door:
131
129
  soldr cargo build --release
132
130
  soldr cargo test
133
131
  soldr --no-cache cargo test
132
+ soldr purge
134
133
  SOLDR_RUSTC_WRAPPER=sccache soldr cargo build
135
134
  SOLDR_RUSTC_WRAPPER=none soldr cargo build
136
135
 
@@ -160,8 +159,8 @@ soldr maturin build --release
160
159
  - **One obvious command**: Fetch tools, pick the right Windows target, and run through managed zccache through the same entry point.
161
160
  - **Front-door builds**: `soldr cargo ...` is the primary build UX.
162
161
  - **Invisible caching**: `soldr cargo ...` uses a soldr-managed zccache by default, with `soldr --no-cache cargo ...` as the opt-out.
163
- - **Real cache controls**: `soldr status`, `soldr cache`, and `soldr clean` report and manage the soldr-managed zccache state instead of placeholder behavior.
164
- - **One cache boundary, eventually**: soldr keeps its own tools and zccache session state in `~/.soldr/`. Current zccache artifacts still live in zccache's default cache root until upstream exposes a supported cache-dir override.
162
+ - **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.
163
+ - **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.
165
164
  - **Pre-built first**: Download a pre-built binary before compiling from source. Fall back gracefully.
166
165
  - **Cargo-compatible**: soldr preserves normal cargo arguments instead of forcing a separate workflow.
167
166
  - **Cross-platform**: Linux, macOS, Windows (x86_64 + aarch64).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zackees/soldr",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
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",
@@ -9,11 +9,57 @@ const root = path.resolve(__dirname, "..");
9
9
  const pkg = require(path.join(root, "package.json"));
10
10
  const install = require(path.join(root, "scripts", "install.js"));
11
11
 
12
+ function tomlSection(toml, sectionName) {
13
+ const header = `[${sectionName}]`;
14
+ const lines = toml.split(/\r?\n/);
15
+ const body = [];
16
+ let found = false;
17
+
18
+ for (const line of lines) {
19
+ if (/^\s*\[.*\]\s*$/.test(line)) {
20
+ if (found) {
21
+ break;
22
+ }
23
+ found = line.trim() === header;
24
+ continue;
25
+ }
26
+
27
+ if (found) {
28
+ body.push(line);
29
+ }
30
+ }
31
+
32
+ return found ? body.join("\n") : null;
33
+ }
34
+
12
35
  const cargoToml = fs.readFileSync(path.join(root, "Cargo.toml"), "utf8");
13
36
  const cargoVersion = cargoToml.match(/\[workspace\.package\][\s\S]*?^version = "([^"]+)"/m);
14
37
  assert(cargoVersion, "workspace package version not found in Cargo.toml");
15
38
  assert.strictEqual(pkg.version, cargoVersion[1], "package.json version must match Cargo.toml");
16
39
 
40
+ const pyprojectToml = fs.readFileSync(path.join(root, "pyproject.toml"), "utf8");
41
+ const pyprojectProject = tomlSection(pyprojectToml, "project");
42
+ assert(pyprojectProject, "[project] section not found in pyproject.toml");
43
+
44
+ assert(
45
+ !/^\s*version\s*=/.test(pyprojectProject),
46
+ 'pyproject.toml [project] must not hardcode version; PyPI must derive it from Cargo.toml',
47
+ );
48
+
49
+ const dynamicVersion = pyprojectProject.match(/^\s*dynamic\s*=\s*\[([^\]]*)\]\s*$/m);
50
+ assert(
51
+ dynamicVersion,
52
+ 'pyproject.toml [project] must declare dynamic = ["version"] so PyPI derives from Cargo.toml',
53
+ );
54
+
55
+ const dynamicItems = [...dynamicVersion[1].matchAll(/"([^"]+)"|'([^']+)'/g)].map(
56
+ (match) => match[1] || match[2],
57
+ );
58
+ assert(
59
+ dynamicItems.includes("version"),
60
+ 'pyproject.toml [project] dynamic metadata must include "version"',
61
+ );
62
+
17
63
  assert.strictEqual(pkg.name, "@zackees/soldr");
18
64
  assert.strictEqual(pkg.license, "BSD-3-Clause");
19
65
  assert.strictEqual(pkg.bin.soldr, "bin/soldr.js");
@@ -42,4 +88,4 @@ assert.strictEqual(
42
88
  "abc123",
43
89
  );
44
90
 
45
- console.log("npm package checks passed");
91
+ console.log("npm package and PyPI version checks passed");