From 12a38b7e6acc72df7522d79388a9e7360bd6c015 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 12 May 2026 22:18:43 +0200 Subject: [PATCH] fix(nix): clear stale wheels before pypaBuildPhase `dist/` carried in via the source tree can contain a stale wheel from a previous build (e.g. kpmx-1.12.1 alongside the freshly built 1.13.3). Both wheels declare a `bin/pkgmgr` entry, so `pypaInstallPhase` hits FileExistsError on the second install. Wipe `dist/` in `preBuild` so only the fresh wheel is installed. Co-Authored-By: Claude Opus 4.7 (1M context) --- flake.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake.nix b/flake.nix index 4275c71..608f8ab 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,10 @@ # Build using pyproject.toml format = "pyproject"; + # Clear any stale wheels carried in from the source tree so + # pypaInstallPhase doesn't collide on bin/pkgmgr. + preBuild = "rm -rf dist"; + # Build backend requirements from [build-system] nativeBuildInputs = [ pyPkgs.setuptools