meson: adjust our documentation to mention meson instead of autoconf

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-17 21:09:25 +02:00
parent 7e5d771d17
commit 942d377d25
8 changed files with 52 additions and 78 deletions

View File

@ -12,13 +12,12 @@ your git clone run:
:: ::
$ mkdir build && cd build $ meson build
$ ../autogen.sh $ ninja -C build
$ make
You'll find the freshly-built document in ``docs/contribute.html``. 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 up your system by calling
:: ::
@ -39,7 +38,7 @@ to run
:: ::
$ 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 You might still be missing some dependencies if your distribution is
shipping an old libvirt version, but that will get you much closer to shipping an old libvirt version, but that will get you much closer to

View File

@ -6,8 +6,7 @@ The basic requirement before submitting changes to libvirt is that
:: ::
$ make check $ ninja test
$ make syntax-check
succeed after each commit. succeed after each commit.
@ -17,7 +16,7 @@ by running
:: ::
$ make -C tests valgrind $ meson test --setup valgrind
`Valgrind <http://valgrind.org/>`__ is a test that checks for `Valgrind <http://valgrind.org/>`__ is a test that checks for
memory management issues, such as leaks or use of uninitialized memory management issues, such as leaks or use of uninitialized
@ -27,13 +26,13 @@ Some tests are skipped by default in a development environment,
based on the time they take in comparison to the likelihood based on the time they take in comparison to the likelihood
that those tests will turn up problems during incremental that those tests will turn up problems during incremental
builds. These tests default to being run when building from a 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 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: 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 If you encounter any failing tests, the VIR_TEST_DEBUG
environment variable may provide extra information to debug the environment variable may provide extra information to debug the
@ -42,8 +41,8 @@ amounts of information:
:: ::
$ VIR_TEST_DEBUG=1 make check (or) $ VIR_TEST_DEBUG=1 ninja test (or)
$ VIR_TEST_DEBUG=2 make check $ VIR_TEST_DEBUG=2 ninja test
When debugging failures during development, it is possible to When debugging failures during development, it is possible to
focus in on just the failing subtests by using VIR_TEST_RANGE. focus in on just the failing subtests by using VIR_TEST_RANGE.

View File

@ -25,9 +25,8 @@ with minimal back-and-forth.
self-contained if possible, with an explanation of each patch self-contained if possible, with an explanation of each patch
and an explanation of how the sequence of patches fits and an explanation of how the sequence of patches fits
together. Moreover, please keep in mind that it's required to together. Moreover, please keep in mind that it's required to
be able to compile cleanly (**including** be able to compile cleanly (**including** ``ninja test``) after
``make check`` and ``make syntax-check``) after each each patch. A feature does not have to work until the end of a
patch. A feature does not have to work until the end of a
series, but intermediate patches must compile and not cause series, but intermediate patches must compile and not cause
test-suite failures (this is to preserve the usefulness of test-suite failures (this is to preserve the usefulness of
``git bisect``, among other things). ``git bisect``, among other things).

View File

@ -12,8 +12,8 @@ objection on the list it should be good to go. If the patch
touches a part of the code where you're not the main maintainer, 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, 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. it's better to wait for a more authoritative feedback though.
Before committing, please also rebuild locally, run 'make check Before committing, please also rebuild locally, run 'ninja test',
syntax-check', and make sure you don't raise errors. and make sure you don't raise errors.
An exception to 'review and approval on the list first' is fixing An exception to 'review and approval on the list first' is fixing
failures to build: failures to build:
@ -21,11 +21,10 @@ failures to build:
- if a recently committed patch breaks compilation on a platform - if a recently committed patch breaks compilation on a platform
or for a given driver, then it's fine to commit a minimal fix or for a given driver, then it's fine to commit a minimal fix
directly without getting the review feedback first directly without getting the review feedback first
- if make check or make syntax-check breaks, if there is an - if ninja test breaks, if there is an obvious fix, it's fine to
obvious fix, it's fine to commit immediately. The patch should commit immediately. The patch should still be sent to the list
still be sent to the list (or tell what the fix was if (or tell what the fix was if trivial), and 'ninja test' should
trivial), and 'make check syntax-check' should pass too, before pass too, before committing anything
committing anything
- fixes for documentation and code comments can be managed in the - fixes for documentation and code comments can be managed in the
same way, but still make sure they get reviewed if non-trivial. same way, but still make sure they get reviewed if non-trivial.
- (ir)regular pulls from other repositories or automated updates, - (ir)regular pulls from other repositories or automated updates,

