Skip to content

src: add option to disable loading native addons

Rodrigo Muino Tomonari requested to merge github/fork/d3lm/feat/no-addons into master

This PR adds a new CLI option --no-addons which disables loading native addons. When this option is specified, loading a native addon will throw from the internal side (node_binding.cc#DLOpen). In addition, using this option will enable a new resolution condition no-addons. The motivation behind this PR originates from this proposal. The TLDR is that we wanted to propose a way to disable native addons and allow open source maintainers to conditionally export different entry points, e.g. an entry point that uses native addons vs. an entry point that for instance uses WebAssembly to enable it to run in environments that don't allow running native code such as browsers.

For the initial PR I have decided to go with --no-addons for the CLI option, but if anyone has suggestions I am happy to change it.

  • Tests added
  • make -j4 test passes

Merge request reports

Loading