@limrun/api 0.31.2 → 0.31.4

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/rbe-bep.d.mts CHANGED
@@ -8,9 +8,14 @@
8
8
  * downloads the bytes (`--remote_download_outputs`), because the URI names the
9
9
  * output's CAS identity, not its local availability. `lim xcode rbe install`
10
10
  * reads that digest and hands it to the instance, which fetches the blob from
11
- * its own RBE cache and installs it — no round-trip. The printed build command
12
- * passes `--remote_download_outputs=minimal` to skip the (unneeded) local
13
- * download by default; dropping it does not affect this parser.
11
+ * its own RBE cache and installs it — no round-trip. The generated bazelrc sets
12
+ * `--remote_download_outputs=minimal` to skip the (unneeded) local download by
13
+ * default; overriding it (e.g. `--remote_download_outputs=toplevel` on the command
14
+ * line) to materialize the .ipa locally does not affect this parser.
15
+ *
16
+ * A fully-cached rebuild (0 actions executed) still emits the bytestream URI and
17
+ * reproduces the same digest, so the auto-install watcher can rely on this parser
18
+ * after a no-op or revert (e.g. `git stash`) rebuild. Verified empirically.
14
19
  */
15
20
  export type BepIpaDigest = {
16
21
  /** Lowercase hex SHA-256 of the .ipa blob. */
@@ -20,9 +25,51 @@ export type BepIpaDigest = {
20
25
  /** The .ipa file name as Bazel reported it (e.g. "App/App.ipa"). */
21
26
  ipaName: string;
22
27
  };
28
+ /**
29
+ * Why a BEP could not yield an .ipa digest for a label.
30
+ *
31
+ * `terminal` failures will not resolve by re-reading the same completed BEP
32
+ * (the build used the wrong flags); `no-build` / `no-output` / `no-ipa` are
33
+ * transient while the build is still flushing and become terminal only once
34
+ * the build is confirmed complete. The watcher uses this to decide whether to
35
+ * retry the read or to log-once and give up.
36
+ */
37
+ export type RbeBepErrorKind = 'no-build' | 'no-output' | 'no-ipa' | 'local-only' | 'non-sha256';
38
+ export declare class RbeBepError extends Error {
39
+ readonly kind: RbeBepErrorKind;
40
+ constructor(kind: RbeBepErrorKind, message: string);
41
+ /**
42
+ * True when re-reading the same (completed) BEP cannot help — the build was
43
+ * produced with flags the instance cache can't use (local download or a
44
+ * non-SHA256 digest). The watcher logs these once instead of retrying.
45
+ */
46
+ get terminal(): boolean;
47
+ }
48
+ export type BepCompletion = {
49
+ /**
50
+ * True once Bazel has flushed the terminal event (`lastMessage`), so every
51
+ * earlier event — including the .ipa's namedSetOfFiles — is durably on disk.
52
+ * Gate the digest read on this, NOT on the presence of `buildFinished`:
53
+ * `buildFinished` is followed by `buildToolLogs` and `buildMetrics`
54
+ * (the `lastMessage` carrier), so it is not the last line.
55
+ */
56
+ complete: boolean;
57
+ /** Whether the build itself succeeded (overallSuccess / exit code 0). */
58
+ success: boolean;
59
+ /** Bazel's invocation UUID — distinguishes one build from the next. */
60
+ invocationId?: string;
61
+ };
62
+ /**
63
+ * Inspects a BEP stream for build completion. The watcher reads the BEP on every
64
+ * change but only acts once `complete` is true (the stream is fully flushed) and
65
+ * `success` is true (the build did not fail). `invocationId` lets the watcher act
66
+ * once per build even when consecutive builds reproduce the same .ipa digest
67
+ * (e.g. a `git stash` revert that rebuilds to an earlier digest).
68
+ */
69
+ export declare function inspectBuildCompletion(bepJson: string): BepCompletion;
23
70
  /**
24
71
  * Finds the `.ipa` produced for `label` in a BEP stream and returns its CAS
25
- * digest. Throws a descriptive Error when the target/.ipa is absent, its output
72
+ * digest. Throws a typed RbeBepError when the target/.ipa is absent, its output
26
73
  * was materialized locally (a `file://` URI) instead of left in CAS, or it was
27
74
  * built with a non-SHA256 digest the instance cache cannot resolve.
28
75
  */
package/rbe-bep.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rbe-bep.d.mts","sourceRoot":"","sources":["src/rbe-bep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA8CF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAmFnF"}
1
+ {"version":3,"file":"rbe-bep.d.mts","sourceRoot":"","sources":["src/rbe-bep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsBF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC;AAEhG,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;gBACnB,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;IAMlD;;;;OAIG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACF;AA8DD,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAsBrE;AAsFD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAiBnF"}
package/rbe-bep.d.ts CHANGED
@@ -8,9 +8,14 @@
8
8
  * downloads the bytes (`--remote_download_outputs`), because the URI names the
9
9
  * output's CAS identity, not its local availability. `lim xcode rbe install`
10
10
  * reads that digest and hands it to the instance, which fetches the blob from
11
- * its own RBE cache and installs it — no round-trip. The printed build command
12
- * passes `--remote_download_outputs=minimal` to skip the (unneeded) local
13
- * download by default; dropping it does not affect this parser.
11
+ * its own RBE cache and installs it — no round-trip. The generated bazelrc sets
12
+ * `--remote_download_outputs=minimal` to skip the (unneeded) local download by
13
+ * default; overriding it (e.g. `--remote_download_outputs=toplevel` on the command
14
+ * line) to materialize the .ipa locally does not affect this parser.
15
+ *
16
+ * A fully-cached rebuild (0 actions executed) still emits the bytestream URI and
17
+ * reproduces the same digest, so the auto-install watcher can rely on this parser
18
+ * after a no-op or revert (e.g. `git stash`) rebuild. Verified empirically.
14
19
  */
15
20
  export type BepIpaDigest = {
16
21
  /** Lowercase hex SHA-256 of the .ipa blob. */
@@ -20,9 +25,51 @@ export type BepIpaDigest = {
20
25
  /** The .ipa file name as Bazel reported it (e.g. "App/App.ipa"). */
21
26
  ipaName: string;
22
27
  };
28
+ /**
29
+ * Why a BEP could not yield an .ipa digest for a label.
30
+ *
31
+ * `terminal` failures will not resolve by re-reading the same completed BEP
32
+ * (the build used the wrong flags); `no-build` / `no-output` / `no-ipa` are
33
+ * transient while the build is still flushing and become terminal only once
34
+ * the build is confirmed complete. The watcher uses this to decide whether to
35
+ * retry the read or to log-once and give up.
36
+ */
37
+ export type RbeBepErrorKind = 'no-build' | 'no-output' | 'no-ipa' | 'local-only' | 'non-sha256';
38
+ export declare class RbeBepError extends Error {
39
+ readonly kind: RbeBepErrorKind;
40
+ constructor(kind: RbeBepErrorKind, message: string);
41
+ /**
42
+ * True when re-reading the same (completed) BEP cannot help — the build was
43
+ * produced with flags the instance cache can't use (local download or a
44
+ * non-SHA256 digest). The watcher logs these once instead of retrying.
45
+ */
46
+ get terminal(): boolean;
47
+ }
48
+ export type BepCompletion = {
49
+ /**
50
+ * True once Bazel has flushed the terminal event (`lastMessage`), so every
51
+ * earlier event — including the .ipa's namedSetOfFiles — is durably on disk.
52
+ * Gate the digest read on this, NOT on the presence of `buildFinished`:
53
+ * `buildFinished` is followed by `buildToolLogs` and `buildMetrics`
54
+ * (the `lastMessage` carrier), so it is not the last line.
55
+ */
56
+ complete: boolean;
57
+ /** Whether the build itself succeeded (overallSuccess / exit code 0). */
58
+ success: boolean;
59
+ /** Bazel's invocation UUID — distinguishes one build from the next. */
60
+ invocationId?: string;
61
+ };
62
+ /**
63
+ * Inspects a BEP stream for build completion. The watcher reads the BEP on every
64
+ * change but only acts once `complete` is true (the stream is fully flushed) and
65
+ * `success` is true (the build did not fail). `invocationId` lets the watcher act
66
+ * once per build even when consecutive builds reproduce the same .ipa digest
67
+ * (e.g. a `git stash` revert that rebuilds to an earlier digest).
68
+ */
69
+ export declare function inspectBuildCompletion(bepJson: string): BepCompletion;
23
70
  /**
24
71
  * Finds the `.ipa` produced for `label` in a BEP stream and returns its CAS
25
- * digest. Throws a descriptive Error when the target/.ipa is absent, its output
72
+ * digest. Throws a typed RbeBepError when the target/.ipa is absent, its output
26
73
  * was materialized locally (a `file://` URI) instead of left in CAS, or it was
27
74
  * built with a non-SHA256 digest the instance cache cannot resolve.
28
75
  */
package/rbe-bep.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rbe-bep.d.ts","sourceRoot":"","sources":["src/rbe-bep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA8CF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAmFnF"}
1
+ {"version":3,"file":"rbe-bep.d.ts","sourceRoot":"","sources":["src/rbe-bep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsBF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC;AAEhG,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;gBACnB,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;IAMlD;;;;OAIG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACF;AA8DD,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAsBrE;AAsFD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAiBnF"}
package/rbe-bep.js CHANGED
@@ -9,23 +9,60 @@
9
9
  * downloads the bytes (`--remote_download_outputs`), because the URI names the
10
10
  * output's CAS identity, not its local availability. `lim xcode rbe install`
11
11
  * reads that digest and hands it to the instance, which fetches the blob from
12
- * its own RBE cache and installs it — no round-trip. The printed build command
13
- * passes `--remote_download_outputs=minimal` to skip the (unneeded) local
14
- * download by default; dropping it does not affect this parser.
12
+ * its own RBE cache and installs it — no round-trip. The generated bazelrc sets
13
+ * `--remote_download_outputs=minimal` to skip the (unneeded) local download by
14
+ * default; overriding it (e.g. `--remote_download_outputs=toplevel` on the command
15
+ * line) to materialize the .ipa locally does not affect this parser.
16
+ *
17
+ * A fully-cached rebuild (0 actions executed) still emits the bytestream URI and
18
+ * reproduces the same digest, so the auto-install watcher can rely on this parser
19
+ * after a no-op or revert (e.g. `git stash`) rebuild. Verified empirically.
15
20
  */
16
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.RbeBepError = void 0;
23
+ exports.inspectBuildCompletion = inspectBuildCompletion;
17
24
  exports.parseTopLevelIpaDigest = parseTopLevelIpaDigest;
25
+ class RbeBepError extends Error {
26
+ constructor(kind, message) {
27
+ super(message);
28
+ this.name = 'RbeBepError';
29
+ this.kind = kind;
30
+ }
31
+ /**
32
+ * True when re-reading the same (completed) BEP cannot help — the build was
33
+ * produced with flags the instance cache can't use (local download or a
34
+ * non-SHA256 digest). The watcher logs these once instead of retrying.
35
+ */
36
+ get terminal() {
37
+ return this.kind === 'local-only' || this.kind === 'non-sha256';
38
+ }
39
+ }
40
+ exports.RbeBepError = RbeBepError;
18
41
  /** A SHA-256 digest is exactly 64 lowercase hex chars; the instance CAS is keyed by it. */
19
42
  const SHA256_HEX = /^[0-9a-f]{64}$/;
20
- /** Extracts (hash, size) from a `bytestream://…/blobs/<hash>/<size>` URI. */
43
+ /**
44
+ * Extracts (digestFunction, hash, size) from a Bazel/REAPI bytestream blob URI:
45
+ * `bytestream://…/blobs/[<digest_function>/]<hash>/<size>`. The digest-function
46
+ * segment is OMITTED for functions inferable from hash length (SHA-256 among
47
+ * them) and PRESENT otherwise — notably BLAKE3, whose 256-bit output is also 64
48
+ * hex chars and so cannot be told apart from SHA-256 by length. Capturing the
49
+ * function lets the caller reject a non-SHA256 build (e.g. Bazel 9's BLAKE3
50
+ * default) with the right guidance instead of misreading the URI.
51
+ */
21
52
  function parseBytestreamDigest(uri) {
22
- // Tolerate an optional instance-name segment before /blobs/ by anchoring on
23
- // the /blobs/<hash>/<size> tail rather than a fixed segment count. The hash is
24
- // left length-agnostic here (validated as SHA-256 by the caller).
25
- const m = uri.match(/\/blobs\/([0-9a-f]+)\/(\d+)(?:$|\/)/);
26
- if (!m || m[1] === undefined || m[2] === undefined)
53
+ // Anchor on the /blobs/[func/]<hash>/<size> tail (tolerating an instance-name
54
+ // prefix). The optional function group only matches a real function segment:
55
+ // for the SHA-256 form (`/blobs/<hash>/<size>`) it backtracks to absent, and
56
+ // for `/blobs/blake3/<hash>/<size>` the non-hex 'l'/'k' force it to be captured
57
+ // as the function rather than the hash.
58
+ const m = uri.match(/\/blobs\/(?:([a-z0-9_]+)\/)?([0-9a-fA-F]+)\/(\d+)(?:$|\/)/);
59
+ if (!m || m[2] === undefined || m[3] === undefined)
27
60
  return null;
28
- return { hash: m[1], sizeBytes: Number(m[2]) };
61
+ return {
62
+ ...(m[1] !== undefined ? { digestFunction: m[1] } : {}),
63
+ hash: m[2].toLowerCase(),
64
+ sizeBytes: Number(m[3]),
65
+ };
29
66
  }
30
67
  /**
31
68
  * Canonicalizes a Bazel target label to the `//pkg:name` form BEP records.
@@ -44,14 +81,8 @@ function canonicalizeLabel(label) {
44
81
  const name = pkg.split('/').pop() ?? '';
45
82
  return name ? `${pkg}:${name}` : pkg;
46
83
  }
47
- /**
48
- * Finds the `.ipa` produced for `label` in a BEP stream and returns its CAS
49
- * digest. Throws a descriptive Error when the target/.ipa is absent, its output
50
- * was materialized locally (a `file://` URI) instead of left in CAS, or it was
51
- * built with a non-SHA256 digest the instance cache cannot resolve.
52
- */
53
- function parseTopLevelIpaDigest(bepJson, label) {
54
- const canonical = canonicalizeLabel(label);
84
+ /** Parses the BEP stream into events, ignoring partial/garbled lines. */
85
+ function parseEvents(bepJson) {
55
86
  const events = [];
56
87
  for (const line of bepJson.split('\n')) {
57
88
  const trimmed = line.trim();
@@ -64,28 +95,64 @@ function parseTopLevelIpaDigest(bepJson, label) {
64
95
  // Ignore partial/garbled lines (BEP is flushed incrementally).
65
96
  }
66
97
  }
67
- // The successful TargetComplete for the requested label (matched against the
68
- // canonical //pkg:name form Bazel records, so `//App` matches `//App:App`).
69
- const completed = events.find((e) => e.id?.targetCompleted?.label === canonical && e.completed?.success)
70
- ?.completed;
71
- if (!completed) {
72
- throw new Error(`No successful build of ${label} found in the build event log. ` +
73
- `Build it first with --config=limrun (e.g. \`bazelisk --digest_function=sha256 build --config=limrun ${label}\`).`);
98
+ return events;
99
+ }
100
+ /**
101
+ * Inspects a BEP stream for build completion. The watcher reads the BEP on every
102
+ * change but only acts once `complete` is true (the stream is fully flushed) and
103
+ * `success` is true (the build did not fail). `invocationId` lets the watcher act
104
+ * once per build even when consecutive builds reproduce the same .ipa digest
105
+ * (e.g. a `git stash` revert that rebuilds to an earlier digest).
106
+ */
107
+ function inspectBuildCompletion(bepJson) {
108
+ let complete = false;
109
+ let sawFinished = false;
110
+ let success = false;
111
+ let invocationId;
112
+ for (const e of parseEvents(bepJson)) {
113
+ if (e.started?.uuid)
114
+ invocationId = e.started.uuid;
115
+ if (e.id?.buildFinished !== undefined || e.finished !== undefined) {
116
+ sawFinished = true;
117
+ // proto3 JSON omits zero-valued scalars, so a SUCCESS exit code serializes
118
+ // as `{name:"SUCCESS"}` with `code` omitted — checking `code === 0` would be
119
+ // a dead branch. Trust overallSuccess (present=true on success, omitted on
120
+ // failure) and fall back to the exit code's symbolic name.
121
+ success = e.finished?.overallSuccess === true || e.finished?.exitCode?.name === 'SUCCESS';
122
+ }
123
+ if (e.lastMessage === true)
124
+ complete = true;
125
+ }
126
+ return {
127
+ complete,
128
+ success: sawFinished && success,
129
+ ...(invocationId !== undefined ? { invocationId } : {}),
130
+ };
131
+ }
132
+ /** Indexes namedSetOfFiles events by id for transitive fileset resolution. */
133
+ function indexNamedSets(events) {
134
+ const namedSets = new Map();
135
+ for (const e of events) {
136
+ const id = e.id?.namedSet?.id;
137
+ if (id && e.namedSetOfFiles)
138
+ namedSets.set(id, e.namedSetOfFiles);
74
139
  }
140
+ return namedSets;
141
+ }
142
+ /**
143
+ * Resolves the top-level `.ipa` CAS digest for one successful target's
144
+ * `completed` event, walking its default output group's filesets transitively.
145
+ * Throws a typed RbeBepError when no .ipa is present, it was materialized
146
+ * locally (`file://`), or it carries a non-SHA256 (e.g. BLAKE3) digest.
147
+ */
148
+ function resolveIpaDigest(label, completed, namedSets) {
75
149
  // Default output group -> the fileSet (namedSetOfFiles) ids holding its outputs.
76
150
  const rootFileSetIds = (completed.outputGroup ?? [])
77
151
  .filter((og) => og.name === 'default' || !og.name)
78
152
  .flatMap((og) => (og.fileSets ?? []).map((fs) => fs.id))
79
153
  .filter((id) => !!id);
80
154
  if (rootFileSetIds.length === 0) {
81
- throw new Error(`Build of ${label} reported no default output files.`);
82
- }
83
- // Index namedSetOfFiles by id and walk transitively (sets can nest).
84
- const namedSets = new Map();
85
- for (const e of events) {
86
- const id = e.id?.namedSet?.id;
87
- if (id && e.namedSetOfFiles)
88
- namedSets.set(id, e.namedSetOfFiles);
155
+ throw new RbeBepError('no-output', `Build of ${label} reported no default output files.`);
89
156
  }
90
157
  const seen = new Set();
91
158
  const queue = [...rootFileSetIds];
@@ -105,14 +172,20 @@ function parseTopLevelIpaDigest(bepJson, label) {
105
172
  continue;
106
173
  const digest = f.uri ? parseBytestreamDigest(f.uri) : null;
107
174
  if (digest) {
108
- // The instance cache is keyed by SHA-256. A non-64-hex digest means the
109
- // build used a different digest function (Bazel 9 defaults to BLAKE3),
110
- // which the server CAS cannot resolve — surface that clearly here rather
111
- // than letting it fail later as a cryptic cache miss.
112
- if (!SHA256_HEX.test(digest.hash)) {
113
- throw new Error(`Built ${f.name} with a non-SHA256 digest (got ${digest.hash.length} hex chars, expected 64; ` +
114
- `likely BLAKE3 on Bazel 9). The instance cache is keyed by SHA-256 — rebuild with ` +
115
- `--digest_function=sha256, e.g. \`bazelisk --digest_function=sha256 build --config=limrun ${label}\`.`);
175
+ // The instance cache is keyed by SHA-256. Reject any other digest
176
+ // function — Bazel 9 defaults to BLAKE3, whose URI carries an explicit
177
+ // `blake3` function segment (and whose 64-hex hash is indistinguishable
178
+ // from SHA-256 by length, so the hash form alone can't catch it). Surface
179
+ // it here with the fix rather than letting it fail later as a cryptic
180
+ // server cache miss.
181
+ const isSha256 = digest.digestFunction === undefined ?
182
+ SHA256_HEX.test(digest.hash)
183
+ : digest.digestFunction === 'sha256';
184
+ if (!isSha256) {
185
+ const got = digest.digestFunction ?? `${digest.hash.length} hex chars`;
186
+ throw new RbeBepError('non-sha256', `Built ${f.name} with a non-SHA256 digest (${got}; Bazel 9 defaults to BLAKE3). The instance ` +
187
+ `cache is keyed by SHA-256 — rebuild with --digest_function=sha256, e.g. ` +
188
+ `\`bazelisk --digest_function=sha256 build --config=limrun ${label}\`.`);
116
189
  }
117
190
  return { hash: digest.hash, sizeBytes: digest.sizeBytes, ipaName: f.name };
118
191
  }
@@ -124,10 +197,29 @@ function parseTopLevelIpaDigest(bepJson, label) {
124
197
  }
125
198
  }
126
199
  if (localOnlyIpa) {
127
- throw new Error(`Found ${label}'s .ipa (${localOnlyIpa}) but it has no remote (bytestream) digest — it was ` +
200
+ throw new RbeBepError('local-only', `Found ${label}'s .ipa (${localOnlyIpa}) but it has no remote (bytestream) digest — it was ` +
128
201
  `built locally, not remotely executed. Ensure you built with --config=limrun so the .ipa is ` +
129
202
  `produced in the instance's cache.`);
130
203
  }
131
- throw new Error(`No .ipa output found for ${label} in the build event log.`);
204
+ throw new RbeBepError('no-ipa', `No .ipa output found for ${label} in the build event log.`);
205
+ }
206
+ /**
207
+ * Finds the `.ipa` produced for `label` in a BEP stream and returns its CAS
208
+ * digest. Throws a typed RbeBepError when the target/.ipa is absent, its output
209
+ * was materialized locally (a `file://` URI) instead of left in CAS, or it was
210
+ * built with a non-SHA256 digest the instance cache cannot resolve.
211
+ */
212
+ function parseTopLevelIpaDigest(bepJson, label) {
213
+ const canonical = canonicalizeLabel(label);
214
+ const events = parseEvents(bepJson);
215
+ // The successful TargetComplete for the requested label (matched against the
216
+ // canonical //pkg:name form Bazel records, so `//App` matches `//App:App`).
217
+ const completed = events.find((e) => e.id?.targetCompleted?.label === canonical && e.completed?.success)
218
+ ?.completed;
219
+ if (!completed) {
220
+ throw new RbeBepError('no-build', `No successful build of ${label} found in the build event log. ` +
221
+ `Build it first with --config=limrun (e.g. \`bazelisk --digest_function=sha256 build --config=limrun ${label}\`).`);
222
+ }
223
+ return resolveIpaDigest(label, completed, indexNamedSets(events));
132
224
  }
133
225
  //# sourceMappingURL=rbe-bep.js.map
package/rbe-bep.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rbe-bep.js","sourceRoot":"","sources":["src/rbe-bep.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AA6DH,wDAmFC;AAtHD,2FAA2F;AAC3F,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC,6EAA6E;AAC7E,SAAS,qBAAqB,CAAC,GAAW;IACxC,4EAA4E;IAC5E,+EAA+E;IAC/E,kEAAkE;IAClE,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAC3D,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAChE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,KAAa;IACtC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,0EAA0E;IAC1E,+EAA+E;IAC/E,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IACvB,OAAO,GAAG,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG;QAAE,GAAG,EAAE,CAAC;IAChD,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE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