Sonar xcodebuild use build wrapper get empty result (2 of 4 machine fail)

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 10.2
    build wrapper 6.48.1
    xcode 15.3
    macos sonoma 14.4

i test 4 machine use the above emvironment, 2 of 4 machines use build wrapper scan get empty result but the other 2 work fine.

the different is build-wrapper.log:
work fine log show create /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild process after
sonarsource-build-wrapper-cache-501/usr/bin/xcodebuild process, but empty result don’t and just wait the build finsih and log empty

empty result log

Tue May 07 17:55:51 2024: working directory: </Users/macm2_002/Desktop/SonarTest>
Tue May 07 17:55:51 2024: executable: </private/tmp/sonarsource-build-wrapper-cache-501/usr/bin/xcodebuild>
Tue May 07 17:55:51 2024: argv[0]: <xcodebuild>
Tue May 07 17:55:51 2024: argv[1]: <clean>
Tue May 07 17:55:51 2024: argv[2]: <build>
Tue May 07 17:55:51 2024: argv[3]: <-scheme>
Tue May 07 17:55:51 2024: argv[4]: <SonarTest>
Tue May 07 17:55:51 2024: argv[5]: <-configuration>
Tue May 07 17:55:51 2024: argv[6]: <Debug>
Tue May 07 17:55:51 2024: argv[7]: <COMPILER_INDEX_STORE_ENABLE=NO>
Tue May 07 17:55:51 2024: argv[8]: <-UseModernBuildSystem=YES>
Tue May 07 17:55:51 2024: argv[9]: <-destination>
Tue May 07 17:55:51 2024: argv[10]: <generic/platform=iOS>
Tue May 07 17:55:51 2024: argv[11]: <-derivedDataPath>
Tue May 07 17:55:51 2024: argv[12]: <DerivedData>
Tue May 07 17:55:51 2024: argv[13]: <-DCMAKE_EXPORT_COMPLIE_COMMANDS=ON>
Tue May 07 17:55:51 2024: skipping process with pid: 38875
Tue May 07 17:55:58 2024: finalizing json file
Tue May 07 17:55:58 2024: returned with code: 0

work fine log

Wed May 08 12:02:31 2024: skipping process with pid: 29979
Wed May 08 12:02:31 2024: process created with pid: 29980
Wed May 08 12:02:31 2024: parent pid: 29979
Wed May 08 12:02:31 2024: working directory: </Users/thealert/Downloads/SonarTest>
Wed May 08 12:02:31 2024: executable: </private/tmp/sonarsource-build-wrapper-cache-501/usr/bin/xcodebuild>
Wed May 08 12:02:31 2024: argv[0]: <xcodebuild>
Wed May 08 12:02:31 2024: argv[1]: <clean>
Wed May 08 12:02:31 2024: argv[2]: <build>
Wed May 08 12:02:31 2024: argv[3]: <-scheme>
Wed May 08 12:02:31 2024: argv[4]: <SonarTest>
Wed May 08 12:02:31 2024: argv[5]: <-configuration>
Wed May 08 12:02:31 2024: argv[6]: <Debug>
Wed May 08 12:02:31 2024: argv[7]: <COMPILER_INDEX_STORE_ENABLE=NO>
Wed May 08 12:02:31 2024: argv[8]: <-UseModernBuildSystem=YES>
Wed May 08 12:02:31 2024: argv[9]: <-destination>
Wed May 08 12:02:31 2024: argv[10]: <generic/platform=iOS>
Wed May 08 12:02:31 2024: argv[11]: <-derivedDataPath>
Wed May 08 12:02:31 2024: argv[12]: <DerivedData>
Wed May 08 12:02:31 2024: argv[13]: <-DCMAKE_EXPORT_COMPLIE_COMMANDS=ON>
Wed May 08 12:02:31 2024: skipping process with pid: 29980
Wed May 08 12:02:31 2024: process created with pid: 29980
Wed May 08 12:02:31 2024: parent pid: 29979
Wed May 08 12:02:31 2024: working directory: </Users/thealert/Downloads/SonarTest>
Wed May 08 12:02:31 2024: executable: </Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild>
Wed May 08 12:02:31 2024: argv[0]: </Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild>
Wed May 08 12:02:31 2024: argv[1]: <clean>
Wed May 08 12:02:31 2024: argv[2]: <build>
Wed May 08 12:02:31 2024: argv[3]: <-scheme>
Wed May 08 12:02:31 2024: argv[4]: <SonarTest>
Wed May 08 12:02:31 2024: argv[5]: <-configuration>
Wed May 08 12:02:31 2024: argv[6]: <Debug>
Wed May 08 12:02:31 2024: argv[7]: <COMPILER_INDEX_STORE_ENABLE=NO>
Wed May 08 12:02:31 2024: argv[8]: <-UseModernBuildSystem=YES>
Wed May 08 12:02:31 2024: argv[9]: <-destination>
Wed May 08 12:02:31 2024: argv[10]: <generic/platform=iOS>
Wed May 08 12:02:31 2024: argv[11]: <-derivedDataPath>
Wed May 08 12:02:31 2024: argv[12]: <DerivedData>
Wed May 08 12:02:31 2024: argv[13]: <-DCMAKE_EXPORT_COMPLIE_COMMANDS=ON>
Wed May 08 12:02:31 2024: skipping process with pid: 29980
Wed May 08 12:02:33 2024: process created with pid: 29992
Wed May 08 12:02:33 2024: parent pid: 29980

dump.log

# (C) SonarSource SA, 2014-2023, info@sonarsource.com
# All SONARSOURCE programs and content are copyright protected.
# SONARSOURCE and SONARQUBE are trademarks of SonarSource SA. All rights are expressly reserved.
#
# This file is designed exclusively for use with the SONARSOURCE C / C++ / Objective-C Plugin.
# It may not be used in connection with any other software.
# Any other use is prohibited by law and may be grounds for immediate termination of your License.
{
"version":"6.48.1",
"captures":[
]}

i see work fine log /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild process and
sonarsource-build-wrapper-cache-501/usr/bin/xcodebuild process use same pid?

process created with pid: 29980

can anyone help? thanks. we buy the develop edition if any department can support this?

Hi,

Welcome to the community!

This depends a lot on the build, and thus on the build environment. Is the environment the same on all four machines? Same compiler at the same version? Same libraries?

 
Ann

i fond the solution seems that macos’s SIP must turun off(by default is ON)
i think other people may meet same situation

csrutil disable
2 Likes

suggest add this info to sonar ObjectC scan DOC

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.