Skip to content

fix(flake.nix): build go-migrate with only postgres driver - #26643

Merged
geokat merged 1 commit into
mainfrom
george/fix-go-migrate-cli-after-nixpkgs-upgrade
Jun 24, 2026
Merged

geokat merged 1 commit into
mainfrom
george/fix-go-migrate-cli-after-nixpkgs-upgrade

Conversation

@geokat

@geokat geokat commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #26584.

After the nixpkgs 25.05 update, the default go-migrate package panics at startup due to its Snowflake driver before Postgres commands can run:

[nix-shell:~/coder]$ migrate
panic: failed to parse CA certificate.

goroutine 1 [running]:
github.com/snowflakedb/gosnowflake.readCACerts()
	github.com/snowflakedb/gosnowflake@v1.6.19/ocsp.go:881 +0x225
github.com/snowflakedb/gosnowflake.init.3()
	github.com/snowflakedb/gosnowflake@v1.6.19/ocsp.go:928 +0xf

The panic comes from the combination of Go 1.23+ x509 defaults and a negative-serial certificate in the Snowflake driver's embedded CA bundle. It can be avoided by setting GODEBUG=x509negativeserial=1, but Coder only uses the migrate CLI for migration creation and local Postgres migrations.

This PR overrides the build tags to include only the Postgres driver, which removes the Snowflake startup path entirely.

Follow-up to #26584.

After the nixpkgs 25.05 update, the default go-migrate package panics at
startup due to its Snowflake driver before Postgres commands can run.
Coder only uses the migrate CLI for migration creation and local Postgres
migrations, so override the build tags to include only the Postgres driver.
@geokat
geokat marked this pull request as ready for review June 23, 2026 21:45
@geokat
geokat enabled auto-merge (squash) June 23, 2026 21:51
@geokat
geokat disabled auto-merge June 23, 2026 21:52
@geokat
geokat enabled auto-merge (squash) June 23, 2026 21:53
@geokat
geokat merged commit ff71c1e into main Jun 24, 2026
55 of 56 checks passed
@geokat
geokat deleted the george/fix-go-migrate-cli-after-nixpkgs-upgrade branch June 24, 2026 08:11
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants