Skip to content

Commit 714a29b

Browse files
committed
fix: simplify openLibrary bunCwd param
1 parent 7a8b7ed commit 714a29b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bun/src/binding.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ const fns = {
115115
};
116116

117117
// Load the compiled Zig shared library
118-
const lib = await openLibrary(path.resolve("../bun"), fns);
118+
// the first param is bun's cwd
119+
// - on dev env it's the cwd which is `./bun`
120+
// - on prod env it does not matter because bun-ffi-z will load platfrom-specific package like @chainsafe/state-transition-bun-linux-x64-gnu/libstate-transition-utils.dylib instead
121+
const lib = await openLibrary(path.resolve("."), fns);
119122
export const binding = lib.symbols;
120123

121124
/**

0 commit comments

Comments
 (0)