chore: direnv dev shell with C compiler so cgo tests run #12

Merged
arne merged 1 commit from chore-dev-shell-direnv into main 2026-06-28 10:16:57 +02:00
Owner

Summary

  • Add pkgs.gcc to shell.nix. The project is pure-Go (modernc.org/sqlite, no import "C"), but Go defaults to CGO_ENABLED=1 and so wants a C compiler on PATH — without one, go test ./internal/web/... and …/catalog/... fail with cgo: C compiler "gcc" not found.
  • Add .envrc (use nix) so direnv allow loads the dev shell automatically on cd.

Testing

Inside the shell (nix-shell / direnv): go build ./... and go test ./... both pass, including the previously-unrunnable internal/web and internal/catalog/sqlite packages.

🤖 Generated with Claude Code

## Summary - Add `pkgs.gcc` to `shell.nix`. The project is pure-Go (`modernc.org/sqlite`, no `import "C"`), but Go defaults to `CGO_ENABLED=1` and so wants a C compiler on PATH — without one, `go test ./internal/web/...` and `…/catalog/...` fail with `cgo: C compiler "gcc" not found`. - Add `.envrc` (`use nix`) so `direnv allow` loads the dev shell automatically on `cd`. ## Testing Inside the shell (`nix-shell` / direnv): `go build ./...` and `go test ./...` both pass, including the previously-unrunnable `internal/web` and `internal/catalog/sqlite` packages. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Go defaults to CGO_ENABLED=1 and so needs a C compiler on PATH even though the
project is pure-Go (modernc.org/sqlite). Without one, `go test` fails with
`cgo: C compiler "gcc" not found`. Add pkgs.gcc to shell.nix and an .envrc
(`use nix`) so `direnv allow` loads the shell automatically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
arne merged commit 7aca17f57b into main 2026-06-28 10:16:57 +02:00
arne deleted branch chore-dev-shell-direnv 2026-06-28 10:16:57 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tjue/kokosbananas!12
No description provided.