diff --git a/Makefile b/Makefile index 894a38df78..7e213cfb03 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,16 @@ CGO_ENABLED = 1 COMMIT_HASH := $(shell git --no-pager describe --tags --always --dirty) LDFLAGS = "-X github.com/sqlc-dev/sqlc/internal/info.Version=$(COMMIT_HASH)-wicked-fork" +# macOS 15.4+ needs strchrnul fix +BUILD_ENV = $(shell [ "$$(uname -s)" = "Darwin" ] && [ "$$(sw_vers -productVersion | cut -d. -f1)" -ge 15 ] && echo 'MACOSX_DEPLOYMENT_TARGET=15.4 CGO_CFLAGS="-DHAVE_STRCHRNUL"') .PHONY: build build-endtoend test test-ci test-examples test-endtoend regen start psql mysqlsh proto build: - CGO_ENABLED=$(CGO_ENABLED) go build -ldflags=$(LDFLAGS) -o bin/ ./cmd/... + $(BUILD_ENV) CGO_ENABLED=$(CGO_ENABLED) go build -ldflags=$(LDFLAGS) -o bin/ ./cmd/... install: - CGO_ENABLED=$(CGO_ENABLED) go install -ldflags=$(LDFLAGS) ./cmd/... + $(BUILD_ENV) CGO_ENABLED=$(CGO_ENABLED) go install -ldflags=$(LDFLAGS) ./cmd/... test: CGO_ENABLED=$(CGO_ENABLED) go test ./... diff --git a/internal/codegen/golang/driver.go b/internal/codegen/golang/driver.go index 5b89f2db8c..42e8f5486f 100644 --- a/internal/codegen/golang/driver.go +++ b/internal/codegen/golang/driver.go @@ -16,7 +16,7 @@ const ( SQLDriverPGXV5 = "github.com/jackc/pgx/v5" SQLDriverLibPQ = "github.com/lib/pq" SQLDriverGoSQLDriverMySQL = "github.com/go-sql-driver/mysql" - SQLDriverWPGX = "github.com/stumble/wpgx" + SQLDriverWPGX = "github.com/one2x-ai/wpgx" ) func parseDriver(sqlPackage string) SQLDriver { diff --git a/internal/codegen/golang/imports.go b/internal/codegen/golang/imports.go index c961cd5349..79ca92d4bf 100644 --- a/internal/codegen/golang/imports.go +++ b/internal/codegen/golang/imports.go @@ -130,7 +130,7 @@ func (i *importer) dbImports() fileImports { pkg = append(pkg, ImportSpec{Path: "github.com/jackc/pgx/v5"}) case SQLDriverWPGX: std = []ImportSpec{} - pkg = append(pkg, ImportSpec{Path: "github.com/stumble/wpgx"}) + pkg = append(pkg, ImportSpec{Path: "github.com/one2x-ai/wpgx"}) pkg = append(pkg, ImportSpec{Path: "github.com/stumble/dcache"}) default: std = append(std, ImportSpec{Path: "database/sql"}) @@ -496,7 +496,7 @@ func (i *importer) batchImports() fileImports { case SQLDriverPGXV5: pkg[ImportSpec{Path: "github.com/jackc/pgx/v5"}] = struct{}{} case SQLDriverWPGX: - pkg[ImportSpec{Path: "github.com/stumble/wpgx"}] = struct{}{} + pkg[ImportSpec{Path: "github.com/one2x-ai/wpgx"}] = struct{}{} } return sortedImports(std, pkg) diff --git a/scripts/release.go b/scripts/release.go index a8651a6ee7..682ebed7aa 100755 --- a/scripts/release.go +++ b/scripts/release.go @@ -32,7 +32,7 @@ func main() { } if *docker { - x := "-extldflags \"-static\" -X github.com/sqlc-dev/sqlc/internal/cmd.version=" + version + x := "-extldflags \"-static\" -X github.com/sqlc-dev/sqlc/internal/info.Version=" + version args := []string{ "build", "-a",