Moving from 1.19.x to 1.20.x

I moved from 1.19.4 to 1.20.2 and while build process passed ok I faced issue with tests…

Running “go test ./…” in some point I recived the error message:
go build github.com/influxdata/flux/libflux/go/libflux:

pkg-config --cflags – flux

pkg-config: exec: “pkg-config”: executable file not found in $PATH
And I’m running on Windows…

Actually I tried it also on Linux and Mac and I got pretty much the same error.

Any idea?

HI @Kobi_Gana ,

The flux readme advises to install pkg-config and a „pkg-config wrapper“. IMHO, the instructions for installing the wrapper are outdated. „go get“ downloads only, but does not compile and install a binary.

Try using go install instead:

go install github.com/influxdata/pkg-config@latest

Then use which -a pkg-config to verify it the wrapper is found before the actual pkg-config binary.

I see and thank you for your answer
The thing is that with 1.19.7 it wasn’t required…
And from my perspective it is kind of a regression…
Coz’ I don’t think for testing I need to have pkg-config…
WDYT?

P.S.
I’m working on Windows… so why do I need pkg-config?

I see your point. I have no idea what might have changed.

In any case, the error message is clear: go test cannot find the binary pkg-config (or rather, the wrapper) in $PATH. The first step would thus be to ensure that the binary and the wrapper are installed.

Curious: have you tried rolling back to Go 1.19 and repeat the test? I wonder if the problem is with Go or rather with the latest flux release that was published two weeks ago.

And there is an interesting detail in the flux repo:

Chances are that this fix breaks path handling on Windows.

I have no better explanation at the moment. If the binary and the wrapper are properly installed and the error does not go away, I’d suggest reaching out to the flux team; they would be in a better position to track down the source of this error.

Hi,
Of course I rolled back and go test worked as before.
The most interesting thing is that on version 1.20.2 “go build” works ok and only the “go test” failed.

Thank you for your advice

I agree, this is a weird behavior indeed.

I tried replicating the error, but at my end, go test fails a lot but without any errors that mention pkg-config. (on macOS)

Even go build does not work as advertised. I am afraid I cannot dig further into this.

Maybe you can find some helpful output through go test -v ./....

I think I recognise this style of error. My thought is on the lines of some code (the flux package?) setting up command line flags in an init() function, thus hijacking the flag handling of the test.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.