Cannot Build project using the build-wrapper

Is it possible to give a python build script when using the build-wrapper? When I try the following:

build-wrapper-win-x86-64.exe --out-dir .\\build python build.py

I get the following output:

-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc.exe
-- Check for working C compiler: C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc.exe - broken

We are using CMake and NXP tooling, compiling it on a windows machine. The python script sets some pre conditions and adds the right flags based on on the build configuration.

What I have tried:

  1. Change the permission for the build-wrapper and dependencies:
    • All of the tooling has the Full Control permission for all users
  2. Call make directly:
    • Following some other posts, I tried to call make directly after calling cmake.:
build-wrapper-win-x86-64.exe --out-dir .\\build C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/msys32/usr/bin/make.exe

It does not work. Make just exits. It does work if I don’t use it via the build-wrapper.

The build-wrapper.log does not have anything useful:

Thu Jul 06 15:33:01 2023: build-wrapper, version 6.46.1 (win-x86-64)
Thu Jul 06 15:33:01 2023: isWow64: 0
Thu Jul 06 15:33:01 2023: windows version: 10.0, service pack: 0.0, build number: 19045, product type: 1
Thu Jul 06 15:33:01 2023: current directory: D:\BuildServerAgents\local_windows_agent\workspace\project
Thu Jul 06 15:33:01 2023: cwd: <D:\BuildServerAgents\local_windows_agent\workspace\project>
Thu Jul 06 15:33:01 2023: out-dir absolute path: <D:\BuildServerAgents\local_windows_agent\workspace\project\build>
Thu Jul 06 15:33:01 2023: command line received: <C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/msys32/usr/bin/make.exe>
Thu Jul 06 15:33:01 2023: initializing json file
Thu Jul 06 15:33:01 2023: starting debug cycle
Thu Jul 06 15:33:01 2023: process created with pid: 7376
Thu Jul 06 15:33:01 2023: image path name: <C:\NXP\S32DS_ARM_v2.2\S32DS\build_tools\msys32\usr\bin\make.exe>
Thu Jul 06 15:33:01 2023: command line: <C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/msys32/usr/bin/make.exe>
Thu Jul 06 15:33:01 2023: working directory: <D:\BuildServerAgents\local_windows_agent\workspace\project\>
Thu Jul 06 15:33:01 2023: isWow64: 1
Thu Jul 06 15:33:01 2023: skipping process C:\NXP\S32DS_ARM_v2.2\S32DS\build_tools\msys32\usr\bin\make.exe with pid: 7376
Thu Jul 06 15:33:01 2023: process with pid 7376 exit with code: 1080890248 (0x406D1388)
Thu Jul 06 15:33:01 2023: finalizing json file

Hi @augustodepaula,

build-wrapper should wrap clean build. What you describing might happen if you are not doing "clean " before building. Ao “make” command is ending up doing nothing.

What happens if you execute make without build-wrapper? does it build the entire project?

Thanks,

Hi Abbas,

If I don’t use the wrapper, make builds the entire project normally. It is weird that the make command when using the wrapper just exits with a code. I haven’t been able to verify what the exit code means. Will check that with NXP

I am using python.subprocess in order to run the commands from my python script. I don’t know if the wrapper conflicts with that sort of interface

Hey @augustodepaula,

I’m a bit confused. You mentioned that you are trying with the raw make then you jumped to Python. Let’s try to understand what happened there.

Does the same make command lead to the project compilation without build-wrapper?
Are you executing it in the same environment with and without build-wrapper? both clean build? same command line?

can you share the full command-line output of these two commands(make sure to run them from the same directory and environment):

  1. C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/msys32/usr/bin/make.exe
  2. build-wrapper-win-x86-64.exe --out-dir .\\build C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/msys32/usr/bin/make.exe

Thanks,

Hi Abbas,

I will be taking over the communication for augustodepaula.

We are trying to run a python script which calls cmake and make. So we do not call make directly in the same command as that of the wrapper.

Full command-line output for point 1:

C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/msys32/usr/bin/make.exe
make: *** No targets specified and no makefile found.  Stop.

Full command-line output for point 2 (it doesn’t produce any output):

& $env:SONAR_DIRECTORY/build-wrapper-win-x86/build-wrapper-win-x86-64.exe --out-dir build C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/msys32/usr/bin/make.exe

It does produce a build-wrapper.log file in the build/ directory. This looks the same as augustodepaula has also mentioned already in his first post.

You were right in that we needed to perform a clean. It turns out that we already receive an error when executing the cmake command.

-- The C compiler identification is GNU 6.3.1
-- The CXX compiler identification is GNU 6.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc.exe
-- Check for working C compiler: C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/lucophilipsen/Documents/Code/<repository>/build/CMakeFiles/CMakeScratch/TryCompile-qmvikh

    Run Build Command(s):C:/Program Files/CMake/bin/cmake.exe -E env VERBOSE=1 C:/NXP/S32DS_ARM_v2.2/S32DS/build_tools/msys32/usr/bin/make.exe -f Makefile cmTC_32f0a/fast &&




  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:147 (project)

When we call this script without the wrapper, everything compiles just fine. Both with a clean build and without. Also using the same command line.

Hello @lucophilipsen, @augustodepaula ,

We have managed to identify a situation where the make command may end with such an error code:
CPP-4581

Basically, for this toolchain make behaves differently when it detects it is attached by a debugger, raising signals to let the debugger know about thread names.

The build wrapper does not expect this kind of special behavior, it does not handle the signal, and the inspected process (make) fails.

I can send you privately a tentative patched version that should fix the issue, but we have yet to decide what is the best curse of action.

Hello Alejandro,

That sounds very promising! I would love to give it a shot. Could you indeed send it to me so I can see if that fixes our problem?

Hello Alessandro, i’m facing a similar issue with the same IDE. I think this tentative patch could be useful. Is there a way to get access to this patch? Will it be available in a next release of the wrapper?

Hi,

The fixed build wrapper was shipped with SonarQube 10.2

Ok. Thanks