Skip to content

fix(nix): build the flake package with the files and SQLite it needs - #188

Merged
kixelated merged 1 commit into
mainfrom
fix/nix-build
Nov 21, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/nix-build

Conversation

@kixelated

@kixelated kixelated commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes nix build github:kixel-ai/token-max failing two ways.

Summary

  • flake.nix's fileset omitted tests/ssh_windows.rs, which Cargo.toml names as a [[test]], so every build at main failed with can't find ssh_windows test. It now lists the file.
  • With a newer nixpkgs than this repo locks, the build then fails with cannot find -lsqlite3: nixpkgs' Cargo setup hook makes rusqlite link the system SQLite even with the bundled feature, and the package declared neither pkg-config nor sqlite. It now declares both, as nixpkgs' own Rust packages do. Flakes that follow their own nixpkgs, such as kixel-ai/dotfiles through moq-dev/quest, hit this.

Public API

None. Build recipe only; no wire change.

Caused by

  • kixel-ai/token-max#181 - added the ssh_windows test without adding it to the flake's fileset (found by person).
  • The -lsqlite3 failure is no single PR's: it appears only under a nixpkgs whose Cargo hook forces pkg-config, which this repo's lock predates (an upstream nixpkgs change).

Validation

  • Reproduced both on the unmodified flake: nix build .#default at main fails with the ssh_windows error; with the fileset fixed and --override-input nixpkgs github:NixOS/nixpkgs/d4f25a3e562008648d45bcf2d70bcc7422cad84e it fails with ld.bfd: cannot find -lsqlite3.
  • With this change both builds succeed, under that nixpkgs and under 4fe25e12eb9f4c744966dd3de5a05246cf098601, and the repo's own lock builds too; the built token-max --version prints 0.0.1 and --help runs. quest check passes.
  • Not run: macOS and aarch64 builds. CI builds nothing through the flake, so it cannot catch either bug; adding nix build to the gate would cost a full release build per run, so this PR does not.

Models

Size: XS
Implementer: Claude Code, claude-sonnet-5-5, unknown effort (iterate, XS, arm B)

🤖 Generated with Claude Code

(Written by Sonnet 5.5)

Review

Rewritten by quest review after each round.

  • Head: 3727453

  • Base: origin/main at 4123fb4

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1ff4a-e3e7-75f1-9d86-4efcfddd44ad, round 1

  • Score: 9/10, The changes supply the declared Cargo test target and SQLite build dependencies without an identifiable regression on code inspection; builds and tests were intentionally not run.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Reviewer: Codex, gpt-6.1-sol, low effort, shadow

  • Session: 01a1ff4a-e3e8-72e1-b1a9-2df7ddda7672, round 1

  • Score: 9/10, Code inspection found no actionable regressions in the SQLite build dependencies or Nix test-source inclusion, but builds and tests were not run.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

Summary by CodeRabbit

  • Chores
    • Updated the Rust package build configuration to include the Windows SSH test source and the required SQLite and pkg-config build inputs. These changes affect package build contents and requirements; no user-facing features or behavior changed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Nix package source set now includes tests/ssh_windows.rs. The package also declares pkg-config and SQLite as build inputs.

Changes: Nix package build

Layer / File(s) Summary
Package sources and build inputs
flake.nix
The package source set includes tests/ssh_windows.rs. The build inputs include pkg-config and SQLite. Comments describe the system SQLite linkage used by nixpkgs’ Cargo setup.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: pullfrog

Merge Risk: Minimal · up to 37274

This updates the Nix flake package so it includes the Windows SSH test file and declares pkg-config and SQLite as build inputs, which fixes the reported Nix build failures. The change is small, confined to the build definition, and has no runtime effect. macOS and aarch64 Nix builds were not checked. No merge-blocking risk is identified.

Security architecture risk: Minimal · up to 37274

The change supplies files and dependencies needed to build the existing package. No introduced or worsened security, ownership, or failure-containment risk was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(nix): build the flake package with the files and SQLite it needs" matches the main change. The PR adds tests/ssh_windows.rs to the flake fileset, which fixes the missing test target err…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(nix): build the flake package with the files and SQLite it needs" matches the main change. The PR adds tests/ssh_windows.rs to the flake fileset, which fixes the missing test target error, and adds pkg-config and sqlite as build inputs, which fixes the cannot find -lsqlite3 error. The title names the Nix flake package, the files, and SQLite, so it covers both fixes without listing file names. It is a clear, single-sentence, conventional-commit style title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 1
  • Waived: $0.25 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d2794b5f-8fa4-4036-ab07-97188752a927
Commits

Reviewing files that changed from the base of the PR and between 4123fb4 and 3727453.

Files selected for processing: 1

  • flake.nix

Limit details: You’ve used all 10 included reviews currently available.

@kixelated
kixelated marked this pull request as ready for review November 21, 2026 18:08

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: sound. It fixes both build failures in the recipe, with no change to the code that gets built.

Reviewed changes: the single flake.nix change.

  • Fileset: adds ./tests/ssh_windows.rs, the only file Cargo.toml names in a [[test]] table (line 43). The other tests under tests/ are auto-discovered, so cargo doesn't need them present.
  • SQLite: adds pkgs.pkg-config to nativeBuildInputs and pkgs.sqlite to buildInputs. This follows the nixpkgs convention and fixes the -lsqlite3 link error under newer nixpkgs. The added comment explains why it's needed.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit fff5368 Nov 21, 2026
10 of 11 checks passed
@kixelated
kixelated deleted the fix/nix-build branch November 21, 2026 19:34
kixelated added a commit to moq-dev/quest that referenced this pull request Nov 21, 2026
The bumped nixpkgs' Cargo setup hook makes rusqlite link the system SQLite,
which token-max's flake package at f2bfa79 does not provide, so the dev
shell failed with `ld: cannot find -lsqlite3`. kixel-ai/token-max#188
adds sqlite and pkg-config to its package; fff5368 is the first commit with it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant