Summary: | net-irc/znc-9999 fails to compile tests with distcc | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alexey <alexey+gentoo> |
Component: | Current packages | Assignee: | Louis Sautier (sbraz) <sbraz> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | chewi |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build.log
envcompile envtest1 - very start of src_test() envtest - just before inttest emerge --info |
Created attachment 594970 [details]
envcompile
Created attachment 594972 [details]
envtest1 - very start of src_test()
Created attachment 594974 [details]
envtest - just before inttest
Created attachment 594976 [details]
emerge --info
It's because the CMake files have CMake reinvoke itself without the usual args we add in the eclass. See the bottom of test/CMakeLists.txt. This might be tricky to fix. Looks like this patch fixes it. Is there any other arg I need to pass? diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cffe3818..87197c2c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -77,9 +77,7 @@ externalproject_add(inttest_bin BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/integration" INSTALL_COMMAND "" CMAKE_CACHE_ARGS - # Note the space in the end: protect from CXXFLAGS env var, but - # still support custom flags - "-DCMAKE_CXX_FLAGS:string=${INTEGRATION_TEST_CXX_FLAGS} " + "-DCMAKE_TOOLCHAIN_FILE:path=${CMAKE_TOOLCHAIN_FILE}" "-DGTEST_ROOT:path=${GTEST_ROOT}" "-DGMOCK_ROOT:path=${GMOCK_ROOT}" "-DZNC_BIN_DIR:path=${CMAKE_INSTALL_FULL_BINDIR}" I guess that alone is enough to fix it but reinvoking CMake like that isn't ideal and could cause other issues. Given this is just for src_test, this is probably sufficient though. I'll like sbraz decide what to do. This worked before; is it possible that CXX env variable was set by src_test, but now it's not? Such variable would cause the inner CMake to select correct compiler. How do other projects deal with externalproject_add() command? Sorry, Alexey, I didn't realise you were upstream. You will definitely know CMake better than I do so I can't provide a better answer. I've submitted https://github.com/znc/znc/commit/961881b0321b9091adaf2ba3efa4a738b85b76a9 which seems to handle several cases I can think of. I don't know whether it's worth it to add the patch for 1.7.4 and 1.7.5 to portage tree. Thanks for help! I'd say such test failures aren't huge problems, I'd rather wait for 1.7.6. |
Created attachment 594968 [details] build.log In the Compile phase, it uses /usr/lib/distcc/bin/armv7a-unknown-linux-gnueabihf-g++ correctly. In the Test phase, it starts using /usr/lib/distcc/bin/c++ instead, and the result is being miscompiled for a wrong architecture. [1/2] Building CXX object CMakeFiles/cmTC_2d9e8.dir/testCXXCompiler.cxx.o [2/2] Linking CXX executable cmTC_2d9e8 FAILED: cmTC_2d9e8 : && /usr/lib/distcc/bin/c++ -Wl,-O1 -Wl,--as-needed -rdynamic CMakeFiles/cmTC_2d9e8.dir/testCXXCompiler.cxx.o -o cmTC_2d9e8 && : CMakeFiles/cmTC_2d9e8.dir/testCXXCompiler.cxx.o: file not recognized: file format not recognized collect2: error: ld returned 1 exit status distcc[204] ERROR: compile (null) on localhost failed Additionally, unit test is compiled correctly, but integration test is not. I was advised to add "env > $T/envcompile" statements to src_compile() and src_test() to debug this better, so attaching those as well.