Skip to content

Conversation

@vvalderrv
Copy link
Contributor

Description

Fix SonarCloud analysis failures by switching the C/C++ configuration from the
deprecated sonar.cfamily.build-wrapper-output property to the current
sonar.cfamily.compile-commands property.

Changes

  • Remove sonar.cfamily.build-wrapper-output from sonar-project.properties.
  • In .github/workflows/build-steps.yml, pass
    --define sonar.cfamily.compile-commands="$BUILD_WRAPPER_OUT_DIR/compile_commands.json".

Root cause
The SonarCloud config still used the deprecated sonar.cfamily.build-wrapper-output
property. The current CFamily analyzer expects a compile_commands.json
(produced by build-wrapper). Using the old property caused scanner failures and
blocked analysis.

Validation
Regenerated bw_output/compile_commands.json, ran sonar-scanner, and
confirmed the scan completed and uploaded successfully.

Tests

CI-only change. Verified locally by running the scanner against a fresh
build-wrapper capture.

Checklist

  • I have read the
    contribution guidelines.
  • I have updated the documentation, if applicable. N/A — CI-only change.
  • I have ensured that the change is tested somewhere in the testsuite.
    N/A — CI-only change.
  • If I added or modified a C++ API call, I have also amended the Python
    bindings. N/A — not applicable.
  • My code follows the prevailing code style of this project.

This patch resolves SonarCloud analysis failures caused by a
deprecated C/C++ property. It removes
`sonar.cfamily.build-wrapper-output` from `sonar-project.properties`
and updates the CI workflow to use `sonar.cfamily.compile-commands`
pointing at `$BUILD_WRAPPER_OUT_DIR/compile_commands.json`.
Validated locally with a fresh build-wrapper capture; the scan
completed and uploaded successfully.

Signed-off-by: Vanessa Valderrama <[email protected]>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 12, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@lgritz
Copy link
Collaborator

lgritz commented Sep 12, 2025

There is something going wrong in the sonar analysis job. That's on me to fix, I will look at it today! This failure is happening during the build, and is entirely unrelated to both your patch and the previously reported Sonar issues (which, when I filed the ticket, finished the build fine and failed on the actual sonar analysis step itself). Something else must have broken. Stand by, I will get that fixed and then we can see if your patch cleared up the other situation.

@lgritz
Copy link
Collaborator

lgritz commented Sep 12, 2025

@vvalderrv

I amended your PR with a fix that will let it get to the analysis step, avoiding the other spurious problem.

But you can see that it still crashes in the sonar analysis, as I originally reported:
https://github.com/AcademySoftwareFoundation/OpenImageIO/actions/runs/17681745315/job/50257265809

@lgritz lgritz added the build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration. label Sep 13, 2025
Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM and I will merge it, since it updates from a deprecated to a more modern way to communicate our intent to the command.

However, this doesn't actually make the sonar analysis succeed -- it still crashes somewhere in the sonar code itself.

@lgritz lgritz merged commit 0afe9ef into AcademySoftwareFoundation:main Sep 15, 2025
33 checks passed
zachlewis pushed a commit to zachlewis/OpenImageIO that referenced this pull request Sep 16, 2025
Fix SonarCloud analysis failures by switching the C/C++ configuration
from the
deprecated `sonar.cfamily.build-wrapper-output` property to the current
`sonar.cfamily.compile-commands` property.

**Changes**
- Remove `sonar.cfamily.build-wrapper-output` from
`sonar-project.properties`.
- In `.github/workflows/build-steps.yml`, pass  
`--define
sonar.cfamily.compile-commands="$BUILD_WRAPPER_OUT_DIR/compile_commands.json"`.

**Root cause**  
The SonarCloud config still used the deprecated
`sonar.cfamily.build-wrapper-output`
property. The current CFamily analyzer expects a `compile_commands.json`
(produced by build-wrapper). Using the old property caused scanner
failures and
blocked analysis.

**Validation**  
Regenerated `bw_output/compile_commands.json`, ran `sonar-scanner`, and
confirmed the scan completed and uploaded successfully.

**Tests**

CI-only change. Verified locally by running the scanner against a fresh
build-wrapper capture.

---------

Signed-off-by: Vanessa Valderrama <[email protected]>
Signed-off-by: Zach Lewis <[email protected]>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Sep 16, 2025
Fix SonarCloud analysis failures by switching the C/C++ configuration
from the
deprecated `sonar.cfamily.build-wrapper-output` property to the current
`sonar.cfamily.compile-commands` property.

**Changes**
- Remove `sonar.cfamily.build-wrapper-output` from
`sonar-project.properties`.
- In `.github/workflows/build-steps.yml`, pass  
`--define
sonar.cfamily.compile-commands="$BUILD_WRAPPER_OUT_DIR/compile_commands.json"`.

**Root cause**  
The SonarCloud config still used the deprecated
`sonar.cfamily.build-wrapper-output`
property. The current CFamily analyzer expects a `compile_commands.json`
(produced by build-wrapper). Using the old property caused scanner
failures and
blocked analysis.

**Validation**  
Regenerated `bw_output/compile_commands.json`, ran `sonar-scanner`, and
confirmed the scan completed and uploaded successfully.

**Tests**

CI-only change. Verified locally by running the scanner against a fresh
build-wrapper capture.

---------

Signed-off-by: Vanessa Valderrama <[email protected]>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Sep 27, 2025
Fix SonarCloud analysis failures by switching the C/C++ configuration
from the
deprecated `sonar.cfamily.build-wrapper-output` property to the current
`sonar.cfamily.compile-commands` property.

**Changes**
- Remove `sonar.cfamily.build-wrapper-output` from
`sonar-project.properties`.
- In `.github/workflows/build-steps.yml`, pass  
`--define
sonar.cfamily.compile-commands="$BUILD_WRAPPER_OUT_DIR/compile_commands.json"`.

**Root cause**  
The SonarCloud config still used the deprecated
`sonar.cfamily.build-wrapper-output`
property. The current CFamily analyzer expects a `compile_commands.json`
(produced by build-wrapper). Using the old property caused scanner
failures and
blocked analysis.

**Validation**  
Regenerated `bw_output/compile_commands.json`, ran `sonar-scanner`, and
confirmed the scan completed and uploaded successfully.

**Tests**

CI-only change. Verified locally by running the scanner against a fresh
build-wrapper capture.

---------

Signed-off-by: Vanessa Valderrama <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants