Module: check_mk
Branch: master
Commit: 5fb9bde157ffd4c135fb379451b4c5e385bab0cf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5fb9bde157ffd4…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Apr 17 16:22:07 2019 +0200
Use compiledb instead of Bear for generation of compile_command.json.
This removes the need for a "make clean", speeding up things considerably:
From a few minutes down to 1-2 seconds.
CMK-2026
Change-Id: Ib1ac51d164ac0839947e734b165bfbd8d17a15cd
---
Makefile | 18 -----------
Pipfile | 2 ++
Pipfile.lock | 33 +++++++++++----------
livestatus/src/Makefile.am | 7 +++--
livestatus/src/test/Makefile.am | 15 +++++-----
.../python-modules/src/compiledb-1604e14.tar.gz | Bin 0 -> 26748 bytes
6 files changed, 31 insertions(+), 44 deletions(-)
diff --git a/Makefile b/Makefile
index 5f62bb9..562bc3a 100644
--- a/Makefile
+++ b/Makefile
@@ -44,24 +44,6 @@ export DOXYGEN := doxygen
export IWYU_TOOL := iwyu_tool
PIPENV := PIPENV_NO_INHERIT=true PIPENV_VENV_IN_PROJECT=true pipenv
-# The Bear versions have a slightly tragic history: Due to the clang bug
-#
https://llvm.org/bugs/show_bug.cgi?id=24710 we need absolute paths in our
-# compilation database. Furthermore, gcc and clang have slightly different
-# behavior regarding include paths when the -I flag contains a relative path and
-# symlinks are involved, so this is yet another reason to use absolute paths.
-#
-# Consequently, we upstreamed a fix for this to the Bear project, see
-#
https://github.com/rizsotto/Bear/commit/fb1645de9. This fix lived happily in
-# the Bear releases 2.1.4, 2.1.5, and 2.2.0, but after that, some
"improvements"
-# broke the fix again. :-/ Until a new fix has been upstreamed, make sure that
-# that you use the right Bear.
-#
-# To install a working version locally, just do:
-# git clone
https://github.com/rizsotto/Bear.git && cd Bear && git
checkout 2.2.0 && cmake -DCMAKE_INSTALL_PREFIX=$HOME/local/Bear-2.2.0 &&
make install
-# and put $HOME/local/Bear-2.2.0/bin into your PATH or set the make variable
-# below accordingly.
-export BEAR := bear
-
M4_DEPS := $(wildcard m4/*) configure.ac
CONFIGURE_DEPS := $(M4_DEPS) aclocal.m4
CONFIG_DEPS := ar-lib compile config.guess config.sub install-sh missing depcomp
configure
diff --git a/Pipfile b/Pipfile
index 3a0bbe1..e8dcf8c 100644
--- a/Pipfile
+++ b/Pipfile
@@ -22,6 +22,8 @@ mockldap = "*"
isort = "*"
pdbpp = "*"
freezegun = "*"
+# We have to use a snapshot, a version which works for us has not been released yet. :-/
+compiledb = {path =
"./omd/packages/python-modules/src/compiledb-1604e14.tar.gz"}
[packages]
setuptools_scm = "==3.1.0"
diff --git a/Pipfile.lock b/Pipfile.lock
index f385dc3..10ee1d5 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256":
"83a7380c34db5a6b6c328bdb8653925a3329bbe21942d086bc01b01841e9e59e"
+ "sha256":
"db23de596318955f08951a87dca949d06ee2387f1aecfbc2903377c576fa5f6b"
},
"pipfile-spec": 6,
"requires": {
@@ -1010,7 +1010,7 @@
"sha256:9d98697f088eb1b0fa451391f91afb5e3ebde16bbdb272819fd091151fda4f1a",
"sha256:f0b0e4eba956de51238e17573b7087e852dfe9854afd2e9c873f73fc0ca0a6dd"
],
- "markers": "python_version == '2.7'",
+ "markers": "python_version < '3.2'",
"version": "==1.5"
},
"backports.ssl-match-hostname": {
@@ -1053,6 +1053,9 @@
"index": "pypi",
"version": "==3.0.4"
},
+ "compiledb": {
+ "path":
"./omd/packages/python-modules/src/compiledb-1604e14.tar.gz"
+ },
"configparser": {
"hashes": [
"sha256:5308b47021bc2340965c371f0f058cc6971a04502638d4244225c49d80db273a"
@@ -1318,10 +1321,10 @@
},
"pdbpp": {
"hashes": [
-
"sha256:3936ed6c145d9bebad9f532a20796d7022fc251ad6b041adc56b67839efd5173"
+
"sha256:ee7eab02ecf32d92bd66b45eedb9bda152fa13f7be0dceb7050413a52cbbc4dd"
],
"index": "pypi",
- "version": "==0.9.15"
+ "version": "==0.10.0"
},
"pluggy": {
"hashes": [
@@ -1379,17 +1382,17 @@
},
"pyrepl": {
"hashes": [
-
"sha256:3bcbbf1e47d2b80819b805aceea16dc90832ba4800035d595fa3c4bf48fcd4d7"
+
"sha256:292570f34b5502e871bbb966d639474f2b57fbfcd3373c2d6a2f3d56e681a775"
],
- "version": "==0.8.4"
+ "version": "==0.9.0"
},
"pytest": {
"hashes": [
-
"sha256:13c5e9fb5ec5179995e9357111ab089af350d788cbc944c628f3cde72285809b",
-
"sha256:f21d2f1fb8200830dcbb5d8ec466a9c9120e20d8b53c7585d180125cce1d297a"
+
"sha256:3773f4c235918987d51daf1db66d51c99fac654c81d6f2f709a046ab446d5e5d",
+
"sha256:b7802283b70ca24d7119b32915efa7c409982f59913c1a6c0640aacf118b95f5"
],
"index": "pypi",
- "version": "==4.4.0"
+ "version": "==4.4.1"
},
"pytest-cov": {
"hashes": [
@@ -1401,11 +1404,11 @@
},
"pytest-mock": {
"hashes": [
-
"sha256:330bfa1a71c9b6e84e2976f01d70d8a174f755e7f9dc5b22f4b7335992e1e98b",
-
"sha256:cea3983a1ebc88bf7c0fa1ed8c84e67b898bf71a320a49605bcb74f31e6cfd6a"
+
"sha256:43ce4e9dd5074993e7c021bb1c22cbb5363e612a2b5a76bc6d956775b10758b7",
+
"sha256:5bf5771b1db93beac965a7347dc81c675ec4090cb841e49d9d34637a25c30568"
],
"index": "pypi",
- "version": "==1.10.3"
+ "version": "==1.10.4"
},
"python-dateutil": {
"hashes": [
@@ -1492,10 +1495,10 @@
},
"soupsieve": {
"hashes": [
-
"sha256:3aef141566afd07201b525c17bfaadd07580a8066f82b57f7c9417f26adbd0a3",
-
"sha256:e41a65e99bd125972d84221022beb1e4b5cfc68fa12c170c39834ce32d1b294c"
+
"sha256:6898e82ecb03772a0d82bd0d0a10c0d6dcc342f77e0701d0ec4a8271be465ece",
+
"sha256:b20eff5e564529711544066d7dc0f7661df41232ae263619dede5059799cdfca"
],
- "version": "==1.9"
+ "version": "==1.9.1"
},
"stevedore": {
"hashes": [
diff --git a/livestatus/src/Makefile.am b/livestatus/src/Makefile.am
index e5d021d..a387340 100644
--- a/livestatus/src/Makefile.am
+++ b/livestatus/src/Makefile.am
@@ -24,7 +24,6 @@
CLANG_VERSION ?= 7
-BEAR ?= bear
CPPCHECK ?= cppcheck
DOXYGEN ?= doxygen
IWYU_TOOL ?= iwyu_tool
@@ -177,9 +176,11 @@ livestatus.o: $(liblivestatus_a_OBJECTS)
$(CXX) $(liblivestatus_a_CXXFLAGS) $(CXXFLAGS) NagiosMockup.o $@ -o NagiosMockup
$(RM) NagiosMockup
+# NOTE: cppcheck up to 7287ffe (2019-04-15) understands only the old "command
+# style", so we have to stick with that for now. :-/
compile_commands.json: Makefile $(wildcard *.cc *.h)
- $(MAKE) clean
- $(BEAR) $(MAKE) -j4
+ $(MAKE) -C $(top_srcdir) .venv
+ $(MAKE) -Bnwk | pipenv run compiledb --command-style
tidy: compile_commands.json
$(RUN_CLANG_TIDY) -quiet -j6 $(FILES_TO_CHECK)
diff --git a/livestatus/src/test/Makefile.am b/livestatus/src/test/Makefile.am
index a7baf5c..fcc0be9 100644
--- a/livestatus/src/test/Makefile.am
+++ b/livestatus/src/test/Makefile.am
@@ -30,7 +30,6 @@
CLANG_VERSION ?= 7
-BEAR ?= bear
CPPCHECK ?= cppcheck
IWYU_TOOL ?= iwyu_tool
RUN_CLANG_TIDY ?= \
@@ -39,7 +38,7 @@ RUN_CLANG_TIDY ?= \
-clang-apply-replacements-binary=clang-apply-replacements-$(CLANG_VERSION)
VALGRIND ?= $(shell valgrind --version > /dev/null 2>&1 && echo
"valgrind --quiet")
-GOOGLETEST :=$(top_srcdir)/omd/packages/googletest
+GOOGLETEST := $(top_srcdir)/omd/packages/googletest
bin_PROGRAMS = test_neb
@@ -73,16 +72,16 @@ unit-test: test_neb$(EXEEXT)
# where we just install our build dependencies.
$(test_neb_SOURCES): build_googletest
+# HACK: Avoid recompilation caused by make's -B flag
build_googletest:
- $(MAKE) -C $(GOOGLETEST) build
+ bash -c "make -C $(GOOGLETEST) build" > /dev/null
+# NOTE: cppcheck up to 7287ffe (2019-04-15) understands only the old "command
+# style", so we have to stick with that for now. :-/
compile_commands.json: Makefile $(wildcard *.cc *.h)
- $(MAKE) clean
-# HACK: bear doeesn't have an option to exclude some parts in the output, so we
-# make sure that googletest is built first. We don't want to include that...
- $(MAKE) -C ../../.. config.status
+ $(MAKE) -C $(top_srcdir) .venv
$(MAKE) -j4 -C ..
- $(BEAR) $(MAKE) -j4 test_neb
+ $(MAKE) -Bnwk | PIPENV_MAX_DEPTH=4 pipenv run compiledb --command-style
tidy: compile_commands.json
$(RUN_CLANG_TIDY) -quiet -j6 $(FILES_TO_CHECK)
diff --git a/omd/packages/python-modules/src/compiledb-1604e14.tar.gz
b/omd/packages/python-modules/src/compiledb-1604e14.tar.gz
new file mode 100644
index 0000000..48fb963
Binary files /dev/null and b/omd/packages/python-modules/src/compiledb-1604e14.tar.gz
differ