golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.91k stars 17.65k forks source link

cmd/cgo: invalid pkg-config package name: --static #23944

Closed ptoomey3 closed 6 years ago

ptoomey3 commented 6 years ago

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.10 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Irrevelent

What did you do?

I have a project that relies on https://github.com/flier/gohs (golang wrapper around an Intel developed C library called hyperscan). My usage requires that I build the tool that relies on gohs inside of a local directory not related to my GOPATH. So, to make that work I have a script that does something like:

gopath=$(cd "$installdir" && pwd)
cd "$builddir"
GOPATH=$gopath go build

This worked fine in the past (<= 1.9.3), but now I'm getting:

go build github.com/github/myproject/vendor/github.com/flier/gohs/hyperscan: invalid pkg-config package name: --static

If I do a go get github.com/flier/gohs and then do a go build github.com/flier/gohs/hyperscan it builds fine. But, if I try to do the build in a "non-standard" directory I get the whitelist error. I saw that https://go-review.googlesource.com/#/c/94896/ addresses some issue related to --static and was used to close https://github.com/golang/go/issues/23875. It isn't clear to me if that change would affect this use case or not. Let me know if I can provide any extra information to help produce a test case.

What did you expect to see?

The package successfully build

What did you see instead?

The error invalid pkg-config package name: --static

AlexRouSg commented 6 years ago

CC: @ianlancetaylor

bradfitz commented 6 years ago

Dup of #23875, fixed by https://github.com/golang/go/commit/8e402dcaec5509861d463e208f755395af7e6cf1 I think.

Closing, but let me know if that's wrong.

ptoomey3 commented 6 years ago

I just pulled down master and it seems to have solved the issue. Any guesstimate on a point release containing this fix? Thanks!

bradfitz commented 6 years ago

No ETA, sorry.

Neo23x0 commented 6 years ago

I have the same problem with go 1.9.4 linux/amd64. Is this going to be fixed in 1.9 as well?

AlexRouSg commented 6 years ago

It was fixed in 1.9.5 in https://github.com/golang/go/commit/c1bf152756e188f8a34f60b2c708a50eed24a7c6