I want to run an inline script that executes cmake command to generate the build files for my c/c++ unit tests. The Bamboo agent runs on a Windows 10 OS. I installed cygwin on the Agent's server to have cmake up and running. If I run cmake directly on prompt, on the Agent's server, everything works fine.
If I run the same command in my Bamboo script I get the following error:
I:\bamboo-agent-home\xml-data\build-dir\CIMX-XFU-JOB1>cmake . -Bbuild
-- CMAKE_BINARY_DIR=/cygdrive/i/bamboo-agent-home/xml-data/build-dir/CIMX-XFU-JOB1/build
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/gcc.exe
-- Check for working C compiler: /usr/bin/gcc.exe -- broken
CMake Error at /usr/share/cmake-3.14.5/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/usr/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/i/bamboo-agent-home/xml-data/build-dir/CIMX-XFU-JOB1/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make.exe cmTC_7f576/fast
/usr/bin/make -f CMakeFiles/cmTC_7f576.dir/build.make CMakeFiles/cmTC_7f576.dir/build
make[1]: Entering directory '/cygdrive/i/bamboo-agent-home/xml-data/build-dir/CIMX-XFU-JOB1/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_7f576.dir/testCCompiler.c.o
/usr/bin/gcc.exe -o CMakeFiles/cmTC_7f576.dir/testCCompiler.c.o -c /cygdrive/i/bamboo-agent-home/xml-data/build-dir/CIMX-XFU-JOB1/build/CMakeFiles/CMakeTmp/testCCompiler.c
C:/cygwin64/lib/gcc/x86_64-pc-cygwin/7.4.0/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
make[1]: *** [CMakeFiles/cmTC_7f576.dir/build.make:66: CMakeFiles/cmTC_7f576.dir/testCCompiler.c.o] Error 1
make[1]: Leaving directory '/cygdrive/i/bamboo-agent-home/xml-data/build-dir/CIMX-XFU-JOB1/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_7f576/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:34 (project)
-- Configuring incomplete, errors occurred!
See also "/cygdrive/i/bamboo-agent-home/xml-data/build-dir/CIMX-XFU-JOB1/build/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/i/bamboo-agent-home/xml-data/build-dir/CIMX-XFU-JOB1/build/CMakeFiles/CMakeError.log".
CMake tries to compile a simple C application in order to test the gcc compiler, but it fails. I tried to compile the same application using gcc and it works. It seems there is a problem between cmake and Bamboo.
In the Bamboo script, I include the path to cygwin(C:\cygwin64\bin) into the environment variable PATH
Any idea on what can cause the issue?