mongodb-js / boxednode

📦 boxednode – Ship a JS file with Node.js in a box
Apache License 2.0
599 stars 10 forks source link

chore: writes compiled mongosh to lib-boxednode instead of lib to avoid linking it twice when building node #43

Closed himanshusinghs closed 11 months ago

himanshusinghs commented 11 months ago

As pointed by Anna, probably because of changes (1,2) in between Node16 to Node20, the compiled mongosh file that we used to write under lib dir in node source tree was getting linked twice when building Node, but one the mentioned changes made this an error state and our compilation started failing after switching to Node20.

With this change we will start writing the compiled mongosh file to lib-boxednode dir in node source tree instead of lib and will continue linking it (only once) with --link-module arg.

himanshusinghs commented 11 months ago

Looking into test failures. Even though the the file was linked during building, the final binary is not able to require it for some reason. Works fine, if I write to source tree root and include it from there.

himanshusinghs commented 11 months ago

That was actually it, thank you for pointing, I missed that.