Pulumi enables engineers to employ the best practices of their field to infrastructure as code. The pulumi watch command is an example of this, enabling rapid prototyping and a “hot reload” style developer experience for prototyping Pulumi programs. In this post you’ll see what watch mode enables, the challenges encountered in maintaining the feature, and how we were able to use Rust to bring that feature to more of our users.
When developing a web application, hot reload frameworks enable quickly iterating and confirming the divs are centered. When implementing new features, a test runner with a watch mode makes test-driven development a breeze. In languages with an interactive shell, it’s natural to use that to experiment with new APIs. In each of these cases, engineers find value in being able to focus on writing code, not typing console commands.
That’s why pulumi watch mode exists and is one of my favorite features, and it’s why I was disappointed to learn this feature was not available to users on Apple Silicon Macs. As a Windows and Linux user, I discovered this while root causing a Pulumi provider’s failing build to the library used to implement watch mode. Thus began a deep dive into cgo, file-watching libraries in Go, operating system event APIs, and finding a solution for our build issues and missing feature.