From 7fdbc064d8962087f3194b5af0410e2af7231b8b Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Tue, 26 May 2026 20:04:33 +0000 Subject: [PATCH] fix: honour BB_BINARY_PATH --- barretenberg/ts/src/bb_backends/node/platform.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/barretenberg/ts/src/bb_backends/node/platform.ts b/barretenberg/ts/src/bb_backends/node/platform.ts index adc92efff1bc..d312cc43ad15 100644 --- a/barretenberg/ts/src/bb_backends/node/platform.ts +++ b/barretenberg/ts/src/bb_backends/node/platform.ts @@ -83,7 +83,8 @@ export function detectPlatform(): Platform | null { * * Search order: * 1. If customPath is provided and exists, return it - * 2. Otherwise search in /build//bb + * 2. If BB_BINARY_PATH is set and exists, return it + * 3. Otherwise search in /build//bb */ export function findBbBinary(customPath?: string): string | null { // Check custom path first if provided @@ -95,6 +96,14 @@ export function findBbBinary(customPath?: string): string | null { return null; } + const envPath = process.env.BB_BINARY_PATH; + if (envPath) { + if (fs.existsSync(envPath)) { + return path.resolve(envPath); + } + return null; + } + // Automatic detection const platform = detectPlatform(); if (!platform) {