diff options
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e0d49ec8..85bf6ece4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,6 +78,36 @@ We expect most contributions to be for new data collection plugins. You can read Of course we appreciate contributions for any other part of the NetData agent, including the [daemon](daemon), [backends for long term archiving](backends/), innovative ways of using the [REST API](web/api) to create cool [Custom Dashboards](web/gui/custom/) or to include NetData charts in other applications, similarly to what can be done with [Confluence](web/gui/confluence/). +If you are working on the C source code please be aware that we have a standard build configuration that we use. This +is meant to keep the source tree clean and free of warnings. When you are preparing to work on the code: +``` +CFLAGS="-O1 -ggdb -Wall -Wextra -Wformat-signedness -fstack-protector-all -DNETDATA_INTERNAL_CHECKS=1 -D_FORTIFY_SOURCE=2 -DNETDATA_VERIFY_LOCKS=1" ./netdata-installer.sh --disable-lto --dont-wait +``` + +Typically we will enable LTO during production builds. The reasons for configuring it this way are: + +| CFLAG / argument | Reasoning | +| ---------------- | --------- | +| `-O1` | This makes the debugger easier to use as it disables optimisations that break the relationship between the source and the state of the debugger | +| `-ggdb` | Enable debugging symbols in gdb format (this also works with clang / llbdb) | +| `-Wall -Wextra -Wformat-signedness` | Really, definitely, absolutely all the warnings | +| `-DNETDATA_INTERNAL_CHECKS=1` | This enables the debug.log and turns on the macro that outputs to it | +| `-D_FORTIFY_SOURCE=2` | Enable buffer-overflow checks on string-processing functions | +| `-DNETDATA_VERIFY_LOCKS=1` | Enable extra checks and debug | +| `--disable-lto ` | We enable LTO for production builds, but disable it during development are it can hide errors about missing symbols that have been pruned. | + +Before submitting a PR we run through this checklist: + +* Compilation warnings +* valgrind +* ./netdata-installer.sh +* make dist +* `packaging/makeself/build-x86_64-static.sh` +* `clang-format -style=file` + +Please be aware that the linting pass at the end is currently messy as we are transitioning between code styles +across most of our code-base, but we prefer new contributions that match the linting style. + ### Contributions Ground Rules #### Code of Conduct and CLA |