Open mappu opened 11 months ago
Thank you for the issue and the extensive and clear description!
If I'm understanding correctly, there's no simple workaround for this? In addition to all the C files being in a src
directory, that directory also contains nested sub-directories like liblzma/api
. To make this work with go mod vendor
we'd need to flatten the whole tree entirely? I guess this would be a bit of work because all of the C #include
directives would need to be changed.
Hi! These bindings are great, thank you for your work.
The bindings work correctly in normal go mod use.
However, when using
go mod vendor
, thesrc/
subdirectory is not copied to the vendor subdirectory, and all builds fail with:This is because the src subdirectories are not imported as Go packages (and you can't do so because they contain no Go files). This is a known problem for CGO and as per https://github.com/golang/go/issues/26366#issuecomment-405683150 the only fix is to restructure the source code to put C and Go files in the same directory together.
That's probably difficult if you wanted to stay up to date with any new xz-utils/liblzma releases. So, i don't expect any change really, just an FYI for you or anyone else who sees this comment in future.