-
Notifications
You must be signed in to change notification settings - Fork 62
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
Library doesn't build when using mod=vendor #30
Comments
Good find! As you identified, CGO requires non-go files that should be compiled into the binary to be in the same package; this is the reason why the We'd love your contribution to fix this! I checked out keisar#1 - looks great! My only request is you follow the same naming pattern as the |
Hi @joegilley There is one issue with changing the header files names, it means it also needs to be changed in the C files (the #include statements), I can alter the update-h3.sh script to modify the C files while copying them but are you sure about this approach? |
@joegilley I have sent the PR (first one had some issues with CLA so had to recreate). If the current implementation in update-h3.sh is too fragile we can always revert the last commit and leave the header files without the "h3_" prefix. |
included in v3.0.2, thanks @keisar !!! |
When using vendor mode .h files are not copied to the vendor directory because they are in a subdirectory, according to cgo's documentation (https://golang.org/cmd/cgo/) we should not put non-go files in subdirectories.
I have created a fork with all .h files moved from the /include/ subdirectory to the parent library (keisar#1), after these changes the library works in vendor mode.
If all agree I will create the PR here as well.
Another possible solution is to follow this approach: https://github.com/godror/godror/pull/38/files
which means creating dummy go files in the /include subdirectories and importing them from h3.go.
If you prefer I can send a PR for this approach as well.
Related issue: #16
The text was updated successfully, but these errors were encountered: