fix: Allow importing when using a SEA binary#466
Conversation
testBindingBinary would throw when using a node-llama-cpp in a SEA binary. Add an exclusion to getShouldTestBinaryBeforeLoading to check for this and skip the test.
|
@Thomas101 What error do you get from the It'd be best if you can provide me with a simple reproduction code so I can investigate it. I've recently came across a similar issue with node SEA packaged as a snap package (unrelated to const insideSnap = process.env.SNAP != null;
if (!insideSnap)
process.env.SNAP = "true";
const llama = await getLlama();
if (!insideSnap)
delete process.env.SNAP;I'll close this PR for now since this is not the right fix for the issue, but feel free to reopen it or create a new one with the fix for the |
After re-testing the binary on all 3 platforms, it looks like this isn't a problem anymore. Remove our hacky patch See withcatai#466
|
To be honest, we added this hack sometime late last year when we were trying to ship the first version of AiBrow in a hurry and it just kind of stayed there after that. It looks like it isn't an issue now. I've done a quick test across win, linux & mac and it doesn't seem to crash, so I'll run a for-real build of AiBrow and get that tested. Thanks! |
testBindingBinary would throw when using a node-llama-cpp in a SEA binary. Add an exclusion to getShouldTestBinaryBeforeLoading to check for this and skip the test.
Description of change
As requested bringing this into the main repo as PR. Not sure if this is the right way to address this, but it fixed it when we were trying to bundle node-llama-cpp into a SEA binary.
Pull-Request Checklist
masterbranchnpm run formatto apply eslint formattingnpm run testpasses with this changeFixes #0000N/A