balena-io-library / base-images

Balena base images
https://docs.balena.io/reference/base-images/base-images/#balena-base-images
Apache License 2.0
222 stars 85 forks source link

QEMU and CMake Version 3.16.3 (raspberry-pi:buster/raspberry-pi2:buster) #700

Open Paulchen-Panther opened 3 years ago

Paulchen-Panther commented 3 years ago

When using the images raspberry-pi:buster or raspberry-pi2:buster to cross compile a CMake project, CMake does not find the C++/C compiler. The error message is the following:

-- CMake Version: 3.16.3
CMake Error at /usr/share/cmake-3.16/Modules/CMakeCompilerIdDetection.cmake:26 (list):
  list sub-command REMOVE_ITEM requires two or more arguments.
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerId.cmake:211 (compiler_id_detection)
  /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerId.cmake:230 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerId.cmake:32 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:116 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:5 (PROJECT)

-- The CXX compiler identification is unknown

Apparently, Balenalib uses the backports repositories under Buster. When the CMake version is reset to Buster (3.13.4), CMake also finds the C++/C compilers. Since I don't know how far Balenalib updates the QEMU binaries, I can only limit the error to CMake.

Would it be possible to fix this bug in the images without having to downgrade the CMake version?

Thanks in advance for your help.

tomikais commented 3 years ago

Hi @Paulchen-Panther,

I have the same issue when building my project. Do you have a workaround for it? If yes, can you please share it :-)

Thanks, Thomas

Paulchen-Panther commented 3 years ago

Hello @tomikais

As I have seen you have already downgraded the cmake/cmake-data version to 3.13.4-1. In my case (hyperion.docker.ci) this helped.

Greetings, Markus

tomikais commented 3 years ago

Thanks for your fast reply and for your fix. I choose to build it with 'qmake' instead of CMake.