storacha/w3cli

evaluate SEA for standalone binaries of w3cli by prototyping something with it

Opened this issue · 2 comments

Context

  • SEA is a newish thing in node stdlib that can make executables from a nodejs script https://nodejs.org/api/single-executable-applications.html
  • this used to be something that there were lots of slightly different userspace ways of doing. I've never explored those but iiuc plenty of products use them and they work, I've just never needed them and it wasn't obvious which one to use. So it seems nice to have a blessed way in the nodejs stdlib
  • but the docs say "Stability: 1 - Experimental: This feature is being designed and will change." so it's not obvious whether we can promise a feature powered by this yet.

Potential Benefit

  • if it does work out, we could publish executables of w3cli that would run on systems that don't have node.js installed, which would probably make it easier to use for some and might increase the addressable audience of the w3cli tool

Time box

  • 1 day just to follow the docs on a sample script, see how it goes, debug if needed, report back on how it went. (If it's smooth sailing, go ahead and try it out on w3cli itself and it could work)

I'm interested in scouting this out but not till landing storacha/migrate-to-w3up#3

I tried SEA before I explored pkg in #104 and it was a non-starter 4 months ago (alas i did not document why!) It's definitely worth another timeboxed try out, and a different set of eyes!

My only flag it that if we end up going the "transpile node.js to single binary" route, the resulting bin has to pass a complete battery of black box tests... porting the existing w3cli test suite as a minimum. My fear is leaning on experimental compilers and having a binary we offer up for production use that fails in deeply surprising ways out in the wild that we can't debug.