diff options
author | Stefan Metzmacher <metze@samba.org> | 2021-08-25 16:33:03 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2021-08-26 13:06:09 +0000 |
commit | 5d53b848f60efbb71e4cd2f51f33a06369ca9055 (patch) | |
tree | d426aa276ab359d32559a7655879a43cd51f27cb | |
parent | 9b9fd2a0d9ca81aa16ddfe2f7e219b94e2ac158b (diff) | |
download | samba-5d53b848f60efbb71e4cd2f51f33a06369ca9055.tar.gz |
wafsamba: always generate compile_commands.json again, but only when the samba dependencies changed
This means the costs of the generation on a empty build are not paid
anymore, which was the reason for the explicit --enable-clangdb option.
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Aug 26 13:06:09 UTC 2021 on sn-devel-184
-rw-r--r-- | buildtools/wafsamba/samba_deps.py | 12 | ||||
-rw-r--r-- | buildtools/wafsamba/wscript | 14 | ||||
-rwxr-xr-x | script/autobuild.py | 1 | ||||
-rw-r--r-- | wscript_build_embedded_heimdal | 3 | ||||
-rw-r--r-- | wscript_build_system_heimdal | 3 | ||||
-rw-r--r-- | wscript_build_system_mitkrb5 | 3 |
6 files changed, 21 insertions, 15 deletions
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py index 29bebc349c4..cb8acfae34e 100644 --- a/buildtools/wafsamba/samba_deps.py +++ b/buildtools/wafsamba/samba_deps.py @@ -2,7 +2,7 @@ import os, sys, re -from waflib import Build, Options, Logs, Utils, Errors +from waflib import Build, Options, Logs, Utils, Errors, Scripting from waflib.Logs import debug from waflib.Configure import conf from waflib import ConfigSet @@ -1087,6 +1087,9 @@ def load_samba_deps(bld, tgt_list): def check_project_rules(bld): '''check the project rules - ensuring the targets are sane''' + if bld.__class__.__name__ == "ClangDbContext": + return + loops = {} inc_loops = {} @@ -1167,6 +1170,13 @@ def check_project_rules(bld): Logs.info("Project rules pass") + timer = Utils.Timer() + + bld.load('clang_compilation_database') + Scripting.run_command('clangdb') + + debug("deps: clang_compilation_database: %s" % str(timer)) + def CHECK_PROJECT_RULES(bld): '''enable checking of project targets for sanity''' diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 1aadb9570e1..7be61e80abb 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -132,9 +132,6 @@ def options(opt): action="store_true", dest='undefined_sanitizer', default=False) - gr.add_option('--enable-clangdb', - help=("Enable use of clang_compilation_database"), - action="store_true", dest='enable_clangdb', default=False) gr.add_option('--enable-libfuzzer', help=("Build fuzzing binaries (use ADDITIONAL_CFLAGS to specify compiler options for libFuzzer or use CC=honggfuzz/hfuzz-cc)"), action="store_true", dest='enable_libfuzzer', default=False) @@ -660,13 +657,10 @@ struct foo bar = { .y = 'X', .x = 1 }; conf.DEFINE('FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', 1) conf.env.FUZZ_TARGET_LDFLAGS = Options.options.FUZZ_TARGET_LDFLAGS - conf.env.enable_clangdb = Options.options.enable_clangdb - if conf.env.enable_clangdb: - conf.load('clang_compilation_database') - # Create a symlink of the compile db for clangd - symlink(os.path.join(conf.bldnode.abspath(), 'default/compile_commands.json'), - os.path.join(conf.srcnode.abspath(), 'compile_commands.json'), - force=True) + # Create a symlink of the compile db for clangd + symlink(os.path.join(conf.bldnode.abspath(), 'default/compile_commands.json'), + os.path.join(conf.srcnode.abspath(), 'compile_commands.json'), + force=True) conf.SAMBA_BUILD_ENV() diff --git a/script/autobuild.py b/script/autobuild.py index 6a15722b263..9c343d1f29c 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -786,7 +786,6 @@ tasks = { "PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} " "./configure.developer ${PREFIX} " "--with-selftest-prefix=./bin/ab " - "--enable-clangdb " "--with-cluster-support " "--without-ad-dc " "--bundled-libraries=!tdb"), diff --git a/wscript_build_embedded_heimdal b/wscript_build_embedded_heimdal index 84829fe8b62..7b0a8af4489 100644 --- a/wscript_build_embedded_heimdal +++ b/wscript_build_embedded_heimdal @@ -1,4 +1,5 @@ from waflib import Logs -Logs.info("\tSelected embedded Heimdal build") +if bld.__class__.__name__ != "ClangDbContext": + Logs.info("\tSelected embedded Heimdal build") bld.RECURSE('source4/heimdal_build') diff --git a/wscript_build_system_heimdal b/wscript_build_system_heimdal index b97944b44c3..4b3a46d88f9 100644 --- a/wscript_build_system_heimdal +++ b/wscript_build_system_heimdal @@ -1,4 +1,5 @@ from waflib import Logs -Logs.info("\tSelected system Heimdal build") +if bld.__class__.__name__ != "ClangDbContext": + Logs.info("\tSelected system Heimdal build") bld.RECURSE('source4/heimdal_build') diff --git a/wscript_build_system_mitkrb5 b/wscript_build_system_mitkrb5 index b54e2ded22e..03c8fbc2a93 100644 --- a/wscript_build_system_mitkrb5 +++ b/wscript_build_system_mitkrb5 @@ -1,4 +1,5 @@ from waflib import Logs -Logs.info("\tSelected system MIT krb5 libraries, Heimdal use is disabled") +if bld.__class__.__name__ != "ClangDbContext": + Logs.info("\tSelected system MIT krb5 libraries, Heimdal use is disabled") #bld.RECURSE('source4/heimdal_build') |