From nobody Sun Feb 8 20:53:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1662732426; cv=none; d=zohomail.com; s=zohoarc; b=NGPdELCeMsMvm8gqI6sGkGacJZjI64C+1pXU9/Gav8Kjl4+LZaT4QqvOIZ65mOEYE49yJBnoxsafbu6RZMr6vaxuRGQQStF41yOY+mb4GFxpoRhb5wxWi2KGvW4X/hRAKKvq2ylOTsJcddD+n9qDYQvGWF5dy0hRAD3TMuo5frY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662732426; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TTVcXDiLKiKXjcHfmbwbWtF1e3+F3CBu3ODatTe3ry4=; b=Mn3pVjYQHvSFgWrOI17zIjCBhY1iNhGO1lkjcLCe39glyeeIKI6rxoSoDpSUSVCAJtaedxscD57m4MZx9aYeYjGlxAECipZBglgCZePTSvgYOJxrwl0I66cF9KicoJ7j3mStS7Iv3j9NQxrik5b4lsc3bQIQcNbGlQner2wnbfo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1662732426417607.0883075915388; Fri, 9 Sep 2022 07:07:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-zL-6BRlrOlqUZyKKIWmVlw-1; Fri, 09 Sep 2022 10:06:32 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D07C7823F18; Fri, 9 Sep 2022 14:06:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB9D62026D4C; Fri, 9 Sep 2022 14:06:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AF2251946A42; Fri, 9 Sep 2022 14:06:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4FCFD1946A41 for ; Fri, 9 Sep 2022 14:06:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 33722112131E; Fri, 9 Sep 2022 14:06:18 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0B89112131B for ; Fri, 9 Sep 2022 14:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662732425; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TTVcXDiLKiKXjcHfmbwbWtF1e3+F3CBu3ODatTe3ry4=; b=E2L4DRDMkIuUeCM6FmBOBmUjIztVQaib5ka7snto3UwVfbL6Hms2Ik4O7o3YvOULfx0y6d HsltQ3WX5+w0mbmcR4Eq+iZLOxAchGn/9LaiNGXwIao5DKB7//oD/7UYGiwkvkCMNCXfMu rXM+Q8xw5udPZWBP+vtuI41KcpbChHs= X-MC-Unique: zL-6BRlrOlqUZyKKIWmVlw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/6] docs: compiling: Separate 'prepare', 'configure', and 'build' steps Date: Fri, 9 Sep 2022 16:06:10 +0200 Message-Id: <835279c5015ef8fa31d6ef6f459e497f6eb319b3.1662732168.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1662732427650100001 Content-Type: text/plain; charset="utf-8" Only the preparation of sources differs between a build from a git checkout vs a build from tarball. Restructure the docs to outline the difference and combine information on how to configure libvirt. Most notably the suggestion to use '-Dsystem=3Dtrue' was present only for the steps to build a git checkout. Suggest also running the testsuite as part of the build step. Signed-off-by: Peter Krempa --- docs/compiling.rst | 86 +++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 32 deletions(-) diff --git a/docs/compiling.rst b/docs/compiling.rst index c167fd238f..1969b9b0b0 100644 --- a/docs/compiling.rst +++ b/docs/compiling.rst @@ -24,24 +24,47 @@ allow installing the most recent versions of virtualiza= tion packages: The ``app-emulation/libvirt`` is regularly updated, but newest versions= are usually marked as testing by the ``~*`` keyword. -Compiling a release tarball ---------------------------- +Preparing sources +----------------- -libvirt uses the standard setup/build/install steps and mandates that -the build directory is different from the source directory: +Libvirt can be built both from release tarballs and from a git checkout us= ing +the same steps once the source code is prepared. Note that the build system +requires that the build directory is separate from the top level source +directory. + +By default further steps will build libvirt inside a subdirectory of the s= ource +tree named ``build``. + +Refer to the `downloads page `__ for official tarballs and= the +git repository. + +Unpacking a source tarball +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Download a source tarball of the version you want to compile and unpack it +using the following commands: :: $ xz -dc libvirt-x.x.x.tar.xz | tar xvf - $ cd libvirt-x.x.x - $ meson build -The *meson* script can be given options to change its default behaviour. +Git checkout +~~~~~~~~~~~~ -**Note:** Please ensure that you have the appropriate minimal ``meson`` ve= rsion -installed in your build environment. The minimal version for a specific pa= ckage -can be checked in the top level ``meson.build`` file in the ``meson_versio= n`` -field. +A git checkout/clone is already in correct state for next steps. Just chan= ge +your working directory to the checkout. + +Configuring the project +----------------------- + +The libvirt build process uses the **Meson** build system. To configure fo= r a +build use the following command. Note that the ``build`` argument is the n= ame +of the build directory which will be created. + +:: + + $ meson build [options] To get the complete list of the options run the following command: @@ -49,43 +72,42 @@ To get the complete list of the options run the followi= ng command: $ meson configure -When you have determined which options you want to use (if any), -continue the process. +Be aware that by default the build is configured with a local ``prefix`` p= ath +which will not interoperate with OS vendor provided binaries, since the UN= IX +socket paths will all be different. To produce a build that is compatible = with +normal OS vendor prefixes, use :: - $ meson build [possible options] - $ ninja -C build + $ meson build -Dsystem=3Dtrue -The ``build`` directory now contains the built binaries. +By default when the ``meson`` is run from within a GIT checkout, it will t= urn +on -Werror for builds. This can be disabled with --werror=3Dfalse, but thi= s is +not recommended. + +**Note:** Please ensure that you have the appropriate minimal ``meson`` ve= rsion +installed in your build environment. The minimal version for a specific pa= ckage +can be checked in the top level ``meson.build`` file in the ``meson_versio= n`` +field. -Building from a GIT checkout ----------------------------- -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 --werror=3Dfalse, but this is not -recommended. +Compiling the sources +--------------------- -To build & install libvirt to your home directory the following commands -can be run: +To build the configured project run (note that ``-C build`` is a path to t= he +build directory): :: - $ meson build --prefix=3D$HOME/usr $ ninja -C build -Be aware though, that binaries built with a custom prefix will not -interoperate with OS vendor provided binaries, since the UNIX socket -paths will all be different. To produce a build that is compatible with -normal OS vendor prefixes, use +The ``build`` directory now contains the built binaries. -:: +Additionally you can also run the test suite: - $ meson build -Dsystem=3Dtrue - $ ninja -C build +:: -The ``build`` directory now contains the built binaries. + $ ninja -C build test Running compiled binaries from build directory ---------------------------------------------- --=20 2.37.1