From 87106ea5e2fae7dafffc43dce3948d3be53aa660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Thu, 7 Feb 2019 18:04:44 -0800 Subject: [PATCH] Improve the build mode documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this patch HACKING suggest using just ./configure.py and passing the mode to ninja. It also expands on the characteristics of each mode and mentions the dev mode. Signed-off-by: Rafael Ávila de Espíndola Message-Id: <20190208020444.19145-1-espindola@scylladb.com> --- HACKING.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/HACKING.md b/HACKING.md index 3891e9defe..a5c971de9d 100644 --- a/HACKING.md +++ b/HACKING.md @@ -45,9 +45,7 @@ The full suite of options for project configuration is available via $ ./configure.py --help ``` -The most important options are: - -- `--mode={release,debug,all}`: Debug mode enables [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) and allows for debugging with tools like GDB. Debugging builds are generally slower and generate much larger object files than release builds. +The most important option is: - `--{enable,disable}-dpdk`: [DPDK](http://dpdk.org/) is a set of libraries and drivers for fast packet processing. During development, it's not necessary to enable support even if it is supported by your platform. @@ -59,6 +57,22 @@ To save time -- for instance, to avoid compiling all unit tests -- you can also $ ninja-build build/release/tests/schema_change_test ``` +You can also specify a single mode. For example + +```bash +$ ninja-build release +``` + +Will build everytihng in release mode. The valid modes are + +* Debug: Enables [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) + and other sanity checks. It has no optimizations, which allows for debugging with tools like + GDB. Debugging builds are generally slower and generate much larger object files than release builds. +* Release: Fewer checks and more optimizations. It still has debug info. +* Dev: No optimizations or debug info. The objective is to compile and link as fast as possible. + This is useful for the first iterations of a patch. + + Note that by default unit tests binaries are stripped so they can't be used with gdb or seastar-addr2line. To include debug information in the unit test binary, build the test binary with a `_g` suffix. For example,