Skip to content

Commit 2a126f6

Browse files
authored
fix: honour BB_BINARY_PATH (#23570)
.
1 parent dcf7354 commit 2a126f6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

barretenberg/ts/src/bb_backends/node/platform.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export function detectPlatform(): Platform | null {
8383
*
8484
* Search order:
8585
* 1. If customPath is provided and exists, return it
86-
* 2. Otherwise search in <package-root>/build/<platform>/bb
86+
* 2. If BB_BINARY_PATH is set and exists, return it
87+
* 3. Otherwise search in <package-root>/build/<platform>/bb
8788
*/
8889
export function findBbBinary(customPath?: string): string | null {
8990
// Check custom path first if provided
@@ -95,6 +96,14 @@ export function findBbBinary(customPath?: string): string | null {
9596
return null;
9697
}
9798

99+
const envPath = process.env.BB_BINARY_PATH;
100+
if (envPath) {
101+
if (fs.existsSync(envPath)) {
102+
return path.resolve(envPath);
103+
}
104+
return null;
105+
}
106+
98107
// Automatic detection
99108
const platform = detectPlatform();
100109
if (!platform) {

0 commit comments

Comments
 (0)