@zackees/soldr 0.7.41 → 0.7.43

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/bin/soldr.js CHANGED
@@ -55,6 +55,19 @@ if (
55
55
  childEnv[crgxLocalDirEnv] = nativeDir;
56
56
  }
57
57
 
58
+ // Same wiring for bundled cargo-chef. `soldr cook` invokes
59
+ // `soldr cargo chef ...`, whose resolver checks
60
+ // SOLDR_CARGO_CHEF_LOCAL_DIR before GitHub Releases. This avoids a
61
+ // live upstream lookup on targets cargo-chef does not publish, such as
62
+ // macOS arm64.
63
+ const cargoChefLocalDirEnv = zccacheContract.CONTRACT.cargo_chef.local_dir_env;
64
+ if (
65
+ !childEnv[cargoChefLocalDirEnv] &&
66
+ fs.existsSync(path.join(nativeDir, `${zccacheContract.CARGO_CHEF_BUNDLED_BINARY}${exeExt}`))
67
+ ) {
68
+ childEnv[cargoChefLocalDirEnv] = nativeDir;
69
+ }
70
+
58
71
  const child = childProcess.spawn(binaryPath, process.argv.slice(2), {
59
72
  stdio: "inherit",
60
73
  env: childEnv,
@@ -5,14 +5,15 @@
5
5
  "extension": "tar.zst",
6
6
  "compression_level": 19,
7
7
  "manifest_name": "manifest.json",
8
- "manifest_min_schema_version": 2,
8
+ "manifest_min_schema_version": 3,
9
9
  "sha256_algorithm": "sha256",
10
10
  "required_binaries": [
11
11
  "soldr",
12
12
  "zccache",
13
13
  "zccache-daemon",
14
14
  "zccache-fp",
15
- "crgx"
15
+ "crgx",
16
+ "cargo-chef"
16
17
  ],
17
18
  "linux_zccache_target_libc": "musl"
18
19
  },
@@ -35,6 +36,14 @@
35
36
  ],
36
37
  "manifest_block": "crgx"
37
38
  },
