Re: Bug#942795: Acknowledgement (libsoxr: Building with "nocheck" results in a broken soxr.pc pkg-config file)
On Wed, Oct 23, 2019 at 05:37:51PM +0200, John Paul Adrian Glaubitz wrote:
> On 10/23/19 5:23 PM, Mattia Rizzolo wrote:
> > This was added by Helmut to fix a FTCBFS. Are you sure removing the
> > -DBUILD_TESTS=0 doesn't break cross builds?
> Yes. You can verify that removing the whole paragraph still makes "nocheck"
> work the what you expect it, i.e.. the testsuite is still not run. I'm not
> sure why that extra paragraph would be needed.
I looked back at the patch and am unsure here. I cannot imagine adding
it just for reducing build time. It must have had an effect at that
time. In general, building tests is not a problem for cross building.
Just running them is. Could it be that the build target would formerly
run the tests?
In any case, asking the question is less useful than simply trying it.
> > Also, the fact that a thing such as BUILD_EXAMPLE affects the content of
> > the .pc files sounds wrong on many levels, so I'd rather see it fixed
> > some other way.
> Indeed. But I have not figured out yet what the issue is. I can just say
> that building with "nocheck" currently results in a broken .pc file.
This is easy enough to diagnose. Just build it twice once without
nocheck and once with. Compare using diffoscope. What happens is that
the nocheck variant garbles the version:
It tries to interpolate PROJECT_VERSION here. According to the cmake
documentation, this is the version given to the most recent invocation
of "project()". There actually are two such invocations and the second
one is guarded by BUILD_EXAMPLES (and lacks a version). So the culprit
is not setting BUILD_TESTS=0, but setting BUILD_EXAMPLES=1, which was
also added by my patch (to try to make the build reproducible, but it
failed doing so)!
So yeah, you should revert that part. Doing so will make it fail to
cross build. Making nocheck work requires a different fix I fear.
Sorry about that. I try to pay attention to detail, but once in a while
a mistake escapes.