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

cannot vendor pg_query_go #125

Open
TotallyGamerJet opened this issue Dec 9, 2024 · 2 comments
Open

cannot vendor pg_query_go #125

TotallyGamerJet opened this issue Dec 9, 2024 · 2 comments

Comments

@TotallyGamerJet
Copy link

This library cannot be vendored because parser/include doesn't contain any go files.

Error:

# github.com/pganalyze/pg_query_go/v6/parser
vendor/github.com/pganalyze/pg_query_go/v6/parser/parser.go:7:10: fatal error: 'pg_query.h' file not found
    7 | #include "pg_query.h"
      |          ^~~~~~~~~~~~
1 error generated.

Reproduce:

package main

import _ "github.com/pganalyze/pg_query_go/v6"

func main() {}
go get github.com/pganalyze/pg_query_go/v6@latest
go mod vendor
go build
@lfittl
Copy link
Member

lfittl commented Dec 9, 2024

@TotallyGamerJet Thanks for opening this issue! This is indeed a problem - I know that you can work around it using additional tools like modvendor.

I'm curious, are you sure its just the missing .go files that are the problem, vs the fact that the files in question are not Go files at all? (if its the former, we may be able to do something, but my assumption has always been that Go's vendor tooling doesn't handle C language files)

@TotallyGamerJet
Copy link
Author

Yes I am sure that it's the missing go files because the other C files in the parser package are present. It's just the ones in the sub directories which are only C and header files. We also came across this in Purego which was fixed by adding empty files.

ebitengine/purego@aeed57c

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

No branches or pull requests

2 participants