Skip to content

Commit

Permalink
Move CGO requirement to the effected code
Browse files Browse the repository at this point in the history
Forcing `CGO_ENABLED=1` in the Makefile is too far away from the reason
we do it. Use a build constraint instead with a comment and link.

See: 67fe735
  • Loading branch information
cbandy committed Dec 23, 2024
1 parent 0ddd01a commit a2c6c48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ deploy-dev: createnamespaces
##@ Build - Binary
.PHONY: build-postgres-operator
build-postgres-operator: ## Build the postgres-operator binary
CGO_ENABLED=1 $(GO_BUILD) $(\
$(GO_BUILD) $(\
) --ldflags '-X "main.versionString=$(PGO_VERSION)"' $(\
) --trimpath -o bin/postgres-operator ./cmd/postgres-operator

Expand Down
3 changes: 3 additions & 0 deletions internal/postgres/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
//
// SPDX-License-Identifier: Apache-2.0

// [pg_query.Parse] requires CGO to compile and call https://github.com/pganalyze/libpg_query
//go:build cgo

package postgres

import (
Expand Down

0 comments on commit a2c6c48

Please sign in to comment.