View File

@ -9,28 +9,26 @@
<h2><a id="compiling">Compiling a release tarball</a></h2> <h2><a id="compiling">Compiling a release tarball</a></h2>
<p> <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: that the build directory is different that the source directory:
</p> </p>
<pre> <pre>
$ xz -c libvirt-x.x.x.tar.xz | tar xvf - $ xz -c libvirt-x.x.x.tar.xz | tar xvf -
$ cd libvirt-x.x.x $ cd libvirt-x.x.x
$ mkdir build &amp;&amp; cd build $ meson build</pre>
$ ../configure</pre>
<p> <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. behaviour.
</p> </p>
<p> <p>
To get the complete list of the options it can take, pass it the To get the complete list of the options run the following command:
<i>--help</i> option like this:
</p> </p>
<pre> <pre>
$ ../configure <i>--help</i></pre> $ meson configure</pre>
<p> <p>
When you have determined which options you want to use (if any), When you have determined which options you want to use (if any),
@ -38,7 +36,7 @@ $ ../configure <i>--help</i></pre>
</p> </p>
<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 below. Using sudo is only required when installing to a location your
user does not have write access to. Installing to a system location user does not have write access to. Installing to a system location
is a good example of this. is a good example of this.
@ -46,14 +44,14 @@ $ ../configure <i>--help</i></pre>
<p> <p>
If you are installing to a location that your user <i>does</i> have write 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. without putting <b>sudo</b> before it.
</p> </p>
<pre> <pre>
$ ../configure <i>[possible options]</i> $ meson build <i>[possible options]</i>
$ make $ ninja -C build
$ <b>sudo</b> <i>make install</i></pre> $ <b>sudo</b> <i>ninja -C build install</i></pre>
<p> <p>
At this point you <b>may</b> have to run ldconfig or a similar utility At this point you <b>may</b> have to run ldconfig or a similar utility
@ -63,12 +61,10 @@ $ <b>sudo</b> <i>make install</i></pre>
<h2><a id="building">Building from a GIT checkout</a></h2> <h2><a id="building">Building from a GIT checkout</a></h2>
<p> <p>
The libvirt build process uses GNU autotools, so after obtaining a The libvirt build process uses Meson build system. By default when
checkout it is necessary to generate the configure script and Makefile.in the <code>meson</code> is run from within a GIT checkout, it
templates using the <code>autogen.sh</code> command. By default when
the <code>configure</code> script is run from within a GIT checkout, it
will turn on -Werror for builds. This can be disabled with 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>
<p>To build &amp; install libvirt to your home <p>To build &amp; install libvirt to your home
@ -76,10 +72,9 @@ $ <b>sudo</b> <i>make install</i></pre>
</p> </p>
<pre> <pre>
$ mkdir build &amp;&amp; cd build $ meson build --prefix=$HOME/usr
$ ../autogen.sh --prefix=$HOME/usr $ ninja -C build
$ make $ <b>sudo</b> ninja -C build install</pre>
$ <b>sudo</b> make install</pre>
<p> <p>
Be aware though, that binaries built with a custom prefix will not Be aware though, that binaries built with a custom prefix will not
@ -89,9 +84,8 @@ $ <b>sudo</b> make install</pre>
</p> </p>
<pre> <pre>
$ mkdir build &amp;&amp; cd build $ meson build -Dsystem=true
$ ../autogen.sh --system $ ninja -C build
$ make
</pre> </pre>
<p> <p>

View File

@ -30,8 +30,7 @@ changes. That is:
:: ::
$ make check $ ninja test
$ make syntax-check
These tests help making sure that your changes don't introduce These tests help making sure that your changes don't introduce
regressions in libvirt, as well as validating that any new code regressions in libvirt, as well as validating that any new code

View File

@ -22,13 +22,12 @@
in the C language.</dd> in the C language.</dd>
<dt>Python</dt> <dt>Python</dt>
<dd>Various supporting build/test scripts are written in Python, with <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> <dt>Perl</dt>
<dd>Various supporting build/test scripts are written in Perl. It is <dd>Various supporting build/test scripts are written in Perl. It is
also used for many syntax-check inline rules</dd> also used for many syntax-check inline rules</dd>
<dt>Shell</dt> <dt>Shell</dt>
<dd><code>configure</code>, generated by autoconf, is a shell script. <dd>Shell is used for some simple build/test scripts. At runtime
Shell is also used for some simple build/test scripts. At runtime
libvirt avoids shell except when using SSH tunnels to a remote libvirt avoids shell except when using SSH tunnels to a remote
host</dd> host</dd>
<dt>XSLT</dt> <dt>XSLT</dt>
@ -38,14 +37,10 @@
<dt>HTML</dt> <dt>HTML</dt>
<dd>The website documentation is all written in plain HTML. Some HTML <dd>The website documentation is all written in plain HTML. Some HTML
is also auto-generated for API documentation</dd> is also auto-generated for API documentation</dd>
<dt>M4</dt> <dt>Meson</dt>
<dd>The autoconf <code>configure</code> script uses a large number of <dd>The core build system uses the new Meson build system</dd>
M4 macros to generate its content</dd>
<dt>make</dt> <dt>make</dt>
<dd>The core build system uses the traditional GNU make recipes</dd> <dd>The syntax-check uses make recipes</dd>
<dt>automake</dt>
<dd>The make recipes use automake's language extensions which are
then turned into regular make rules</dd>
<dt>awk/sed</dt> <dt>awk/sed</dt>
<dd>A number of the syntax-check inline rules involve use of awk/sed <dd>A number of the syntax-check inline rules involve use of awk/sed
scripts</dd> scripts</dd>
@ -58,8 +53,8 @@
The wide range of languages used present a knowledge burden for The wide range of languages used present a knowledge burden for
developers involved in libvirt, especially when there are multiple developers involved in libvirt, especially when there are multiple
languages all used in the same problem spaces. This is most notable languages all used in the same problem spaces. This is most notable
in the build system which uses a combination of shell, M4, make, in the build system which uses a combination of Meson, shell, awk,
automake, awk, sed, Perl and Python, with debugging requiring sed, Perl and Python, with debugging requiring
understanding of the interactions between many languages. The understanding of the interactions between many languages. The
popularity of Perl has declined, while Python has become popularity of Perl has declined, while Python has become
more popular. This directly influences the amount and quality of more popular. This directly influences the amount and quality of
@ -119,14 +114,6 @@
code. code.
</p> </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> <p>
Using the RST format for documentation allows for the use of XSLT to be 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 eliminated from the build process. RST and the Sphinx toolkit are widely

View File

@ -180,16 +180,14 @@
</p> </p>
<pre> <pre>
mkdir build &amp;&amp; cd build meson build \
../configure \ -Dsasl=disabled \
--without-sasl \ -Dpolkit=disabled \
--without-polkit \ -Ddriver_libxl=disabled \
--without-python \ -Ddriver_qemu=disabled \
--without-libxl \ -Ddriver_lxc=disabled \
--without-qemu \ -Ddriver_openvz=disabled \
--without-lxc \ -Ddriver_libvirtd=disabled
--without-openvz \
--without-libvirtd
</pre> </pre>
</body> </body>