Skip to content

fix: make the native libpostal backend opt-in - #1129

Open
immanuwell wants to merge 1 commit into
owasp-amass:developfrom
immanuwell:fix/libpostal-build-tags
Open

immanuwell wants to merge 1 commit into
owasp-amass:developfrom
immanuwell:fix/libpostal-build-tags

Conversation

@immanuwell

@immanuwell immanuwell commented May 23, 2026

Copy link
Copy Markdown

Native libpostal was getting picked whenever cgo was on. On a pretty normal Linux box, that makes go test ./... blow up if pkg-config cant find libpostal, even though the HTTP fallback is already there.

This makes the native path opt-in via -tags libpostal. Default builds use the fallback now, tagged builds still use the cgo backend. Small fix, but it saves a dumb install footgun.

Repro

go env CGO_ENABLED
go test ./...

Before

Package 'libpostal', required by 'virtual:world', not found

Checks

go test ./...
go list -f '{{.GoFiles}} {{.CgoFiles}}' ./internal/libpostal
go list -tags libpostal -f '{{.GoFiles}} {{.CgoFiles}}' ./internal/libpostal

On this machine the default path now picks pure_go.go, and the tagged path still picks cgo_specific.go.

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