From 942d377d25ab2be8be36a172789c2d2127b5236a Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Fri, 17 Jul 2020 21:09:25 +0200 Subject: [PATCH] meson: adjust our documentation to mention meson instead of autoconf Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- CONTRIBUTING.rst | 9 ++++---- docs/advanced-tests.rst | 13 +++++------ docs/best-practices.rst | 5 ++--- docs/committer-guidelines.rst | 13 +++++------ docs/compiling.html.in | 42 +++++++++++++++-------------------- docs/hacking.rst | 3 +-- docs/strategy.html.in | 27 ++++++---------------- docs/windows.html.in | 18 +++++++-------- 8 files changed, 52 insertions(+), 78 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 972b189873..bda5cae627 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -12,13 +12,12 @@ your git clone run: :: - $ 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 :: @@ -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 shipping an old libvirt version, but that will get you much closer to diff --git a/docs/advanced-tests.rst b/docs/advanced-tests.rst index d2d29d976d..bc20bbf4d9 100644 --- a/docs/advanced-tests.rst +++ b/docs/advanced-tests.rst @@ -6,8 +6,7 @@ The basic requirement before submitting changes to libvirt is that :: - $ make check - $ make syntax-check + $ ninja test succeed after each commit. @@ -17,7 +16,7 @@ by running :: - $ make -C tests valgrind + $ meson test --setup valgrind `Valgrind `__ is a test that checks for 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 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 @@ -42,8 +41,8 @@ amounts of information: :: - $ 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. diff --git a/docs/best-practices.rst b/docs/best-practices.rst index 4a28b03b65..8283f627ce 100644 --- a/docs/best-practices.rst +++ b/docs/best-practices.rst @@ -25,9 +25,8 @@ with minimal back-and-forth. 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). diff --git a/docs/committer-guidelines.rst b/docs/committer-guidelines.rst index 3be08e6fed..d2c530d895 100644 --- a/docs/committer-guidelines.rst +++ b/docs/committer-guidelines.rst @@ -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, 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: @@ -21,11 +21,10 @@ 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, diff --git a/docs/compiling.html.in b/docs/compiling.html.in index 18943a9a79..a4b8602cd1 100644 --- a/docs/compiling.html.in +++ b/docs/compiling.html.in @@ -9,28 +9,26 @@

Compiling a release tarball

- 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:

 $ xz -c libvirt-x.x.x.tar.xz | tar xvf -
 $ cd libvirt-x.x.x
-$ mkdir build && cd build
-$ ../configure
+$ meson build

- The configure script can be given options to change its default + The meson script can be given options to change its default behaviour.

- To get the complete list of the options it can take, pass it the - --help option like this: + To get the complete list of the options run the following command:

-$ ../configure --help
+$ meson configure

When you have determined which options you want to use (if any), @@ -38,7 +36,7 @@ $ ../configure --help

- Note the use of sudo with the make install command + Note the use of sudo with the ninja install 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. @@ -46,14 +44,14 @@ $ ../configure --help

If you are installing to a location that your user does have write - access to, then you can instead run the make install command + access to, then you can instead run the ninja install command without putting sudo before it.

-$ ../configure [possible options]
-$ make
-$ sudo make install
+$ meson build [possible options] +$ ninja -C build +$ sudo ninja -C build install

At this point you may have to run ldconfig or a similar utility @@ -63,12 +61,10 @@ $ sudo make install

Building from a GIT checkout

- 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 autogen.sh command. By default when - the configure script is run from within a GIT checkout, it + The libvirt build process uses Meson build system. By default when + the meson 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.

To build & install libvirt to your home @@ -76,10 +72,9 @@ $ sudo make install

-$ mkdir build && cd build
-$ ../autogen.sh --prefix=$HOME/usr
-$ make
-$ sudo make install
+$ meson build --prefix=$HOME/usr +$ ninja -C build +$ sudo ninja -C build install

Be aware though, that binaries built with a custom prefix will not @@ -89,9 +84,8 @@ $ sudo make install

-$ mkdir build && cd build
-$ ../autogen.sh --system
-$ make
+$ meson build -Dsystem=true
+$ ninja -C build
     

diff --git a/docs/hacking.rst b/docs/hacking.rst index ccc94010b3..3fc5888a71 100644 --- a/docs/hacking.rst +++ b/docs/hacking.rst @@ -30,8 +30,7 @@ changes. That is: :: - $ 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 diff --git a/docs/strategy.html.in b/docs/strategy.html.in index 42c285d9f6..0d845d006a 100644 --- a/docs/strategy.html.in +++ b/docs/strategy.html.in @@ -22,13 +22,12 @@ in the C language.

Python
Various supporting build/test scripts are written in Python, with - compatibility for Python 2 and 3.
+ compatibility for Python 3.
Perl
Various supporting build/test scripts are written in Perl. It is also used for many syntax-check inline rules
Shell
-
configure, generated by autoconf, is a shell script. - Shell is also used for some simple build/test scripts. At runtime +
Shell is used for some simple build/test scripts. At runtime libvirt avoids shell except when using SSH tunnels to a remote host
XSLT
@@ -38,14 +37,10 @@
HTML
The website documentation is all written in plain HTML. Some HTML is also auto-generated for API documentation
-
M4
-
The autoconf configure script uses a large number of - M4 macros to generate its content
+
Meson
+
The core build system uses the new Meson build system
make
-
The core build system uses the traditional GNU make recipes
-
automake
-
The make recipes use automake's language extensions which are - then turned into regular make rules
+
The syntax-check uses make recipes
awk/sed
A number of the syntax-check inline rules involve use of awk/sed scripts
@@ -58,8 +53,8 @@ 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 @@ -119,14 +114,6 @@ code.

-

- 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. -

-

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 diff --git a/docs/windows.html.in b/docs/windows.html.in index a0ff525e1a..13dab1f6a4 100644 --- a/docs/windows.html.in +++ b/docs/windows.html.in @@ -180,16 +180,14 @@

-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