Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Tests are broken for some distros on new conky versions #2131

Open
zlice opened this issue Jan 4, 2025 · 8 comments
Open

[Bug]: Tests are broken for some distros on new conky versions #2131

zlice opened this issue Jan 4, 2025 · 8 comments
Assignees
Labels
build system related to build system (CMake) and/or building process/assumptions regression something that worked previously but was broken at some point by some commit

Comments

@zlice
Copy link
Contributor

zlice commented Jan 4, 2025

What happened?

In 1.22.0, void-linux started failing during build running test-conky in a cross compile environment. This is because cmake/CatchAddTests.cmake was changed and is not only building tests/test-conky but running it during build. Trying to configure with -DBUILD_TESTS=OFF does not seem to fix the problem.

1.21.9 was working.

Is it possible to not run if BUILD_TESTS=OFF ? I did a hacky echo "" > cmake/CatchAddTests.cmake but there's probably a better place to just skip that in the build somewhere.

[112/114] Building CXX object tests/CMakeFiles/Catch2.dir/catch2/catch_amalgamated.cpp.o
[113/114] Linking CXX static library tests/libCatch2.a
[114/114] Linking CXX executable tests/test-conky
FAILED: tests/test-conky tests/test-conky-b12d07c_tests.cmake /builddir/conky-1.22.0/build/tests/test-conky-b12d07c_tests.cmake 
: && /builddir/.xbps-conky/wrappers/aarch64-linux-musl-c++ -DNDEBUG -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -march=armv8-a   -I/usr/aarch64-linux-musl/usr/include -ffile-prefix-map=/builddir/conky-1.22.0/build=. -Wl,-z,relro -Wl,-z,now -Wl,--as-needed    -L/usr/aarch64-linux-musl/usr/lib tests/CMakeFiles/test-conky.dir/test-common.cc.o tests/CMakeFiles/test-conky.dir/test-algebra.cc.o tests/CMakeFiles/test-conky.dir/test-colours.cc.o tests/CMakeFiles/test-conky.dir/test-conky.cc.o tests/CMakeFiles/test-conky.dir/test-core.cc.o tests/CMakeFiles/test-conky.dir/test-diskio.cc.o tests/CMakeFiles/test-conky.dir/test-fs.cc.o tests/CMakeFiles/test-conky.dir/test-gradient.cc.o tests/CMakeFiles/test-conky.dir/test-graph.cc.o tests/CMakeFiles/test-conky.dir/test-linux.cc.o -o tests/test-conky  tests/libCatch2.a  src/libconky_core.a  -lm  -lcurses  /usr/aarch64-linux-musl/usr/lib/libiw.so  /usr/aarch64-linux-musl/usr/lib/libX11.so  /usr/aarch64-linux-musl/usr/lib/libXext.so  /usr/aarch64-linux-musl/usr/lib/libXdamage.so  /usr/aarch64-linux-musl/usr/lib/libXfixes.so  /usr/aarch64-linux-musl/usr/lib/libXft.so  /usr/aarch64-linux-musl/usr/lib/libfontconfig.so  /usr/aarch64-linux-musl/usr/lib/libXinerama.so  /usr/aarch64-linux-musl/usr/lib/libXext.so  /usr/aarch64-linux-musl/usr/lib/libXdamage.so  /usr/aarch64-linux-musl/usr/lib/libXfixes.so  /usr/aarch64-linux-musl/usr/lib/libXft.so  /usr/aarch64-linux-musl/usr/lib/libfontconfig.so  /usr/aarch64-linux-musl/usr/lib/libXinerama.so  /usr/aarch64-linux-musl/usr/lib/libxcb.so  -L/usr/aarch64-linux-musl/usr/lib64  -lImlib2  /usr/aarch64-linux-musl/usr/lib64/libcurl.so  /usr/aarch64-linux-musl/usr/lib64/libxml2.so  3rdparty/toluapp/libtoluapp.a  /usr/aarch64-linux-musl/usr/lib/liblua5.3.so  /usr/aarch64-linux-musl/usr/lib/libm.a  3rdparty/Vc/libVc.a  src/libtcp-portmon.a && cd /builddir/conky-1.22.0/build/tests && /usr/libexec/xbps-src/bin/cmake -D TEST_TARGET=test-conky -D TEST_EXECUTABLE=/builddir/conky-1.22.0/build/tests/test-conky -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/builddir/conky-1.22.0/build/tests -D TEST_SPEC= -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=SKIP_RETURN_CODE;4" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_LIST=test-conky_TESTS -D TEST_REPORTER= -D TEST_OUTPUT_DIR= -D TEST_OUTPUT_PREFIX= -D TEST_OUTPUT_SUFFIX= -D TEST_DL_PATHS= -D TEST_DL_FRAMEWORK_PATHS= -D CTEST_FILE=/builddir/conky-1.22.0/build/tests/test-conky-b12d07c_tests.cmake -P /builddir/conky-1.22.0/cmake/CatchAddTests.cmake
CMake Error at /builddir/conky-1.22.0/cmake/CatchAddTests.cmake:85 (message):
  Error running test executable
  '/builddir/conky-1.22.0/build/tests/test-conky':

    Result: Unknown system error -8
    Output: 

