webp
webp copied to clipboard
Problem with macos build
I try to build application which use webp library and can't build it with enabled CGO:
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -ldflags "-X main.Version=2.1.29 -X main.Build=`git rev-parse HEAD` -X main.BuildTime=`date +%FT%T%z`" -o bin
I have gcc installed.
facing the same issue. just curious. are you using go modules?
Having the same issue here. I'm trying to migrate my project to go modules :/
if you take a look inside the vendor folder, you won't find internal
directory where webp.h
should be located.
since i commit my vendor directory, i just git clone
this repo inside vendor
directory.
there probably should be a better way =\
I just found the solution actually. The go modules tool is not able to resolve C dependencies so it doesn't see that some .c
/.h
files are actually in the internal
package of the chai2010/webp
lib. Just copy it by hand in the vendor folder and it should work :)
Hahaha perfect #RaceCondition
@ns3777k I'm facing same issue with govendor
, with govendor
you can install this package via
govendor fetch github.com/chai2010/webp/^
More details please refer to kardianos/govendor#137 and here.
For now, Go module prunes non-package directories, see more discussions in golang/go#26366.
Some useful tools:
- https://github.com/nomad-software/vend
- https://github.com/goware/modvendor
Is there a way to fix this bug on inside chai2010/webp
? I feed like go vendoring is much less useful if you need to utilize external tools to make it work...
I don't think we can find a way to fix this bug inside this project, this is kind a issue(feature lacking) of go mod
.
For those coming across this issue who are using dep, a workaround is to add
[prune]
go-tests = true
unused-packages = true
[[prune.project]]
name = "github.com/chai2010/webp"
go-tests = false
unused-packages = false
to your Gopkg.toml to stop the pruning of the C code.
@chai2010, good day. The issue is still actual for go mod dependency management with vendoring. Should we expect any changes that would make module to be downloaded with internals via go mod?