5

I'm trying to build a C++ project test suite in Atlasian Bamboo on Windows using CMake and Visual Studio 2015 Community. CMake and VS work fine when running under my user account, but when running them via Bamboo I get the following error:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_C_COMPILER could be found.



CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

I don't think I'm getting this error for the usual reason though. CMake seems to be able to find the compiler itself just fine. Rather, it seems that the resource compiler is the source of the error. In the CMakeFiles/CMakeError.log file, I have the following output:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe
  <<options removed> CMakeCCompilerId.c

C:\Windows\system32\config\systemprofile\AppData\Local\Temp\lnk{ECA1FDDF-C2EA-4
819-AFE3-6A5E06ECA59E}.tmp(1): error RC2135: file not found: C:\Windows\system3
2\config\systemprofile\AppData\Local\Temp\lnk{8A24DD6C-9300-41A6-9CAC-B48137E0E
056}.tmp [C:\bamboo\bamboo-agent-home\...\CMakeFiles\3.6.1\CompilerIdC\CompilerIdC.vcxproj]

I don't really understand the path reported for starters. Is that a symlink or something? Why is the resource compiler even involved? Anyone have any idea why it can't find the file?

Jason Watkins
  • 3,766
  • 1
  • 25
  • 39
  • Have you loaded the visual studio variables with the vcvars batch file in the command prompt or wherever you execute it? http://stackoverflow.com/q/84404/2799037 – usr1234567 Aug 13 '16 at 21:42

1 Answers1

4

I have had this problem; it is a result of installing a Bamboo remote agent as a service, under Windows, with it running under a local user account (rather than a system account).

The issue appears to be that the TEMP and TMP environment variables are set to c:\windows\system32\config\systemprofile, which would be appropriate for a system account, but is not appropriate for a local user account. It can't access them and so cmake falls over.

A workaround is to edit $BAMBOO_AGENT_HOME\conf\wrapper.conf and add the lines

set.TEMP=c:/some/path
set.TMP=c:/some/path

As well as setting java's tmpdir by adding:

wrapper.java.additional.#=-Djava.io.tmpdir="C:/some/path"

Where '#' is the next number in the sequence of wrapper.java.additional values.

James Picone
  • 1,509
  • 9
  • 18
  • This should be accepted as an answer. set.TMP and set.TEMP are essential and finally fixed this error for me. – autonomy Aug 21 '19 at 19:24