rpm-software-management / rpm

The RPM package manager
http://rpm.org
Other
505 stars 364 forks source link

Random test-program build failures in CI #2356

Closed pmatilai closed 1 year ago

pmatilai commented 1 year ago

I'm currently seeing random CI runs on Semaphore failing with the following:

[ 12%] Built target librpmio [ 12%] Building C object tests/CMakeFiles/rpmpgpcheck.dir/rpmpgpcheck.c.o [ 12%] Building C object tests/CMakeFiles/rpmpgppubkeyfingerprint.dir/rpmpgppubkeyfingerprint.c.o [ 12%] Linking C shared library librpmio.so [ 13%] Linking C executable rpmpgpcheck [ 14%] Linking C executable rpmpgppubkeyfingerprint /usr/bin/ld: CMakeFiles/rpmpgpcheck.dir/rpmpgpcheck.c.o: in function main': rpmpgpcheck.c:(.text+0x136): undefined reference topgpPrtParams' /usr/bin/ld: rpmpgpcheck.c:(.text+0x173): undefined reference to pgpDigParamsFree' /usr/bin/ld: rpmpgpcheck.c:(.text+0x1a0): undefined reference topgpPrtParams' /usr/bin/ld: rpmpgpcheck.c:(.text+0x1dd): undefined reference to pgpDigParamsFree' /usr/bin/ld: rpmpgpcheck.c:(.text+0x222): undefined reference topgpPrtParams' /usr/bin/ld: rpmpgpcheck.c:(.text+0x25d): undefined reference to pgpDigParamsFree' /usr/bin/ld: rpmpgpcheck.c:(.text+0x28a): undefined reference topgpPrtParams' /usr/bin/ld: rpmpgpcheck.c:(.text+0x2c5): undefined reference to `pgpDigParamsFree' collect2: error: ld returned 1 exit status make[3]: [tests/CMakeFiles/rpmpgpcheck.dir/build.make:98: tests/rpmpgpcheck] Error 1 make[2]: [CMakeFiles/Makefile2:1301: tests/CMakeFiles/rpmpgpcheck.dir/all] Error 2 make[2]: *** Waiting for unfinished jobs.... [ 14%] Built target librpmio

A random linkage failure on a parallel build suggests a missing dependency, but these test programs do have "target_link_libraries(${prg} PRIVATE librpmio)" so that's supposedly covered. But looking at this log, "built target librpmio" happens twice here, and the latter only after attempting to build a program that needs it. So something fishy here.

I haven't been able to reproduce it locally, and while I think I've seen the unexplained failure or two last year as well, it seems to be happening a whole lot more recently (as in, the last couple of weeks).

So this is as much a bug report as info to contributors: something's fishy, and we're aware. If the build fails like this, it probably wasn't your fault.

pmatilai commented 1 year ago

This should be more or less fixed as of #2357 but leaving open until further proof arrives. The simple fool-proof fix is to separate "make all" and "make check" in the CI script but for correctness sake "make check" alone should work too.

dmnks commented 1 year ago

Yup, we're also going to adjust these targets slightly with #1580 soon, anyway.

pmatilai commented 1 year ago

Okay, this seems to be fixed now really, closing.