Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow importing parse tree proto with cgo disabled #102

Merged
merged 3 commits into from
Dec 2, 2023

Conversation

anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Dec 1, 2023

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
Copy link
Member

lfittl commented Dec 2, 2023

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
1 check passed
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.

None yet

2 participants