Skip to content

Native add-on compile build & cache service #151

@rvagg

Description

@rvagg

It turns out that @orangemocha and I have been thinking about a very similar solution to the native add-on compile problem.

  1. Accept queries for binaries of packages with the following parameters:
    • Package name (e.g. bignum, leveldown, serialport)
    • Package version (e.g. 1.0.2)
    • Platform (e.g. linux, win32, darwin)
    • Architecture (e.g. x86, x64, armv7)
    • Node ABI version (i.e. process.versions.modules, a.k.a NODE_MODULES_VERSION)
  2. If no matching binary exists and the combination is acceptable build it
  3. Serve the binary or serve a rejection for <reason>

Some additional thoughts about getting something like this working:

  • Windows is arguably the most difficult platform with the most unknowns to get this working on. OSX is similar for various reasons but probably not as difficult as Windows and doesn't present as many challenges to users. So we should pick off Windows as a first target and ignore the rest until we have something that works for Windows, then we can rapidly apply the same model to other platforms.
  • Containers, jails and zones are ideal where available, VMs with snapshots otherwise. It's important that we provide isolation between builds and isolation of the build system for security, stability and overall integrity of the system.
  • Build resource requirements would be bursty, mainly coinciding with new releases of Node and new releases of the supported packages. Building elasticity into the system would be sensible.
  • Azure would be a good target for seeking resources for a first-pass at this, if we can get them on board we could spin up a proof of concept fairly quickly I think. It's in Microsoft's interests so we just need to connect that with Azure.
  • OSX resources are tricky, we can't get this as easily from an IaaS but we could either buy more Mac Minis and store them in a partner's network (Voxer does this atm, I do this personally for ARM). We could also investigate using Foundation resources to buy from one of the pseudo IaaS OSX providers.
  • Linux and other unixes are fairly easy to add but are also the platforms with the least pain (apt-get install build-essential && bingo!). Piggy-backing @nodejs/build resources is possible but we're already close to saturated for usage so we'd have to spin up more to handle this and we may be pushing friendships with sponsors.
  • Linux ARM is the trickiest of the unixes because it's not as simple to compile often because of resource constraints and the style of deployment. We could piggy-back the existing @nodejs/build ARM resources here and seek donations from the community (ideal) or funds from the Foundation (if necessary).
  • We can't support all native add-ons, consider node-canvas as one case where there are system dependencies that are necessary to both compile and use it. Unless a native add-on can ship its dependencies via npm it's going to be difficult for us to support it.
  • We should consider a two-way opt-in system whereby we are whitelisting packages that we are willing to support, and those packages are opting in with their install system in the way they use node-pre-gyp now.
  • node-pre-gyp has an evolved model that seems to be working well, we should adopt as much of that as possible and possibly piggy-pack it to provide the implementation (i.e. node-pre-gyp could be the client for this system).

/cc @nodejs/build, @springmeyer, @othiym23, @nebrius (pls unsubscribe if you don't want to be involved in this discussion, I'm just guessing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions