.. code-block:: bash
- $ meson build_dir --prefix=/tmp/kr --default-library=static -Dmanager=enabled
+ $ meson build_dir --prefix=/tmp/kr
After that it is possible to build and install Knot Resolver.
* ``-Dsystemd_files=enabled`` for systemd unit files
* ``-Ddoc=enabled`` for offline documentation (see :ref:`build-html-doc`)
* ``-Dinstall_kresd_conf=enabled`` to install default config file
-* ``-Dmanager=enabled`` to force build of the manager and its features
* ``-Dunit_tests=enabled`` to force build of unit tests
Systemd
### Common tasks and interactions with the project
-After setting up the environment, you should be able to interract with the project by using `./poe` script. Common actions are:
+After setting up the environment, you should be able to interact with the project by using the `./poe` script. Common actions are:
-* `poe run` - runs the manager from the source
+* `poe configure` - configures Knot Resolver daemon for use with the manager
+* `poe run` - runs the manager from the source (requires the daemon to be configured)
* `poe docs` - creates HTML documentation
* `poe test` - unit tests
* `poe tox` - unit tests in all supported Python versions (must not be run outside of virtualenv, otherwise it fails to find multiple versions of Python)
knot-resolver = 'knot_resolver_manager.__main__:run'
[tool.poe.tasks]
+configure = { cmd = "scripts/meson-configure", help = "Configure Knot Resolver daemon" }
run = { cmd = "scripts/run", help = "Run the manager" }
run-debug = { cmd = "scripts/run-debug", help = "Run the manager under debugger" }
docs = { cmd = "scripts/docs", help = "Create HTML documentation" }
function build_kresd {
- echo
- echo Building Knot Resolver
- echo ----------------------
- echo -e "${blue}In case of an compilation error, run this command to try to fix it:${reset}"
- echo -e "\t${blue}rm -r $(realpath .install_kresd) $(realpath .build_kresd)${reset}"
- echo
pushd ..
- mkdir -p manager/.build_kresd manager/.install_kresd
- meson manager/.build_kresd --prefix=$(realpath manager/.install_kresd) --default-library=static --buildtype=debug
- ninja -C manager/.build_kresd
- ninja install -C manager/.build_kresd
- export PYTHONPATH="$(realpath manager/.build_kresd/python):${PYTHONPATH:-}"
+ if [ -d manager/.build_kresd ]; then
+ echo
+ echo Building Knot Resolver
+ echo ----------------------
+ echo -e "${blue}In case of an compilation error, run this command to try to fix it:${reset}"
+ echo -e "\t${blue}rm -r $(realpath .install_kresd) $(realpath .build_kresd)${reset}"
+ echo
+ ninja -C manager/.build_kresd
+ ninja install -C manager/.build_kresd
+ export PYTHONPATH="$(realpath manager/.build_kresd/python):${PYTHONPATH:-}"
+ else
+ echo
+ echo Knot Resolver daemon is not configured.
+ echo "Please run './poe configure' (optionally with additional Meson arguments)"
+ echo
+ exit 2
+ fi
popd
}
--- /dev/null
+#!/bin/bash
+
+# ensure consistent behaviour
+src_dir="$(dirname "$(realpath "$0")")"
+source $src_dir/_env.sh
+
+pushd ..
+meson setup manager/.build_kresd --reconfigure --prefix=$(realpath manager/.install_kresd) "$@"
+popd
+
+build_kresd
## Remaining code
subdir('daemon')
subdir('modules')
-subdir('manager')
subdir('python')
subdir('utils')
if get_option('bench') == 'enabled'
# https://github.com/mesonbuild/meson/issues/2404
s_managed_ta = managed_ta ? 'enabled' : 'disabled'
s_install_root_keys = install_root_keys ? 'enabled' : 'disabled'
-s_build_manager = build_manager ? 'enabled' : 'disabled'
s_build_utils = build_utils ? 'enabled' : 'disabled'
s_build_dnstap = build_dnstap ? 'enabled' : 'disabled'
s_build_unit_tests = build_unit_tests ? 'enabled' : 'disabled'
cache_dir: @0@'''.format(systemd_cache_dir) + '''
optional components
- manager: @0@'''.format(s_build_manager) + '''
utils: @0@'''.format(s_build_utils) + '''
dnstap: @0@'''.format(s_build_dnstap) + '''
unit_tests: @0@'''.format(s_build_unit_tests) + '''
description: 'build benchmarks',
)
-option(
- 'manager',
- type: 'combo',
- choices: [
- 'auto',
- 'enabled',
- 'disabled',
- ],
- value: 'disabled',
- description: 'build manager and its features',
-)
-
option(
'utils',
type: 'combo',