In order to provide CI coverage for CTU related functionality, a new builder
is introduced. The builder uses CodeChecker tool to drive the analysis, and
run the default Clang SA checkers in CTU mode on open source project TMUX.
CodeChecker: https://github.com/Ericsson/codechecker
TMUX: https://github.com/tmux/tmux
Details
- Reviewers
gkistanova martong
Diff Detail
- Build Status
Buildable 35509 Build 35508: arc lint + arc unit
Event Timeline
Friendly ping @gkistanova. What do you think about this modification? Also, should we add our buildslave to the silent (if I remember correctly it is called staging), or the reporting buildmaster? Thanks!
Hello Endre,
Please start from adding a builder to the staging buildbot first. Once it is stable and reliably green, you could move it to the production master.
I have noticed that you do not pass env to any of the custom steps in your factory. Is this intentional?
Please also see my notes inline.
Thanks
Galina
zorg/buildbot/builders/CTUAnalysisBuilder.py | ||
---|---|---|
26 | Could you elaborate why it is not possible to use the buildbot way of setting build step envars and run the command remotely by ShellCommand? Why do you need to swap a new shell session here? | |
101 | UnifiedTreeBuilder.getCmakeWithNinjaBuildFactory sets the TERM env for you. No need to define TERM and merge, you can just pass env down to UnifiedTreeBuilder.getCmakeWithNinjaBuildFactory as is. | |
107 | The same with extra_configure_args. Just pass it down to UnifiedTreeBuilder.getCmakeWithNinjaBuildFactory as is. | |
121 | Is there a strong reason to have defaults hardcoded as a part of the buildfactory rather than require these being specified as builder params or a properties? | |
131 | Please use RemoveDirectory from buildbot.steps.slave instead. Here and in all similar places in this patch. |
@gkistanova Your review is very much appreciated!
I have answered the inline comments, and I am currently applying the suggested fixes. After short testing, I will update this revision.
zorg/buildbot/builders/CTUAnalysisBuilder.py | ||
---|---|---|
26 | source codechecker/venv/bin/activate is necessary, because CodeChecker uses virtualenv to manage Python dependencies, and while it just sets its own specific environmental variables in turn, in my opinion, it is best to rely on the activate script to do this. Also, it is necessary to use it in this prefix form, because the effects of source-ing in a buildstep are not visible in the following buildsteps. Setting the PATH using realpath is necessary to have absolute paths instead of relative ones. This introduces a dependency on realpath being available, however prior personal experience shows that using absolute paths increase robustness. An alternative implementation would be to write these steps in a separate bash script, but that would create a dependency from that utility script. In its current form the whole build process does not have any external dependencies, every utility is downloaded/checkek-out from the relevant sources. In conclusion, I have found this implementation the most optimal for minimizing dependencies and maximizing robustness. | |
101 | Good point, thanks. | |
107 | Same as above. | |
121 | The more I think about it, the more I agree with you. Extracting these into customizable build parameters. | |
131 | Fixing these right now. |
- Remove redundant parameter handling
- Pass env keyword argument to every ShellCommand step
- Use RemoveDirectory where applicable
I have applied the fixes, which seemed fitting. Also see my reasoning behind the command-prefix implementation inline.
CodeChecker repo url and tag as build properties are already handled, and they override default values (see in lines 110-113 in the updated diff), is there a better way? (like providing default values for these properties on the GUI, which currently stays blank and property names and values must both be filled in).
I am creating a new revision for integrating the buildbot into the infrastructure, and I will contact you with the access credentials when it's done.
Cheers,
Endre
Hello Endre,
Almost there. :)
There is a couple of minor things to address. Please see my notes inline.
zorg/buildbot/builders/CTUAnalysisBuilder.py | ||
---|---|---|
26 | Could you add a comment to the source code explaining these, please? | |
119 | Did you miss one rm -rf command, or there is a reason not to use RemoveDirectory here? |
zorg/buildbot/builders/CTUAnalysisBuilder.py | ||
---|---|---|
119 | Thanks for catching this! |
Could you elaborate why it is not possible to use the buildbot way of setting build step envars and run the command remotely by ShellCommand? Why do you need to swap a new shell session here?