Adding windows build wrapper failing to build project due to CRLN

SonarQube 8.4.1, build wrapper 6.11

I have a cygwin build that I am trying to get the c/c++ analysis done. The project builds fine when I don’t scan. The project fails to build as soon as I added the wrapper. I looks to be an issue with the handling of the \r vs \r\n that windows build wrapper is expecting.

For my normal build, the following works:
sh native.sh -j release

When I add the wrapper it fails
build-wrapper-win-x86-64.exe --out-dir …/…/build_wrapper_output_directory sh native.sh -j release
08:10:48 CCLD libjpeg.la
08:10:50 CCLD cjpeg.exe
08:10:50 ./libjpeg.la: line 6: $’\r’: command not found

08:10:50 ./libjpeg.la: line 12: $’\r’: command not found
…etc.

Is there a way to get the windows build wrapper recognize the \r in addition to the normal \r\n? I know that attempting to build with the linux build wrapper will not work on windows. I have already been down that path.

Hello @croniserb,

build-wrapper is not interpreting commands, I believe that it is shell (sh) raising that error.

The build starts off fine though. It happens midway through the build where mingw gcc is building a library in the cygwin environment. In the cygwin environment an open source library is uncompressed and built. I believe that is causing the issue with the CR verse CRLF.

Hi @croniserb,

it might depend from where you are launching the build, if you are launching it from Windows prompt or Cygwin bash, this is just an idea but unfortunately I don’t know your build flow so I cannot help much. build-wrapper is not supposed to interfere with the way processes are executed so you should probably look for another reason.