@zackees/soldr 0.7.103 → 0.8.0
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 +4 -2
- package/bin/soldr.js +0 -17
- package/contracts/zccache-integration-guardrails.v1.json +3 -4
- package/contracts/zccache-runtime.v1.json +4 -1
- package/package.json +1 -1
- package/scripts/install.js +11 -13
- package/scripts/test-npm-package.js +12 -7
- package/scripts/zccache-contract.js +16 -5
package/README.md
CHANGED
|
@@ -128,7 +128,9 @@ soldr cargo build --target aarch64-pc-windows-msvc
|
|
|
128
128
|
|
|
129
129
|
The canonical multi-platform GitHub Actions tutorial lives in [`zackees/setup-soldr#90`](https://github.com/zackees/setup-soldr/issues/90).
|
|
130
130
|
|
|
131
|
-
For Linux → Windows cross-compilation (GNU via `cargo-zigbuild`, MSVC via
|
|
131
|
+
For Linux → Windows cross-compilation (GNU via `cargo-zigbuild`, MSVC via
|
|
132
|
+
`cargo-xwin`) and explicit Windows x64 GNU builds via managed MinGW-w64 GCC,
|
|
133
|
+
see [docs/CROSS_COMPILE.md](./docs/CROSS_COMPILE.md).
|
|
132
134
|
|
|
133
135
|
### CI cache lineage
|
|
134
136
|
|
|
@@ -329,7 +331,7 @@ If you also have many separate test binaries, consider consolidating them under
|
|
|
329
331
|
- **Pre-built first**: Download a pre-built binary before compiling from source. Fall back gracefully.
|
|
330
332
|
- **Cargo-compatible**: soldr preserves normal cargo arguments instead of forcing a separate workflow.
|
|
331
333
|
- **Cross-platform**: Linux, macOS, Windows (x86_64 + aarch64).
|
|
332
|
-
- **MSVC by default on Windows**: Always targets `x86_64-pc-windows-msvc` (or `aarch64-pc-windows-msvc`) unless the active project explicitly selects another target in `.cargo/config.toml`, `.cargo/config`, or `rust-toolchain.toml`. MSVC links against `vcruntime140.dll` which ships with every modern Windows install. The GNU target requires shipping `libgcc_s_seh-1.dll` and `libwinpthread-1.dll` with every binary, which is extra baggage for
|
|
334
|
+
- **MSVC by default on Windows**: Always targets `x86_64-pc-windows-msvc` (or `aarch64-pc-windows-msvc`) unless the active project explicitly selects another target in `.cargo/config.toml`, `.cargo/config`, or `rust-toolchain.toml`. MSVC links against `vcruntime140.dll` which ships with every modern Windows install. The GNU target requires shipping `libgcc_s_seh-1.dll` and `libwinpthread-1.dll` with every binary, which is extra baggage for most projects; when a project explicitly needs `x86_64-pc-windows-gnu`, `soldr prepare --target x86_64-pc-windows-gnu` provisions managed MinGW-w64 GCC on Windows x64. This matches the Rust ecosystem default: rustup, cargo-binstall, and nearly all published release binaries target MSVC. crgx gets this wrong by baking the target at compile time, causing it to look for GNU binaries when compiled under MSYS2.
|
|
333
335
|
|
|
334
336
|
## Architecture
|
|
335
337
|
|
package/bin/soldr.js
CHANGED
|
@@ -21,25 +21,8 @@ if (!fs.existsSync(binaryPath)) {
|
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// Wire the bundled zccache trio (zccache, zccache-daemon, zccache-fp,
|
|
25
|
-
// shipped alongside soldr in `bin/native/` since the combined-archive
|
|
26
|
-
// release format landed) into soldr's local-zccache resolution path.
|
|
27
|
-
// Soldr's ZccacheResolver checks SOLDR_ZCCACHE_LOCAL_DIR ahead of the
|
|
28
|
-
// pinned and managed-download chain, so this turns the bundled
|
|
29
|
-
// binaries into the active zccache automatically — no manual env
|
|
30
|
-
// setup, no managed fetch over the network. Users who explicitly set
|
|
31
|
-
// the env var themselves keep their override.
|
|
32
24
|
const exeExt = process.platform === "win32" ? ".exe" : "";
|
|
33
25
|
const childEnv = { ...process.env };
|
|
34
|
-
const zccacheLocalDirEnv = zccacheContract.CONTRACT.zccache.local_dir_env;
|
|
35
|
-
if (
|
|
36
|
-
!childEnv[zccacheLocalDirEnv] &&
|
|
37
|
-
zccacheContract.ZCCACHE_BUNDLED_BINARIES.every((baseName) =>
|
|
38
|
-
fs.existsSync(path.join(nativeDir, `${baseName}${exeExt}`)),
|
|
39
|
-
)
|
|
40
|
-
) {
|
|
41
|
-
childEnv[zccacheLocalDirEnv] = nativeDir;
|
|
42
|
-
}
|
|
43
26
|
|
|
44
27
|
// Same wiring for the bundled crgx binary (shipped alongside soldr
|
|
45
28
|
// since the crgx-bundling follow-up to the combined-archive release
|
|
@@ -77,9 +77,8 @@
|
|
|
77
77
|
"gate": "hard",
|
|
78
78
|
"covers": [
|
|
79
79
|
"SOLDR_TEST_ZCCACHE_BIN override",
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"managed cached/runtime fallback",
|
|
80
|
+
"embedded soldr/soldr-daemon runtime",
|
|
81
|
+
"managed cache directory selection",
|
|
83
82
|
"system fallback diagnostics"
|
|
84
83
|
],
|
|
85
84
|
"test_files": [
|
|
@@ -221,7 +220,7 @@
|
|
|
221
220
|
"gate": "hard",
|
|
222
221
|
"covers": [
|
|
223
222
|
"release archive manifest",
|
|
224
|
-
"zccache
|
|
223
|
+
"embedded zccache runtime",
|
|
225
224
|
"crgx binary",
|
|
226
225
|
"setup-soldr manifest validation",
|
|
227
226
|
"npm bundled contract files"
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"sha256_algorithm": "sha256",
|
|
10
10
|
"required_binaries": [
|
|
11
11
|
"soldr",
|
|
12
|
+
"soldr-daemon",
|
|
13
|
+
"soldr-shim",
|
|
14
|
+
"soldr-clang-shim",
|
|
12
15
|
"crgx",
|
|
13
16
|
"cargo-chef"
|
|
14
17
|
],
|
|
@@ -16,7 +19,7 @@
|
|
|
16
19
|
},
|
|
17
20
|
"zccache": {
|
|
18
21
|
"embedded": true,
|
|
19
|
-
"note": "zccache
|
|
22
|
+
"note": "zccache is embedded into soldr/soldr-daemon (soldr#1368); no standalone zccache binaries are bundled or downloaded.",
|
|
20
23
|
"cache_dir_env": "ZCCACHE_CACHE_DIR"
|
|
21
24
|
},
|
|
22
25
|
"crgx": {
|
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -14,12 +14,11 @@ const PACKAGE_ROOT = path.resolve(__dirname, "..");
|
|
|
14
14
|
const PACKAGE_JSON = require(path.join(PACKAGE_ROOT, "package.json"));
|
|
15
15
|
|
|
16
16
|
// Every release ships a single .tar.zst per target that bundles soldr
|
|
17
|
-
// alongside
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// without going through the managed-download path.
|
|
17
|
+
// alongside soldr-owned sidecars, same-target crgx, and same-target
|
|
18
|
+
// cargo-chef. One fetch installs everything, and `bin/soldr.js` wires
|
|
19
|
+
// SOLDR_CRGX_LOCAL_DIR and SOLDR_CARGO_CHEF_LOCAL_DIR to the install dir
|
|
20
|
+
// so soldr's runtime resolver finds those bundled tools without going
|
|
21
|
+
// through the managed-download path.
|
|
23
22
|
const ARCHIVE_EXT = zccacheContract.ARCHIVE_EXT;
|
|
24
23
|
|
|
25
24
|
const TARGETS = {
|
|
@@ -35,9 +34,8 @@ const TARGETS = {
|
|
|
35
34
|
|
|
36
35
|
// Files we expect to find at the root of every extracted release
|
|
37
36
|
// archive. Names line up with what `release-auto.yml`'s
|
|
38
|
-
// `
|
|
39
|
-
// `Build
|
|
40
|
-
// source` steps drop into `dist/package/`
|
|
37
|
+
// `Stage soldr release binaries`, `Build crgx from pinned source`, and
|
|
38
|
+
// `Build cargo-chef from pinned source` steps drop into `dist/package/`
|
|
41
39
|
// before the tar.zst is built. `.exe` suffix is appended at install
|
|
42
40
|
// time based on `target.binary`.
|
|
43
41
|
const BUNDLED_BINARIES = zccacheContract.RELEASE_BUNDLED_BINARIES;
|
|
@@ -250,9 +248,9 @@ async function install() {
|
|
|
250
248
|
fs.rmSync(nativeDir, { recursive: true, force: true });
|
|
251
249
|
fs.mkdirSync(nativeDir, { recursive: true });
|
|
252
250
|
|
|
253
|
-
// Copy every bundled binary so soldr
|
|
254
|
-
//
|
|
255
|
-
//
|
|
251
|
+
// Copy every bundled binary so soldr has its sidecars and can find
|
|
252
|
+
// crgx via SOLDR_CRGX_LOCAL_DIR and cargo-chef via
|
|
253
|
+
// SOLDR_CARGO_CHEF_LOCAL_DIR.
|
|
256
254
|
// `bin/soldr.js` wires these env vars before exec. The archive
|
|
257
255
|
// layout is flat: all bundled binaries live at the archive root.
|
|
258
256
|
const binaryExt = target.binary.endsWith(".exe") ? ".exe" : "";
|
|
@@ -298,7 +296,7 @@ async function install() {
|
|
|
298
296
|
fs.copyFileSync(manifestSrc, path.join(nativeDir, zccacheContract.MANIFEST_NAME));
|
|
299
297
|
|
|
300
298
|
console.log(
|
|
301
|
-
`soldr: installed ${target.triple} (soldr +
|
|
299
|
+
`soldr: installed ${target.triple} (soldr + sidecars + crgx + cargo-chef) into ${nativeDir}`,
|
|
302
300
|
);
|
|
303
301
|
} finally {
|
|
304
302
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
@@ -128,8 +128,8 @@ assert.deepStrictEqual(
|
|
|
128
128
|
install.BUNDLED_BINARIES,
|
|
129
129
|
zccacheContract.RELEASE_BUNDLED_BINARIES,
|
|
130
130
|
);
|
|
131
|
-
// zccache is
|
|
132
|
-
//
|
|
131
|
+
// zccache is embedded into soldr/soldr-daemon; no standalone zccache
|
|
132
|
+
// binaries are bundled or downloaded.
|
|
133
133
|
assert.deepStrictEqual(zccacheContract.ZCCACHE_BUNDLED_BINARIES, []);
|
|
134
134
|
assert.strictEqual(zccacheContract.CRGX_BUNDLED_BINARY, "crgx");
|
|
135
135
|
assert.strictEqual(zccacheContract.CARGO_CHEF_BUNDLED_BINARY, "cargo-chef");
|
|
@@ -165,15 +165,20 @@ for (const [key, target] of Object.entries(install.TARGETS || {})) {
|
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
// BUNDLED_BINARIES must include soldr, crgx, and
|
|
169
|
-
//
|
|
170
|
-
// bundled. Locks the per-archive layout contract so a future bundling
|
|
171
|
-
// refactor can't quietly drop a binary.
|
|
168
|
+
// BUNDLED_BINARIES must include soldr, soldr-owned sidecars, crgx, and
|
|
169
|
+
// cargo-chef. It must not require standalone zccache binaries.
|
|
172
170
|
assert.ok(
|
|
173
171
|
Array.isArray(install.BUNDLED_BINARIES),
|
|
174
172
|
"install.BUNDLED_BINARIES must be exported as an array",
|
|
175
173
|
);
|
|
176
|
-
for (const required of [
|
|
174
|
+
for (const required of [
|
|
175
|
+
"soldr",
|
|
176
|
+
"soldr-daemon",
|
|
177
|
+
"soldr-shim",
|
|
178
|
+
"soldr-clang-shim",
|
|
179
|
+
"crgx",
|
|
180
|
+
"cargo-chef",
|
|
181
|
+
]) {
|
|
177
182
|
assert.ok(
|
|
178
183
|
install.BUNDLED_BINARIES.includes(required),
|
|
179
184
|
`BUNDLED_BINARIES must include "${required}" (got ${JSON.stringify(install.BUNDLED_BINARIES)})`,
|
|
@@ -13,10 +13,10 @@ const ARCHIVE_EXT = CONTRACT.release_archive.extension;
|
|
|
13
13
|
const MANIFEST_NAME = CONTRACT.release_archive.manifest_name;
|
|
14
14
|
const MANIFEST_MIN_SCHEMA_VERSION = CONTRACT.release_archive.manifest_min_schema_version;
|
|
15
15
|
const RELEASE_BUNDLED_BINARIES = Object.freeze([...CONTRACT.release_archive.required_binaries]);
|
|
16
|
-
// zccache is
|
|
17
|
-
// binaries are bundled or downloaded
|
|
16
|
+
// zccache is embedded into soldr/soldr-daemon; no standalone zccache
|
|
17
|
+
// binaries are bundled or downloaded.
|
|
18
18
|
const ZCCACHE_BUNDLED_BINARIES = Object.freeze([
|
|
19
|
-
...(CONTRACT.zccache.required_binaries || []),
|
|
19
|
+
...((CONTRACT.zccache && CONTRACT.zccache.required_binaries) || []),
|
|
20
20
|
]);
|
|
21
21
|
const CRGX_BUNDLED_BINARY = CONTRACT.crgx.required_binaries[0];
|
|
22
22
|
const CARGO_CHEF_BUNDLED_BINARY = CONTRACT.cargo_chef.required_binaries[0];
|
|
@@ -30,6 +30,9 @@ function releaseBinaryNames(platform = process.platform) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function zccacheTargetForSoldrTarget(soldrTarget) {
|
|
33
|
+
if (CONTRACT.zccache && CONTRACT.zccache.embedded === true) {
|
|
34
|
+
return soldrTarget;
|
|
35
|
+
}
|
|
33
36
|
if (!soldrTarget.includes("-unknown-linux-")) {
|
|
34
37
|
return soldrTarget;
|
|
35
38
|
}
|
|
@@ -46,6 +49,12 @@ function collectManifestBinaries(manifest) {
|
|
|
46
49
|
if (manifest.soldr && manifest.soldr.binary && manifest.soldr.sha256) {
|
|
47
50
|
binaries.set(manifest.soldr.binary, manifest.soldr.sha256);
|
|
48
51
|
}
|
|
52
|
+
const soldrSidecars = (manifest.soldr && manifest.soldr.sidecars) || [];
|
|
53
|
+
for (const entry of soldrSidecars) {
|
|
54
|
+
if (entry && entry.name && entry.sha256) {
|
|
55
|
+
binaries.set(entry.name, entry.sha256);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
49
58
|
const zccacheBinaries = (manifest.zccache && manifest.zccache.binaries) || [];
|
|
50
59
|
for (const entry of zccacheBinaries) {
|
|
51
60
|
if (entry && entry.name && entry.sha256) {
|
|
@@ -79,8 +88,10 @@ function validateReleaseManifest(manifest, options) {
|
|
|
79
88
|
if (!manifest.soldr || manifest.soldr.target !== soldrTarget) {
|
|
80
89
|
throw new Error(`release manifest soldr.target must be ${soldrTarget}`);
|
|
81
90
|
}
|
|
82
|
-
|
|
83
|
-
|
|
91
|
+
const expectedZccacheTarget = zccacheTargetForSoldrTarget(soldrTarget);
|
|
92
|
+
if (!manifest.zccache || manifest.zccache.target !== expectedZccacheTarget) {
|
|
93
|
+
throw new Error(`release manifest zccache.target must be ${expectedZccacheTarget}`);
|
|
94
|
+
}
|
|
84
95
|
if (!manifest.crgx || manifest.crgx.target !== soldrTarget) {
|
|
85
96
|
throw new Error(`release manifest crgx.target must be ${soldrTarget}`);
|
|
86
97
|
}
|