Company
Date Published
Author
Daniel Bradley
Word count
1186
Language
English
Hacker News points
None

Summary

Pulumi's engineering team often creates and distributes tools as native binaries, primarily using Go for its support in building self-contained binaries without additional dependencies. For Node.js projects, Pulumi employs the vercel/pkg command line tool, which packages Node.js applications into executables that can run on devices without Node.js installed. The process involves setting up pkg by installing it via npm or yarn, specifying the entry point in the package.json file, and executing the pkg command with appropriate targets and output paths. Challenges encountered include dealing with the "Inspector Not Available" warning due to the Node.js Inspector API and issues with running MacOS ARM binaries, which were resolved by adjusting the creation of singleton instances and installing the 'ldid' tool. Additionally, the requirement for static binaries in Nixos environments was addressed by changing Linux targets to static versions, and multi-platform builds were managed using a makefile to automate the process for various operating systems. The use of vercel/pkg replaces a similar process with the nexe project, which is now considered unmaintained.