@zackees/soldr 0.9.0 → 0.9.1
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
|
@@ -70,8 +70,8 @@ The current GitHub Actions entry point is the public `setup-soldr` action:
|
|
|
70
70
|
with:
|
|
71
71
|
cache: true
|
|
72
72
|
|
|
73
|
-
- run: soldr cargo build --
|
|
74
|
-
- run: soldr cargo test
|
|
73
|
+
- run: soldr cargo build --release
|
|
74
|
+
- run: soldr cargo test
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
That action:
|
|
@@ -91,8 +91,8 @@ For existing workflows where rewriting every `cargo ...` command is high-frictio
|
|
|
91
91
|
with:
|
|
92
92
|
tool-shims: cargo
|
|
93
93
|
|
|
94
|
-
- run: cargo build --
|
|
95
|
-
- run: cargo test
|
|
94
|
+
- run: cargo build --release
|
|
95
|
+
- run: cargo test
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
The shim mode is off by default. When enabled, the action resolves the real Cargo binary before prepending its shim directory, then exports that real path for Soldr so `cargo ...` can safely trampoline into `soldr cargo ...` without recursive PATH lookup.
|
|
@@ -115,7 +115,7 @@ Two equivalent ways to declare a cross target: declaratively via `rust-toolchain
|
|
|
115
115
|
```toml
|
|
116
116
|
# rust-toolchain.toml — declarative (preferred)
|
|
117
117
|
[toolchain]
|
|
118
|
-
channel = "1.
|
|
118
|
+
channel = "1.95.0"
|
|
119
119
|
targets = ["aarch64-pc-windows-msvc"]
|
|
120
120
|
```
|
|
121
121
|
|
|
@@ -215,6 +215,32 @@ formatter because Cargo's explicit crate-root argv does not include child
|
|
|
215
215
|
modules that rustfmt discovers itself. A content-marker shortcut is used only
|
|
216
216
|
for invocations that explicitly set `skip_children=true`.
|
|
217
217
|
|
|
218
|
+
## Compile C and C++ directly
|
|
219
|
+
|
|
220
|
+
`soldr cc` and `soldr c++` expose the same catalogue-backed compilers and
|
|
221
|
+
sysroots used by blessed Rust cross-builds. GNU/Linux defaults to the pinned
|
|
222
|
+
glibc 2.17 toolchain:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
soldr cc --target x86_64-linux-gnu.2.17 hello.c -o hello
|
|
226
|
+
./hello
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
CMake accepts the command plus its required target arguments through `CC` and
|
|
230
|
+
`CXX`:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
CC="soldr cc --target x86_64-linux-gnu.2.17" \
|
|
234
|
+
CXX="soldr c++ --target x86_64-linux-gnu.2.17" \
|
|
235
|
+
cmake -S . -B build
|
|
236
|
+
cmake --build build
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Omit `--target` to select the host triple. The first standalone slice supports
|
|
240
|
+
the catalogue GNU/Linux and musl/Linux targets plus
|
|
241
|
+
`x86_64-pc-windows-gnu`. External build tooling can query the prepared tool
|
|
242
|
+
paths with `--print-cc`, `--print-cxx`, `--print-ar`, and `--print-linker`.
|
|
243
|
+
|
|
218
244
|
## Use soldr as your PEP 517 build backend (instead of maturin)
|
|
219
245
|
|
|
220
246
|
For Rust+Python packages, point `pyproject.toml` at soldr instead of
|
|
@@ -437,7 +463,7 @@ soldr/
|
|
|
437
463
|
|
|
438
464
|
| Crate | Role |
|
|
439
465
|
|---|---|
|
|
440
|
-
| `soldr-core` | Shared types, config (`~/.soldr/config.toml`), target-triple resolution (MSVC default on Windows), the daemon wire schema, error types
|
|
466
|
+
| `soldr-core` | Shared types, config (`~/.soldr/config.toml`), target-triple resolution (MSVC default on Windows), the daemon wire schema, error types. No I/O beyond config files. |
|
|
441
467
|
| `soldr-fetch` | Binary resolution. `known_tools` registry, `trust` (SHA-256 pins + `SOLDR_TRUST_MODE` enforcement), rustup auto-bootstrap, resolution chain (local cache → repo lookup → GitHub Releases → extract). |
|
|
442
468
|
| `soldr-cache` | `RUSTC_WRAPPER` mode: hash inputs (blake3), check `~/.soldr/cache/`, daemon IPC (Unix socket / Windows named pipe), LRU eviction, `soldr save` / `soldr load` archive transport, auto-GC. |
|
|
443
469
|
| `soldr-daemon` | Daemon lifecycle (spawn/displacement/relocation), IPC server, wire codec, and the embedded zccache service. Depends on `soldr-core` + `soldr-cache`. |
|
|
@@ -12,52 +12,52 @@
|
|
|
12
12
|
{
|
|
13
13
|
"id": "rust-embedded-runtime-topology",
|
|
14
14
|
"gate": "hard",
|
|
15
|
-
"command": "soldr --no-cache cargo
|
|
15
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --test no_standalone_spawn_lint"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"id": "rust-zccache-entry",
|
|
19
19
|
"gate": "hard",
|
|
20
|
-
"command": "soldr --no-cache cargo
|
|
20
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --test zccache_trampoline_gate"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"id": "rust-wrapper-env",
|
|
24
24
|
"gate": "hard",
|
|
25
|
-
"command": "soldr --no-cache cargo
|
|
25
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --test cli_cargo_wrappers"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"id": "rust-rust-plan",
|
|
29
29
|
"gate": "hard",
|
|
30
|
-
"command": "soldr --no-cache cargo
|
|
30
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --test cli_rust_plan"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"id": "rust-cache-cli",
|
|
34
34
|
"gate": "hard",
|
|
35
|
-
"command": "soldr --no-cache cargo
|
|
35
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --test cli_cache"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"id": "rust-cache-session",
|
|
39
39
|
"gate": "hard",
|
|
40
|
-
"command": "soldr --no-cache cargo
|
|
40
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --lib cache::session::tests"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"id": "rust-native-cache-unit",
|
|
44
44
|
"gate": "hard",
|
|
45
|
-
"command": "soldr --no-cache cargo
|
|
45
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --lib native_cc::tests"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"id": "rust-native-cache-integration",
|
|
49
49
|
"gate": "hard",
|
|
50
|
-
"command": "soldr --no-cache cargo
|
|
50
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --test cli_cargo_native_cc"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"id": "rust-wrapper-perf",
|
|
54
54
|
"gate": "hard",
|
|
55
|
-
"command": "soldr --no-cache cargo
|
|
55
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --test cli_wrapper_perf"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"id": "rust-watchdog-lint",
|
|
59
59
|
"gate": "hard",
|
|
60
|
-
"command": "soldr --no-cache cargo
|
|
60
|
+
"command": "soldr --no-cache cargo nextest run -p soldr-cli --test no_timed_test_guard"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"id": "python-setup-contracts",
|
|
@@ -321,11 +321,11 @@
|
|
|
321
321
|
"gate": "hard",
|
|
322
322
|
"covers": [
|
|
323
323
|
"zccache integration tests live outside monolithic source modules",
|
|
324
|
-
"
|
|
324
|
+
"the removed per-test watchdog does not return (timeouts belong to nextest)",
|
|
325
325
|
"embedded-runtime contract tests remain discoverable"
|
|
326
326
|
],
|
|
327
327
|
"test_files": [
|
|
328
|
-
"crates/soldr-cli/tests/
|
|
328
|
+
"crates/soldr-cli/tests/no_timed_test_guard.rs",
|
|
329
329
|
"crates/soldr-cli/tests/no_standalone_spawn_lint.rs",
|
|
330
330
|
"crates/soldr-cli/tests/zccache_trampoline_gate.rs",
|
|
331
331
|
"crates/soldr-cli/src/cargo_front_door/cache_plan.rs"
|
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -21,24 +21,15 @@ const PACKAGE_JSON = require(path.join(PACKAGE_ROOT, "package.json"));
|
|
|
21
21
|
// through the managed-download path.
|
|
22
22
|
const ARCHIVE_EXT = zccacheContract.ARCHIVE_EXT;
|
|
23
23
|
|
|
24
|
-
// soldr#2453: the Autonomous Release matrix was reduced to exactly 3
|
|
25
|
-
// published native targets. x86_64 Linux ships only the statically-linked
|
|
26
|
-
// musl binary -- it is verified statically linked before staging
|
|
27
|
-
// (release-auto.yml -> "Verify musl binary is statically linked"), so it
|
|
28
|
-
// has no dynamic loader dependency and is the universal x86_64-linux
|
|
29
|
-
// artifact, running on glibc hosts too. There is no separate gnu-linux
|
|
30
|
-
// asset in this release, so the `-gnu` / `-musl` key split that used to
|
|
31
|
-
// exist for linux-x64 is gone: any x86_64 Linux host, on either libc,
|
|
32
|
-
// resolves to the single entry keyed `linux-x64` below -- there is no
|
|
33
|
-
// glibc-version gate on this selection. arm64 Linux (gnu and musl), Intel
|
|
34
|
-
// macOS (darwin-x64), and Windows arm64 are not published in this release
|
|
35
|
-
// and are intentionally absent from this map -- platformTarget() throws a
|
|
36
|
-
// clear error for them instead of letting a lookup miss fall through to a
|
|
37
|
-
// 404 download.
|
|
38
24
|
const TARGETS = {
|
|
39
|
-
"linux-x64": { triple: "x86_64-unknown-linux-
|
|
25
|
+
"linux-x64-gnu": { triple: "x86_64-unknown-linux-gnu", binary: "soldr" },
|
|
26
|
+
"linux-x64-musl": { triple: "x86_64-unknown-linux-musl", binary: "soldr" },
|
|
27
|
+
"linux-arm64-gnu": { triple: "aarch64-unknown-linux-gnu", binary: "soldr" },
|
|
28
|
+
"linux-arm64-musl": { triple: "aarch64-unknown-linux-musl", binary: "soldr" },
|
|
29
|
+
"darwin-x64": { triple: "x86_64-apple-darwin", binary: "soldr" },
|
|
40
30
|
"darwin-arm64": { triple: "aarch64-apple-darwin", binary: "soldr" },
|
|
41
31
|
"win32-x64": { triple: "x86_64-pc-windows-msvc", binary: "soldr.exe" },
|
|
32
|
+
"win32-arm64": { triple: "aarch64-pc-windows-msvc", binary: "soldr.exe" },
|
|
42
33
|
};
|
|
43
34
|
|
|
44
35
|
// Files we expect to find at the root of every extracted release
|
|
@@ -62,13 +53,6 @@ const BUNDLED_BINARIES = zccacheContract.RELEASE_BUNDLED_BINARIES;
|
|
|
62
53
|
// Kept in lockstep with the `--max-glibc` ceiling in release-auto.yml by a
|
|
63
54
|
// check in test-npm-package.js. When the release build is fixed to link
|
|
64
55
|
// against a 2.17 baseline that ceiling drops, and this must follow it down.
|
|
65
|
-
//
|
|
66
|
-
// soldr#2453: no gnu-linux asset is published anymore (see TARGETS above),
|
|
67
|
-
// so this constant no longer selects anything in platformTarget() -- every
|
|
68
|
-
// x86_64 Linux host takes the musl asset regardless of glibc version. It is
|
|
69
|
-
// kept, unchanged, only because test-npm-package.js still asserts it stays
|
|
70
|
-
// in lockstep with the `--max-glibc` value release-auto.yml passes to
|
|
71
|
-
// verify_glibc_baseline.py, and detectLibc() below still consults it.
|
|
72
56
|
const MIN_GLIBC_FOR_GNU = "2.39";
|
|
73
57
|
|
|
74
58
|
function compareVersions(left, right) {
|
|
@@ -85,15 +69,7 @@ function compareVersions(left, right) {
|
|
|
85
69
|
return 0;
|
|
86
70
|
}
|
|
87
71
|
|
|
88
|
-
//
|
|
89
|
-
// Linux artifact to download (gnu vs musl); now that the release matrix
|
|
90
|
-
// publishes only the musl x86_64-linux asset, platformTarget() below no
|
|
91
|
-
// longer branches on the result -- every linux-x64 host takes the musl
|
|
92
|
-
// download regardless of libc. The detector itself is kept (and still
|
|
93
|
-
// covered directly by test-npm-package.js, and still consulted by
|
|
94
|
-
// MIN_GLIBC_FOR_GNU's own lockstep bookkeeping) since it remains an
|
|
95
|
-
// accurate, independently useful "what libc is this host" probe. Ordered
|
|
96
|
-
// probes:
|
|
72
|
+
// Decide which Linux artifact this host should download. Ordered probes:
|
|
97
73
|
//
|
|
98
74
|
// 1. A musl loader in /lib means the SYSTEM is musl, and that outranks
|
|
99
75
|
// whatever Node was linked against. This has to run first: a glibc Node
|
|
@@ -108,8 +84,13 @@ function compareVersions(left, right) {
|
|
|
108
84
|
// musl is the safe end of every unknown because that artifact is verified
|
|
109
85
|
// statically linked before it is ever staged (release-auto.yml → "Verify musl
|
|
110
86
|
// binary is statically linked"), so it has no dynamic loader dependency and
|
|
111
|
-
// runs on glibc hosts too.
|
|
112
|
-
//
|
|
87
|
+
// runs on glibc hosts too. The mistakes are not symmetric:
|
|
88
|
+
//
|
|
89
|
+
// pick musl, actually glibc → works, nothing to resolve
|
|
90
|
+
// pick gnu, actually musl → hard failure, "soldr: not found"
|
|
91
|
+
// pick gnu, glibc too old → hard failure, "GLIBC_2.39 not found"
|
|
92
|
+
//
|
|
93
|
+
// Only the first is recoverable.
|
|
113
94
|
//
|
|
114
95
|
// `probes` exists so the branches can be tested on any host; the defaults are
|
|
115
96
|
// the real detectors.
|
|
@@ -146,24 +127,14 @@ function detectLibc(platform = process.platform, probes = {}) {
|
|
|
146
127
|
return "musl";
|
|
147
128
|
}
|
|
148
129
|
|
|
149
|
-
// soldr#2453: the release matrix publishes exactly 3 native targets, so
|
|
150
|
-
// resolution is a flat `<platform>-<arch>` lookup -- linux no longer keys
|
|
151
|
-
// on libc because both families download the same musl asset (see TARGETS
|
|
152
|
-
// above), and there is no glibc-version gate on that download. The `libc`
|
|
153
|
-
// parameter is still accepted (and still defaults to detectLibc()) purely
|
|
154
|
-
// for call-site/back-compat with existing callers and tests; it plays no
|
|
155
|
-
// role in which target is returned.
|
|
156
130
|
function platformTarget(platform = process.platform, arch = process.arch, libc = detectLibc(platform)) {
|
|
157
|
-
|
|
158
|
-
|
|
131
|
+
const key =
|
|
132
|
+
platform === "linux"
|
|
133
|
+
? `${platform}-${arch}-${libc || "musl"}`
|
|
134
|
+
: `${platform}-${arch}`;
|
|
159
135
|
const target = TARGETS[key];
|
|
160
136
|
if (!target) {
|
|
161
|
-
throw new Error(
|
|
162
|
-
`unsupported platform for soldr npm package: ${key}. This soldr release ` +
|
|
163
|
-
"publishes prebuilt binaries only for x86_64 Linux, Apple Silicon macOS " +
|
|
164
|
-
`(arm64), and x86_64 Windows. ${key} is not currently supported by a ` +
|
|
165
|
-
"prebuilt binary.",
|
|
166
|
-
);
|
|
137
|
+
throw new Error(`unsupported platform for soldr npm package: ${key}`);
|
|
167
138
|
}
|
|
168
139
|
return target;
|
|
169
140
|
}
|
|
@@ -79,58 +79,37 @@ assert.deepStrictEqual(pkg.files, [
|
|
|
79
79
|
const bin = fs.readFileSync(path.join(root, pkg.bin.soldr), "utf8");
|
|
80
80
|
assert(bin.startsWith("#!/usr/bin/env node"), "bin/soldr.js must have a node shebang");
|
|
81
81
|
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
// Silicon macOS, and x86_64 Windows. `platformTarget` accepts an explicit
|
|
85
|
-
// `libc` arg so tests don't depend on the runtime detector, but linux-x64
|
|
86
|
-
// no longer branches on it: both libc families resolve to the same musl
|
|
87
|
-
// asset because there is no separate gnu-linux release asset, and no
|
|
88
|
-
// glibc-version gate, anymore.
|
|
82
|
+
// Linux: triple selection branches on libc. `platformTarget` accepts an
|
|
83
|
+
// explicit `libc` arg so tests don't depend on the runtime detector.
|
|
89
84
|
assert.strictEqual(
|
|
90
85
|
install.platformTarget("linux", "x64", "gnu").triple,
|
|
91
|
-
"x86_64-unknown-linux-
|
|
86
|
+
"x86_64-unknown-linux-gnu",
|
|
92
87
|
);
|
|
93
88
|
assert.strictEqual(
|
|
94
89
|
install.platformTarget("linux", "x64", "musl").triple,
|
|
95
90
|
"x86_64-unknown-linux-musl",
|
|
96
91
|
);
|
|
97
|
-
|
|
92
|
+
assert.strictEqual(
|
|
93
|
+
install.platformTarget("linux", "arm64", "gnu").triple,
|
|
94
|
+
"aarch64-unknown-linux-gnu",
|
|
95
|
+
);
|
|
96
|
+
assert.strictEqual(
|
|
97
|
+
install.platformTarget("linux", "arm64", "musl").triple,
|
|
98
|
+
"aarch64-unknown-linux-musl",
|
|
99
|
+
);
|
|
100
|
+
// Default (no libc arg) falls back to detectLibc; on most CI hosts that's
|
|
101
|
+
// gnu. We don't assert the triple here — just that the call resolves.
|
|
102
|
+
assert.ok(install.platformTarget("linux", "x64").triple.startsWith("x86_64-unknown-linux-"));
|
|
103
|
+
// An explicitly-unknown libc must take the runs-anywhere build, matching
|
|
104
|
+
// detectLibc's own unknown case rather than contradicting it.
|
|
98
105
|
assert.strictEqual(
|
|
99
106
|
install.platformTarget("linux", "x64", null).triple,
|
|
100
107
|
"x86_64-unknown-linux-musl",
|
|
101
108
|
);
|
|
102
|
-
|
|
103
|
-
// resolves to the musl asset.
|
|
104
|
-
assert.strictEqual(install.platformTarget("linux", "x64").triple, "x86_64-unknown-linux-musl");
|
|
105
|
-
|
|
106
|
-
// arm64 Linux has no published asset in this release, for either libc
|
|
107
|
-
// family -- must throw a clear, actionable error rather than attempt a
|
|
108
|
-
// download that 404s.
|
|
109
|
-
assert.throws(
|
|
110
|
-
() => install.platformTarget("linux", "arm64", "gnu"),
|
|
111
|
-
/unsupported platform/,
|
|
112
|
-
"linux-arm64 (gnu) has no published asset and must throw",
|
|
113
|
-
);
|
|
114
|
-
assert.throws(
|
|
115
|
-
() => install.platformTarget("linux", "arm64", "musl"),
|
|
116
|
-
/unsupported platform/,
|
|
117
|
-
"linux-arm64 (musl) has no published asset and must throw",
|
|
118
|
-
);
|
|
119
|
-
|
|
109
|
+
assert.strictEqual(install.platformTarget("darwin", "x64").triple, "x86_64-apple-darwin");
|
|
120
110
|
assert.strictEqual(install.platformTarget("darwin", "arm64").triple, "aarch64-apple-darwin");
|
|
121
111
|
assert.strictEqual(install.platformTarget("win32", "x64").triple, "x86_64-pc-windows-msvc");
|
|
122
|
-
|
|
123
|
-
// Intel macOS and Windows arm64 have no published asset in this release.
|
|
124
|
-
assert.throws(
|
|
125
|
-
() => install.platformTarget("darwin", "x64"),
|
|
126
|
-
/unsupported platform/,
|
|
127
|
-
"darwin-x64 (Intel mac) has no published asset and must throw",
|
|
128
|
-
);
|
|
129
|
-
assert.throws(
|
|
130
|
-
() => install.platformTarget("win32", "arm64"),
|
|
131
|
-
/unsupported platform/,
|
|
132
|
-
"win32-arm64 has no published asset and must throw",
|
|
133
|
-
);
|
|
112
|
+
assert.strictEqual(install.platformTarget("win32", "arm64").triple, "aarch64-pc-windows-msvc");
|
|
134
113
|
assert.throws(() => install.platformTarget("freebsd", "x64"), /unsupported platform/);
|
|
135
114
|
|
|
136
115
|
// detectLibc must return null on non-Linux platforms so the platform key
|