summaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorAndrew Moss <1043609+amoss@users.noreply.github.com>2019-11-14 16:49:19 +0100
committerGitHub <noreply@github.com>2019-11-14 16:49:19 +0100
commitac90f27a580aad0c4d20c5354657b34e5ceed29e (patch)
tree88667d78592d86a1392466b909e42fec32953025 /CONTRIBUTING.md
parent0d985568013377c332a7574fd2935339b583d9d4 (diff)
Updating the Travis pipeline (issue 7189) (#7312)
Added a linting pass. This is non-blocking but will output a measure of how much each .c and .h file deviates from our current .clang format. Changed the standard build to include all of the warning that we are using in dev. Added the dependencies for dbengine and confirmed that the standard build enables dbengine. Fixed the original warnings.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4e0d49ec8f..85bf6ece49 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