Our releases now build on our own machines

SQLly releases used to wait five hours on a hosted Windows build agent. Now every platform builds on our own Mac, Ubuntu box and an old gaming laptop.

By

Every SQLly release now builds on machines we own. No more Microsoft-hosted Windows build agent. Here's what that looks like and why I bothered.

The problem: Windows took five hours

SQLly ships for macOS, Linux and Windows, on both Intel/AMD and ARM. Each release tag kicks off one pipeline that builds all of it. The last fully green release before this change (v1.44.3) took:

BuildWhere it ranTime
Windows (x64 + ARM64)Microsoft-hosted windows-20225h 06m
Linux x64Our Ubuntu box22m 35s
Linux ARM64Our Ubuntu box27m 29s
macOS ARM64 (signed + notarized)My MacBook Pro33m 10s

So every release spent roughly half an hour building everywhere except Windows, and then waited four and a half more hours on Windows. The hosted agents are fine machines for what they cost, but they start from scratch every run. A Rust app this size, compiled twice (x64 and ARM64) with tests, on a fresh VM, is slow no matter how much caching you bolt on.

The fleet

Nothing fancy. Three machines I already had:

  • macOS: my MacBook Pro (M4 Max, 128 GB). It builds, signs and notarizes the Mac releases, Apple Silicon and Intel, plus the App Store build.
  • Linux: an Ubuntu VM on a custom desktop with an i9-13900K and 128 GB of RAM. It builds Linux x64 and ARM64 and the browser version of SQLly.
  • Windows: an Alienware gaming laptop (Ryzen 9, 32 GB, a fast NVMe for the build cache). It was an employee's machine before we went all-in on Macs, and it's been sitting around since. Now it has a job again.

The big win is that local agents keep their build output between runs. A release that only touches a few crates only rebuilds those crates.

The new Windows number

First run on the laptop (v1.44.10), x64 and ARM64 together, including lint and the full test suite:

BuildBeforeAfter
Windows (x64 + ARM64)5h 06m (hosted)58m 14s (old gaming laptop)
Linux x6422m 35s10m 48s
Linux ARM6427m 29s4m 09s

And that Windows number is the worst it'll ever be: the laptop started with an empty build cache. It also ran out of RAM along the way (32 GB is tight for this), so there's more to squeeze out of it.

Is it all local now?

All the compiling is. A few tiny bookkeeping jobs (deciding whether a tag needs a build, writing the changelog, uploading the finished files) still run on hosted agents, because they take a minute each and there's nothing to gain by moving them.

The tradeoff is obvious: if a machine is off, that platform's release waits. For a small shop shipping several times a week, I'll take that over five hours per release.

Text and data on this page: CC BY 4.0, credit SQLly (sqlly.app). Code and SQL snippets: MIT. License details View as Markdown