Skip to content

Allow importing parse tree proto with cgo disabled - #102

Merged
lfittl merged 3 commits into
pganalyze:mainfrom
anuraaga:pb-nocgo
Dec 2, 2023
Merged

lfittl merged 3 commits into
pganalyze:mainfrom
anuraaga:pb-nocgo

Conversation

@anuraaga

@anuraaga anuraaga commented Dec 1, 2023

Copy link
Copy Markdown
Contributor

I am interested in using just the proto definition in an environment without cgo. Currently, this does not work because

  • The only Go file in parser package requires cgo, and Go doesn't allow a package with no Go files
  • pg_query.go imports names from parser and requires cgo

Would this change be OK to allow the proto to be used by itself without cgo required?

@lfittl

lfittl commented Dec 2, 2023

Copy link
Copy Markdown
Member

Thanks for the contribution! - I think that seems acceptable and doesn't hurt the use case where cgo is available.

I'll push up a small adjustment to also add the same build tag to the test files in the top level folder, so running CGO_ENABLED=0 make doesn't fail. Of course it doesn't actually do anything at this point, but that could be changed in the future when there is something to test that doesn't require cgo.

@lfittl
lfittl merged commit 7972fca into pganalyze:main Dec 2, 2023
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.

2 participants