Open CMCDragonkai opened 1 year ago
Ok turns out it's a little bit more complicated than just copying over the prebuild.js
from js-quic
. The reason is that the binding.gyp
indicates that we end up creating a fat executable on MacOS, that is both x86_64
and arm64
. In js-quic
, we separated these 2 out and now build 1 specific binary.
I wonder if it is possible to get binding.gyp
to specify to outputs instead of just 1 output?
I might put this on the backburner for now as it isn't entirely necessary and just release the latest version.
New version to be released with the new macos build too.
Description
Our js-quic now published optional packages
I want to apply this to js-db too, so we can do streamline the installation and also be able to self-publish at least just the Linux one.
This involves replacing how we do our
prebuild.js
in particular and bringing in thescripts/prebuild.js
,scripts/prepublishOnly.js
andscripts/version.js
.We may also need to fix up our CI/CD scripts too.
Without the GitLab CI/CD we can only do the linux build and windows builds. So we can delay having the macos ones.
Note that we rely on
node-gyp-build
package for both detection and auto-building the local dependency when installed. We don't havenode-gyp-build
injs-quic
, thus there's no automatic compilation upon installation. Instead if none of the native dependencies can be found, it's necessary for the user to compile their own (which is a bit of a pain)... since compilation requires running a certain script, specificallynpm run prebuild
. However that's not really possible while we are installingjs-quic
as a dependency. We could do something similar with our own install script, but such a script/command has to exist in the packaged distribution and we actually ignore all/scripts
in our.npmignore
.At the end of the day, I'm not even sure if it makes sense to enable automatic compilation. Really if it is not available, they have to source it from somewhere and place it in the right location. Specifically the custom loader will look for it in just the local
prebuild/
directory. So figure out a compilation routine and then distribute it duringnpm install
. The problem with relying onnpm install
to compile the native binary is that there's no guarantee that all the tools are available to do this for the end user. So therefore one should think ofnpm install
as the final distribution here, for power users, they should be using the gitlab repository, possibly directly refer to it as a dependency, or submit a build for this opensource repo.Fixes #43 Fixes #44
Tasks
js-quic
node-gyp-build
with just your own loader script, copied fromjs-quic
.install
command ofnode-gyp-build
. It would not be necessary... as it simply detects if the binary already exists, and if not ends up calling a build to do a local compilation.Final checklist