DEVELOPING.md (19ace2b2303d5908252f6ea984def84c7efcac6a) DEVELOPING.md (c5bb99821d6b2a59bed5538475aa8d8631b4c075)
1# OpenBMC Webserver Development
2
31. ### Performance targets
4 As OpenBMC is intended to be deployed on an embedded system, care should be
5 taken to avoid expensive constructs, and memory usage. In general, our
6 performance and metric targets are:
7
8 - Binaries and static files should take up < 1MB of filesystem size

--- 167 unchanged lines hidden (view full) ---

176 technically possible, but as with all security, impact will need to be
177 weighed against the security impact of not making changes, and judgement
178 calls will be made, with options to allow providing the old behavior.
179
180## clang-tidy
181
182clang-tidy is a tool that can be used to identify coding style violations, bad
183design patterns, and bug prone constructs. The checks are implemented in the
1# OpenBMC Webserver Development
2
31. ### Performance targets
4 As OpenBMC is intended to be deployed on an embedded system, care should be
5 taken to avoid expensive constructs, and memory usage. In general, our
6 performance and metric targets are:
7
8 - Binaries and static files should take up < 1MB of filesystem size

--- 167 unchanged lines hidden (view full) ---

176 technically possible, but as with all security, impact will need to be
177 weighed against the security impact of not making changes, and judgement
178 calls will be made, with options to allow providing the old behavior.
179
180## clang-tidy
181
182clang-tidy is a tool that can be used to identify coding style violations, bad
183design patterns, and bug prone constructs. The checks are implemented in the
184.clang-tidy file in the root of bmcweb, and are expected to be passing. To
185run, the best way is to run the checks in yocto.
186
187```
188# check out meta-clang in your openbmc root
189cd openbmc
190git clone https://github.com/kraj/meta-clang
191
192# add the meta-clang layer to BBLAYERS in $BBPATH/conf/bblayers.conf
193<path_to_your_build_dir>/meta-clang
194
195# Add this line to $BBPATH/conf/local.conf to build bmcweb with clang
196TOOLCHAIN_pn-bmcweb = "clang"
197
198# and build
199bitbake bmcweb
200
201# Open devshell (this will open a shell)
202bitbake -c devshell bmcweb
203
204# cd into the work dir
205cd oe-workdir/bmcweb-1.0+git999
206# run clang tidy
207clang-tidy --header-filter=".*" -p . $BBPATH/workspace/sources/bmcweb/src/webserver_main.cpp
208```
184.clang-tidy file in the root of bmcweb, and are expected to be passing. [openbmc-build-scripts](https://github.com/openbmc/openbmc-build-scripts/blob/master/run-unit-test-docker.sh)
185implements clang-tidy checks and is the recommended way to run these checks