Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please allow to pass --status-bugs to scan-build #4334

Closed
agx opened this issue Oct 6, 2018 · 2 comments

Comments

@agx
Copy link
Contributor

commented Oct 6, 2018

It would be great if one could pass --status-bugs to

ninja -C _build/ scan-build

so the build would fail with new warnings.

@jpakkane

This comment has been minimized.

Copy link
Member

commented Oct 7, 2018

Ninja does not permit passing extra arguments to commands by design. If you need something more complex, you probably need to do that yourself. If you are running this on a CI pipeline, you'll probably need to write some custom invocation commands anyway.

agx added a commit to agx/meson that referenced this issue Oct 8, 2018
scanbuild: Split SCANBUILD using shlex
This allows invocations like

    SCANBUILD="scan-build --status-bugs" ninja scan-build

Closes: mesonbuild#4334
@agx

This comment has been minimized.

Copy link
Contributor Author

commented Oct 8, 2018

Actually no, there would be no extra work needed. If one could pass --status-bugs via SCANBUILD. See

#4346

jpakkane added a commit that referenced this issue Oct 8, 2018
scanbuild: Split SCANBUILD using shlex
This allows invocations like

    SCANBUILD="scan-build --status-bugs" ninja scan-build

Closes: #4334
agx added a commit to agx/libhandy that referenced this issue Oct 17, 2018
gnomesysadmins pushed a commit to GNOME/glib that referenced this issue Jun 11, 2019
ci: Add scan-build job in a new ‘analysis’ pipeline stage
Use Meson’s support for running scan-build (Clang’s static analyser)
against the build, so that we get static analysis of each pipeline. Add
it in a new pipeline stage, after code coverage, so that we don’t waste
resources on it unless the unit tests pass — a static analysis build
takes perhaps 10× as long as a normal GCC build.

https://mesonbuild.com/howtox.html#use-clang-static-analyzer

Currently, the static analysis results are uploaded as artifacts, but
the job will always succeed (regardless of whether there are any bugs
found in the analysis).

Currently, a large number of reports are outputted by the analyser,
which need to be fixed before we can gate the pipeline on it.
Furthermore, in order to get scan-build to exit with a non-zero status
if any bugs are found, we need to depend on Meson ≥ 0.49.0, which
contains the fix mesonbuild/meson#4334,
allowing us to add the following to .gitlab-ci.yml:
```
variables:
  # Exit with a non-zero status if any bugs are found
  SCANBUILD: "scan-build --status-bugs"
```

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.