Skip to content

Commit 6495ef7

Browse files
mkannwischerhanno-becker
authored andcommitted
CI: Install sqlite3 via apt instead of nix profile
cache-nix-action merges the Nix store database with sqlite3, which the setup-nix action provided via `nix profile install nixpkgs/nixos-24.11#sqlite`. Resolving the nixos-24.11 branch goes through api.github.com, which intermittently returns HTTP 429 when many EC2 runners start at once. When throttled, sqlite3 was never installed, the store-DB merge failed with "sqlite3: command not found", and the corrupted store then broke every subsequent `nix develop` in the job. Install sqlite3 from apt instead, which never touches api.github.com. Guard on `command -v sqlite3` so it's a no-op where sqlite3 already exists (macOS and GitHub-hosted runners) and only installs on the bare EC2 AMIs. - Ports pq-code-package/mldsa-native#1239 Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
1 parent 9b69e04 commit 6495ef7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/actions/setup-nix/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ runs:
9898
sudo chown -R $USER:nixbld /nix
9999
fi
100100
101-
nix profile install nixpkgs/nixos-24.11#sqlite
101+
# sqlite3 is needed by cache-nix-action to merge the Nix store database.
102+
if ! command -v sqlite3 >/dev/null 2>&1; then
103+
sudo apt-get update && sudo apt-get install -y sqlite3
104+
fi
102105
nix config show
103106
echo "::endgroup::"
104107
- uses: nix-community/cache-nix-action@dab0514428ae3988852b7787a6d86a6fc571cc9d #v6.0.0

0 commit comments

Comments
 (0)