BXM Memo 0.4 Adds a GitHub Action and Stops Parallel Builds From Caching Half-Written Files
BXM Memo 0.3 had a known hole, and the Memo page said so. Two runs writing the same output folder at the same time, say two parallel steps of one build sharing a cache, could leave one of them storing a file the other was halfway through rewriting. Every later hit would then restore that broken copy. It needed bad timing. It was still wrong.
In 0.4 runs whose outputs overlap take turns. Each run locks its outputs from just before it looks in the cache until it has restored or stored them. The second run waits, says waiting for another run writing public, and when its turn comes the first run’s result is already in the cache. So it’s a hit. The command runs once instead of twice, which is a nice side effect of fixing a correctness bug.
“Overlap” took some care. Two runs writing out and out/r.txt share a file without sharing a name, and the first version of the locks missed that. An independent review caught it before release. Now each run locks its own outputs and holds a shared lock on every folder above them, so a run writing a folder waits for one writing a file inside it, while runs writing out/a and out/b still go side by side.

The review found a second way to get stuck. A build script run by Memo that called Memo again on the same output would wait for its own parent, forever. That now fails at once with a message saying why, and no run waits longer than an hour (--lock-wait changes it). A nested run writing a different file in the same folder works fine.
Locks live in the cache, not in your project, and the operating system drops them if a run is killed. A cache that can’t hold locks, read-only or on a network file system without them, still works as before. Memo says it’s running without them and carries on.
The other half of 0.4 is a GitHub Action. CI is where Memo earns its keep, and until now the README just said “point it at a cache”. Now it’s two lines:
- uses: softdevstudio/bxm/[email protected]
- run: bxm-memo run -i 'content/**' -o public -- hugo --minify
The action downloads the bxm-memo release it belongs to, checks it against SHA256SUMS, puts it on the path and keeps its cache between workflow runs with actions/cache. It’s tested on Linux, macOS and Windows runners, including the part that matters: a cache filled by one job gives the next job a hit without running the command.
The Memo page has the updated rules, the reference has --lock-wait, and the download page has the 0.4 archives. Canon is unchanged in this release.