::
- $ mkdir build && cd build
- $ ../autogen.sh
- $ make
+ $ meson build
+ $ ninja -C build
You'll find the freshly-built document in ``docs/contribute.html``.
-If ``configure`` fails because of missing dependencies, you can set
+If ``meson setup`` fails because of missing dependencies, you can set
up your system by calling
::
::
- $ sudo dnf install gcc make libtool autoconf automake rpm-build
+ $ sudo dnf install gcc make ninja-build rpm-build
You might still be missing some dependencies if your distribution is
shipping an old libvirt version, but that will get you much closer to
::
- $ make check
- $ make syntax-check
+ $ ninja test
succeed after each commit.
::
- $ make -C tests valgrind
+ $ meson test --setup valgrind
`Valgrind <http://valgrind.org/>`__ is a test that checks for
memory management issues, such as leaks or use of uninitialized
based on the time they take in comparison to the likelihood
that those tests will turn up problems during incremental
builds. These tests default to being run when building from a
-tarball or with the configure option --enable-expensive-tests;
+tarball or with the configure option -Dexpensive_tests=enabled;
you can also force a one-time toggle of these tests by setting
VIR_TEST_EXPENSIVE to 0 or 1 at make time, as in:
::
- $ make check VIR_TEST_EXPENSIVE=1
+ $ VIR_TEST_EXPENSIVE=1 ninja test
If you encounter any failing tests, the VIR_TEST_DEBUG
environment variable may provide extra information to debug the
::
- $ VIR_TEST_DEBUG=1 make check (or)
- $ VIR_TEST_DEBUG=2 make check
+ $ VIR_TEST_DEBUG=1 ninja test (or)
+ $ VIR_TEST_DEBUG=2 ninja test
When debugging failures during development, it is possible to
focus in on just the failing subtests by using VIR_TEST_RANGE.
self-contained if possible, with an explanation of each patch
and an explanation of how the sequence of patches fits
together. Moreover, please keep in mind that it's required to
- be able to compile cleanly (**including**
- ``make check`` and ``make syntax-check``) after each
- patch. A feature does not have to work until the end of a
+ be able to compile cleanly (**including** ``ninja test``) after
+ each patch. A feature does not have to work until the end of a
series, but intermediate patches must compile and not cause
test-suite failures (this is to preserve the usefulness of
``git bisect``, among other things).
touches a part of the code where you're not the main maintainer,
or where you do not have a very clear idea of how things work,
it's better to wait for a more authoritative feedback though.
-Before committing, please also rebuild locally, run 'make check
-syntax-check', and make sure you don't raise errors.
+Before committing, please also rebuild locally, run 'ninja test',
+and make sure you don't raise errors.
An exception to 'review and approval on the list first' is fixing
failures to build:
- if a recently committed patch breaks compilation on a platform
or for a given driver, then it's fine to commit a minimal fix
directly without getting the review feedback first
-- if make check or make syntax-check breaks, if there is an
- obvious fix, it's fine to commit immediately. The patch should
- still be sent to the list (or tell what the fix was if
- trivial), and 'make check syntax-check' should pass too, before
- committing anything
+- if ninja test breaks, if there is an obvious fix, it's fine to
+ commit immediately. The patch should still be sent to the list
+ (or tell what the fix was if trivial), and 'ninja test' should
+ pass too, before committing anything
- fixes for documentation and code comments can be managed in the
same way, but still make sure they get reviewed if non-trivial.
- (ir)regular pulls from other repositories or automated updates,
<h2><a id="compiling">Compiling a release tarball</a></h2>
<p>
- libvirt uses the standard configure/make/install steps and mandates
+ libvirt uses the standard setup/build/install steps and mandates
that the build directory is different that the source directory:
</p>
<pre>
$ xz -c libvirt-x.x.x.tar.xz | tar xvf -
$ cd libvirt-x.x.x
-$ mkdir build && cd build
-$ ../configure</pre>
+$ meson build</pre>
<p>
- The <i>configure</i> script can be given options to change its default
+ The <i>meson</i> script can be given options to change its default
behaviour.
</p>
<p>
- To get the complete list of the options it can take, pass it the
- <i>--help</i> option like this:
+ To get the complete list of the options run the following command:
</p>
<pre>
-$ ../configure <i>--help</i></pre>
+$ meson configure</pre>
<p>
When you have determined which options you want to use (if any),
</p>
<p>
- Note the use of <b>sudo</b> with the <i>make install</i> command
+ Note the use of <b>sudo</b> with the <i>ninja install</i> command
below. Using sudo is only required when installing to a location your
user does not have write access to. Installing to a system location
is a good example of this.
<p>
If you are installing to a location that your user <i>does</i> have write
- access to, then you can instead run the <i>make install</i> command
+ access to, then you can instead run the <i>ninja install</i> command
without putting <b>sudo</b> before it.
</p>
<pre>
-$ ../configure <i>[possible options]</i>
-$ make
-$ <b>sudo</b> <i>make install</i></pre>
+$ meson build <i>[possible options]</i>
+$ ninja -C build
+$ <b>sudo</b> <i>ninja -C build install</i></pre>
<p>
At this point you <b>may</b> have to run ldconfig or a similar utility
<h2><a id="building">Building from a GIT checkout</a></h2>
<p>
- The libvirt build process uses GNU autotools, so after obtaining a
- checkout it is necessary to generate the configure script and Makefile.in
- templates using the <code>autogen.sh</code> command. By default when
- the <code>configure</code> script is run from within a GIT checkout, it
+ The libvirt build process uses Meson build system. By default when
+ the <code>meson</code> is run from within a GIT checkout, it
will turn on -Werror for builds. This can be disabled with
- --disable-werror, but this is not recommended.
+ --werror=false, but this is not recommended.
</p>
<p>To build & install libvirt to your home
</p>
<pre>
-$ mkdir build && cd build
-$ ../autogen.sh --prefix=$HOME/usr
-$ make
-$ <b>sudo</b> make install</pre>
+$ meson build --prefix=$HOME/usr
+$ ninja -C build
+$ <b>sudo</b> ninja -C build install</pre>
<p>
Be aware though, that binaries built with a custom prefix will not
</p>
<pre>
-$ mkdir build && cd build
-$ ../autogen.sh --system
-$ make
+$ meson build -Dsystem=true
+$ ninja -C build
</pre>
<p>
::
- $ make check
- $ make syntax-check
+ $ ninja test
These tests help making sure that your changes don't introduce
regressions in libvirt, as well as validating that any new code
in the C language.</dd>
<dt>Python</dt>
<dd>Various supporting build/test scripts are written in Python, with
- compatibility for Python 2 and 3.</dd>
+ compatibility for Python 3.</dd>
<dt>Perl</dt>
<dd>Various supporting build/test scripts are written in Perl. It is
also used for many syntax-check inline rules</dd>
<dt>Shell</dt>
- <dd><code>configure</code>, generated by autoconf, is a shell script.
- Shell is also used for some simple build/test scripts. At runtime
+ <dd>Shell is used for some simple build/test scripts. At runtime
libvirt avoids shell except when using SSH tunnels to a remote
host</dd>
<dt>XSLT</dt>
<dt>HTML</dt>
<dd>The website documentation is all written in plain HTML. Some HTML
is also auto-generated for API documentation</dd>
- <dt>M4</dt>
- <dd>The autoconf <code>configure</code> script uses a large number of
- M4 macros to generate its content</dd>
+ <dt>Meson</dt>
+ <dd>The core build system uses the new Meson build system</dd>
<dt>make</dt>
- <dd>The core build system uses the traditional GNU make recipes</dd>
- <dt>automake</dt>
- <dd>The make recipes use automake's language extensions which are
- then turned into regular make rules</dd>
+ <dd>The syntax-check uses make recipes</dd>
<dt>awk/sed</dt>
<dd>A number of the syntax-check inline rules involve use of awk/sed
scripts</dd>
The wide range of languages used present a knowledge burden for
developers involved in libvirt, especially when there are multiple
languages all used in the same problem spaces. This is most notable
- in the build system which uses a combination of shell, M4, make,
- automake, awk, sed, Perl and Python, with debugging requiring
+ in the build system which uses a combination of Meson, shell, awk,
+ sed, Perl and Python, with debugging requiring
understanding of the interactions between many languages. The
popularity of Perl has declined, while Python has become
more popular. This directly influences the amount and quality of
code.
</p>
- <p>
- The Meson build system is written in Python 3. This directly informs the
- choice of Python 3 as the language for all supporting build scripts,
- re-inforcing the other benefits of Python over Perl, Shell, M4,
- automake, etc. There is no intention to support Python 2 given Meson's
- requirement for Python 3.
- </p>
-
<p>
Using the RST format for documentation allows for the use of XSLT to be
eliminated from the build process. RST and the Sphinx toolkit are widely
</p>
<pre>
-mkdir build && cd build
-../configure \
- --without-sasl \
- --without-polkit \
- --without-python \
- --without-libxl \
- --without-qemu \
- --without-lxc \
- --without-openvz \
- --without-libvirtd
+meson build \
+ -Dsasl=disabled \
+ -Dpolkit=disabled \
+ -Ddriver_libxl=disabled \
+ -Ddriver_qemu=disabled \
+ -Ddriver_lxc=disabled \
+ -Ddriver_openvz=disabled \
+ -Ddriver_libvirtd=disabled
</pre>
</body>