Call Stack (most recent call first):
  /builddir/conky-1.22.0/cmake/CatchAddTests.cmake:190 (catch_discover_tests_impl)

Version

1.22.0

Which OS/distro are you seeing the problem on?

Linux (other)

Conky config

No response

Stack trace

No response

Relevant log output

No response

@zlice zlice added bug related to incorrect existing implementation of some functionality triage issue that hasn't been verified, categorized or acknowledged yet labels Jan 4, 2025
@denibertovic
Copy link

I'm seeing this on nixos as well when trying to upgrade to the latest version.

@Caellian Caellian added build system related to build system (CMake) and/or building process/assumptions regression something that worked previously but was broken at some point by some commit and removed bug related to incorrect existing implementation of some functionality triage issue that hasn't been verified, categorized or acknowledged yet labels Jan 4, 2025
@Caellian
Copy link
Collaborator

Caellian commented Jan 4, 2025

Probable cause: #2114

I updated the file without applying any modifications to it. It's possible the file was modified when first added, but it's large and that's difficult to maintain.
But the BUILD_TESTS flag is separate and activated by MAINTAINER_MODE.

@Caellian Caellian self-assigned this Jan 4, 2025
@brndnmtthws
Copy link
Owner

As noted by @Caellian, set MAINTAINER_MODE=OFF as a workaround in the meantime. You shouldn't really need that on anyway.

@Caellian
Copy link
Collaborator

Caellian commented Jan 4, 2025

The thing that's maybe not clear from our previous comments is that BUILD_TEST is (currently) copied from MAINTAINER_MODE, it can't be configured on its own (always been the case). I'm working on a PR that adds more granular control for building and running these, so that MAINTAINER_MODE controls the defaults instead of forcing the value (to avoid confusion).

While (some) tests should probably work on nix and void, running them every update will just degrade your CPU and waste your time. Tests get executed by CI for every PR before it gets merged, so they're definitely passing, even though they could benefit from being more portable.

To be clear, MAINTAINER_MODE should not be used by users. Once BUILD_TEST and RUN_TESTS are separate, they could but probably shouldn't be enabled for user-build (e.g. AUR, Gentoo). Package maintainers could enable those two (but not MAINTAINER_MODE) for precompiled binaries that are built before being distributed. MAINTAINER_MODE forces debug build which is completely unoptimized and bad for end-users, otherwise the build is always "RelWithDebugInfo".

Nix file provided by the repo doesn't enable MAINTAINER_MODE by default, void template in void-packages does and it shouldn't. Patching tests means that the flag only adds "-O0".

MAINTAINER_MODE is for development environment and automated testing in this repo.

@brndnmtthws
Copy link
Owner

Don't know about void, but for some reason they do enable maintainer mode in the Nix package: https://github.com/NixOS/nixpkgs/blob/d29ab98cd4a70a387b8ceea3e930b3340d41ac5a/pkgs/os-specific/linux/conky/default.nix#L176

I think this is probably due to some confusion about who the "maintainer" is. The intent here was that the flag is for Conky maintainers, not the downstream distro package maintainers.

@zlice
Copy link
Contributor Author

zlice commented Jan 4, 2025

yes, maintainer mode is on for the void build as well

@Caellian Caellian added bug related to incorrect existing implementation of some functionality wontfix not a conky bug, unreasonable effort required to fix or can't be fixed due to external limitations and removed regression something that worked previously but was broken at some point by some commit labels Jan 4, 2025
@zlice
Copy link
Contributor Author

zlice commented Jan 5, 2025

confirmed turning off MAINTAINER_MODE and everything is fine. thanks

edit: actually MAINTAINER_MODE off and BUILD_TESTS on still fails. so not sure what you want to do with this

@Caellian Caellian changed the title [Bug]: BUILD_TESTS=OFF doesn't turn off running test-conky (crossbuild) [Bug]: Tests are broken for some distros on new conky versions Jan 5, 2025
@Caellian Caellian added regression something that worked previously but was broken at some point by some commit and removed bug related to incorrect existing implementation of some functionality wontfix not a conky bug, unreasonable effort required to fix or can't be fixed due to external limitations labels Jan 5, 2025
@Caellian
Copy link
Collaborator

Caellian commented Jan 5, 2025

so not sure what you want to do with this

I'm repurposing this issue for tracking that problem for Void and Nix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system related to build system (CMake) and/or building process/assumptions regression something that worked previously but was broken at some point by some commit
Projects
None yet
Development

No branches or pull requests

4 participants