39
+ "cargo_chef": {
40
+ "managed_version": "0.1.73",
41
+ "local_dir_env": "SOLDR_CARGO_CHEF_LOCAL_DIR",
42
+ "required_binaries": [
43
+ "cargo-chef"
44
+ ],
45
+ "manifest_block": "cargo_chef"
46
+ },
38
47
  "setup_action": {
39
48
  "cache_root_env": "SOLDR_CACHE_DIR",
40
49
  "native_cache_env": "SOLDR_NATIVE_CACHE",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zackees/soldr",
3
- "version": "0.7.41",
3
+ "version": "0.7.43",
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",
@@ -15,8 +15,9 @@ 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
17
  // alongside its matching-target zccache trio (zccache, zccache-daemon,
18
- // zccache-fp) and a same-target crgx. One fetch installs everything,
19
- // and `bin/soldr.js` wires SOLDR_ZCCACHE_LOCAL_DIR + SOLDR_CRGX_LOCAL_DIR
18
+ // zccache-fp), same-target crgx, and same-target cargo-chef. One fetch
19
+ // installs everything, and `bin/soldr.js` wires SOLDR_ZCCACHE_LOCAL_DIR,
20
+ // SOLDR_CRGX_LOCAL_DIR, and SOLDR_CARGO_CHEF_LOCAL_DIR
20
21
  // to the install dir so soldr's runtime resolver finds the sibling binaries
21
22
  // without going through the managed-download path.
22
23
  const ARCHIVE_EXT = zccacheContract.ARCHIVE_EXT;
@@ -35,7 +36,8 @@ const TARGETS = {
35
36
  // Files we expect to find at the root of every extracted release
36
37
  // archive. Names line up with what `release-auto.yml`'s
37
38
  // `Fetch matched zccache release`, `Stage soldr binary`, and
38
- // `Build crgx from pinned source` steps drop into `dist/package/`
39
+ // `Build crgx from pinned source`, and `Build cargo-chef from pinned
40
+ // source` steps drop into `dist/package/`
39
41
  // before the tar.zst is built. `.exe` suffix is appended at install
40
42
  // time based on `target.binary`.
41
43
  const BUNDLED_BINARIES = zccacheContract.RELEASE_BUNDLED_BINARIES;
@@ -249,10 +251,10 @@ async function install() {
249
251
  fs.mkdirSync(nativeDir, { recursive: true });
250
252
 
251
253
  // Copy every bundled binary so soldr's runtime resolver can find
252
- // its sibling zccache via SOLDR_ZCCACHE_LOCAL_DIR and crgx via
253
- // SOLDR_CRGX_LOCAL_DIR (both wired up by `bin/soldr.js` before
254
- // exec). The archive layout is flat all five binaries live at
255
- // the archive root.
254
+ // its sibling zccache via SOLDR_ZCCACHE_LOCAL_DIR, crgx via
255
+ // SOLDR_CRGX_LOCAL_DIR, and cargo-chef via SOLDR_CARGO_CHEF_LOCAL_DIR.
256
+ // `bin/soldr.js` wires these env vars before exec. The archive
257
+ // layout is flat: all bundled binaries live at the archive root.
256
258
  const binaryExt = target.binary.endsWith(".exe") ? ".exe" : "";
257
259
  const manifestSrc = findExtractedBinary(extractDir, zccacheContract.MANIFEST_NAME);
258
260
  if (!manifestSrc) {
@@ -289,7 +291,7 @@ async function install() {
289
291
  fs.copyFileSync(manifestSrc, path.join(nativeDir, zccacheContract.MANIFEST_NAME));
290
292
 
291
293
  console.log(
292
- `soldr: installed ${target.triple} (soldr + zccache trio + crgx) into ${nativeDir}`,
294
+ `soldr: installed ${target.triple} (soldr + zccache trio + crgx + cargo-chef) into ${nativeDir}`,
293
295
  );
294
296
  } finally {
295
297
  fs.rmSync(tmp, { recursive: true, force: true });
@@ -133,6 +133,8 @@ assert.deepStrictEqual(zccacheContract.ZCCACHE_BUNDLED_BINARIES, [
133
133
  "zccache-daemon",
134
134
  "zccache-fp",
135
135
  ]);
136
+ assert.strictEqual(zccacheContract.CRGX_BUNDLED_BINARY, "crgx");
137
+ assert.strictEqual(zccacheContract.CARGO_CHEF_BUNDLED_BINARY, "cargo-chef");
136
138
  assert.ok(
137
139
  fs.existsSync(path.join(root, "contracts", "zccache-integration-guardrails.v1.json")),
138
140
  "npm package must include the zccache integration guardrail contract",
@@ -157,7 +159,7 @@ for (const [key, target] of Object.entries(install.TARGETS || {})) {
157
159
  );
158
160
  }
159
161
 
160
- // BUNDLED_BINARIES must include soldr, the zccache trio, and crgx.
162
+ // BUNDLED_BINARIES must include soldr, the zccache trio, crgx, and cargo-chef.
161
163
  // Locks the per-archive layout contract so a future bundling
162
164
  // refactor can't quietly drop a binary.
163
165
  assert.ok(
@@ -170,6 +172,7 @@ for (const required of [
170
172
  "zccache-daemon",
171
173
  "zccache-fp",
172
174
  "crgx",
175
+ "cargo-chef",
173
176
  ]) {
174
177
  assert.ok(
175
178
  install.BUNDLED_BINARIES.includes(required),
@@ -15,6 +15,7 @@ const MANIFEST_MIN_SCHEMA_VERSION = CONTRACT.release_archive.manifest_min_schema
15
15
  const RELEASE_BUNDLED_BINARIES = Object.freeze([...CONTRACT.release_archive.required_binaries]);
16
16
  const ZCCACHE_BUNDLED_BINARIES = Object.freeze([...CONTRACT.zccache.required_binaries]);
17
17
  const CRGX_BUNDLED_BINARY = CONTRACT.crgx.required_binaries[0];
18
+ const CARGO_CHEF_BUNDLED_BINARY = CONTRACT.cargo_chef.required_binaries[0];
18
19
 
19
20
  function binaryName(baseName, platform = process.platform) {
20
21
  return `${baseName}${platform === "win32" ? ".exe" : ""}`;
@@ -50,6 +51,9 @@ function collectManifestBinaries(manifest) {
50
51
  if (manifest.crgx && manifest.crgx.binary && manifest.crgx.sha256) {
51
52
  binaries.set(manifest.crgx.binary, manifest.crgx.sha256);
52
53
  }
54
+ if (manifest.cargo_chef && manifest.cargo_chef.binary && manifest.cargo_chef.sha256) {
55
+ binaries.set(manifest.cargo_chef.binary, manifest.cargo_chef.sha256);
56
+ }
53
57
  return binaries;
54
58
  }
55
59
 
@@ -71,6 +75,9 @@ function validateReleaseManifest(manifest, options) {
71
75
  if (!manifest.crgx || manifest.crgx.target !== soldrTarget) {
72
76
  throw new Error(`release manifest crgx.target must be ${soldrTarget}`);
73
77
  }
78
+ if (!manifest.cargo_chef || manifest.cargo_chef.target !== soldrTarget) {
79
+ throw new Error(`release manifest cargo_chef.target must be ${soldrTarget}`);
80
+ }
74
81
 
75
82
  const expectedNames = releaseBinaryNames(platform);
76
83
  const manifestBinaries = collectManifestBinaries(manifest);
@@ -94,6 +101,7 @@ module.exports = {
94
101
  ARCHIVE_EXT,
95
102
  CONTRACT,
96
103
  CONTRACT_PATH,
104
+ CARGO_CHEF_BUNDLED_BINARY,
97
105
  CRGX_BUNDLED_BINARY,
98
106
  MANIFEST_NAME,
99
107
  RELEASE_BUNDLED_BINARIES,