From 0e2587cc71f497141ccd5fc807624eac80f8f183 Mon Sep 17 00:00:00 2001 From: Test Date: Mon, 23 Dec 2024 13:50:24 -0600 Subject: [PATCH 1/2] fix: broken JB build --- binary/build.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/binary/build.js b/binary/build.js index e91a3b6b3d..7e971e0408 100644 --- a/binary/build.js +++ b/binary/build.js @@ -276,6 +276,9 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) { `node_modules/${targetToLanceDb[target]}/index.node`, `${targetDir}/index.node`, ); + + // Copy over our dummy package.json + fs.copyFileSync("out/package.json", `${targetDir}/package.json`); } // Our dummy `package.json` is no longer needed so we can remove it. @@ -284,13 +287,12 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) { fs.unlinkSync("out/package.json"); const pathsToVerify = []; - for (target of targets) { + for (const target of targets) { const exe = target.startsWith("win") ? ".exe" : ""; const targetDir = `bin/${target}`; pathsToVerify.push( `${targetDir}/continue-binary${exe}`, `${targetDir}/index.node`, // @lancedb - "package.json", // Informs of where to look for node_sqlite3.node https://www.npmjs.com/package/bindings#:~:text=The%20searching%20for,file%20is%20found `${targetDir}/build/Release/node_sqlite3.node`, ); } From d6bcf4cea4890a243e6619aedd8780f01e5e7fbb Mon Sep 17 00:00:00 2001 From: Test Date: Mon, 23 Dec 2024 14:12:14 -0600 Subject: [PATCH 2/2] Update build.js --- binary/build.js | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/binary/build.js b/binary/build.js index 7e971e0408..045fb64f22 100644 --- a/binary/build.js +++ b/binary/build.js @@ -118,22 +118,6 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) { } (async () => { - // Informs of where to look for node_sqlite3.node https://www.npmjs.com/package/bindings#:~:text=The%20searching%20for,file%20is%20found - // This is only needed for our `pkg` command - fs.writeFileSync( - "out/package.json", - JSON.stringify( - { - name: "binary", - version: "1.0.0", - author: "Continue Dev, Inc", - license: "Apache-2.0", - }, - undefined, - 2, - ), - ); - console.log("[info] Downloading prebuilt lancedb..."); for (const target of targets) { if (targetToLanceDb[target]) { @@ -277,15 +261,11 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) { `${targetDir}/index.node`, ); - // Copy over our dummy package.json - fs.copyFileSync("out/package.json", `${targetDir}/package.json`); + // Informs the `continue-binary` of where to look for node_sqlite3.node + // https://www.npmjs.com/package/bindings#:~:text=The%20searching%20for,file%20is%20found + fs.writeFileSync(`${targetDir}/package.json`, ""); } - // Our dummy `package.json` is no longer needed so we can remove it. - // If it isn't removed, then running locally via `node out/index.js` will fail - // with a `Failed to locate bindings` error - fs.unlinkSync("out/package.json"); - const pathsToVerify = []; for (const target of targets) { const exe = target.startsWith("win") ? ".exe" : "";