From nobody Sat Apr 27 22:34:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1568988968; cv=none; d=zoho.com; s=zohoarc; b=LNazb86jqk+xkX3SJRLILxVBYY5K5f3MkRgXVrQrDa/c7RvlNrTAF8CVzaPsA3zjDq0Rj89QUdPI8EnZ9Tw4VGX8ig5wG4DjlM1hv+jWRHFadYBzE/D7IRBucF1G+VZiQQoGN5FXuoWHNn6O7blBDXq5M5mhtPxsdq/89qcdRfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568988968; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=APJ+0igCjyeoSOfQSMZPD5gu7FZYsVMP9hEp0OQAQYE=; b=HAviH1aXhKvnNBQg9u0kX+VGSY3e9jS/1CqgPvxthgSFYW6S7Ubxb7IKejslyat+kIY+0/tLAve4Gubka+tRCbN7zlyv31ImLWnO3FVVpU4GLwUNjIktFVwRZruG5KgxVDGGJdbVkiXWs9VxaOwlLRVb9KlxoOXZFuuevMhhGvo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568988968067826.3973301856528; Fri, 20 Sep 2019 07:16:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3ECE308624A; Fri, 20 Sep 2019 14:16:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1871160606; Fri, 20 Sep 2019 14:16:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 464E61803B37; Fri, 20 Sep 2019 14:16:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8KEC96D015769 for ; Fri, 20 Sep 2019 10:12:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id F06335787; Fri, 20 Sep 2019 14:12:09 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5122194BB; Fri, 20 Sep 2019 14:12:03 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 20 Sep 2019 15:12:01 +0100 Message-Id: <20190920141201.21490-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] docs: attempt to document the general libvirt dev strategy X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 20 Sep 2019 14:16:05 +0000 (UTC) There are various ideas / plans floating around for future libvirt work, some of which is actively in progress. Historically we've never captured this kind of information anywhere, except in mailing list discussions. In particular guidelines in hacking.html.in don't appear until a policy is actively applied. This patch attempts to fill the documentation gap, by creating a new "strategy" page which outlines the general vision for some notable future changes. The key thing to note is that none of the stuff on this page is guaranteed, plans may change as new information arises. IOW this is a "best guess" as to the desired future. This doc has focused on three areas, related to the topic of language usage / consolidation - Use of non-C languages for the library, daemons or helper tools - Replacement of autotools with meson - Use of RST and Sphinx for documentation (website + man pages) Signed-off-by: Daniel P. Berrang=C3=A9 --- docs/docs.html.in | 3 + docs/strategy.html.in | 143 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 docs/strategy.html.in diff --git a/docs/docs.html.in b/docs/docs.html.in index c1741c89b4..6cf09f51bc 100644 --- a/docs/docs.html.in +++ b/docs/docs.html.in @@ -128,6 +128,9 @@
Contributor guidelines
General hacking guidelines for contributors
=20 +
Project strategy
+
Sets a vision for future direction & technical choices
+
Bug reports
How and where to report bugs and request features
=20 diff --git a/docs/strategy.html.in b/docs/strategy.html.in new file mode 100644 index 0000000000..41bbebb8f9 --- /dev/null +++ b/docs/strategy.html.in @@ -0,0 +1,143 @@ + + + + +

Libvirt Project Strategy

+ +

+ This document attempts to outline the libvirt project strategy for + the near future. Think of this is a high level vision or todo list + setting the direction for the project & its developers to take +

+ +

Language consolidation

+ +

+ At time of writing libvirt uses the following languages +

+ +
+
C
+
The core libvirt library, daemons, and helper tools are all writ= ten + in the C language.
+
Python
+
Various supporting build/test scripts are written in Python, with + compatibility for Python 2 and 3.
+
Perl
+
Various supporting build/test scripts are written in Python. It = is + also used for many syntax-check inline rules
+
Shell
+
The autoconf configure script, is essentially shell script. Shell + is also used for some simple build/test scripts. At runtime libvirt + avoids shell except when using SSH tunnels to a remote host
+
XSLT
+
The website documentation is subsituted into templates using XSLT + scripts. The API documentation is also autogenerated from an XML + description using XSLT
+
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
+
make
+
The core build system uses the traditional GNU make recipes
+
automake
+
The make recipes make use of automake's make language extensions + which are then turned into regular make rules
+
awk/sed
+
A number of the syntax-check inline rules involve use of awk/sed + scripts
+
POD
+
The command line manual pages are typically written in Perl's POD + format, and converted to troff +
+ +

+ 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 + understanding of the interactions between many languages. The + relative popularity of the languages has implications for how easily + the project can attract new contributors, and the quality of the code + they'll be able to submit. This is most notable when comparing Perl + to Python, as since the start of the libvirt project, the popularity + and knowledge of Perl has declined, while Python has risen. +

+

+ The C language has served libvirt well over the years, but its age s= hows + giving rise to limitations which negatively impact the project in te= rms + of code quality, reliability, and efficiency of development. Most no= tably + its lack of memory safety means that many code bugs become trivially + exploitable security flaws or denial of service. The lack of a high + level portable runtime, resulting in alot of effort being spent to + ensure cross platform portability. The modern languages Rust and Go + provide viable options for low level systems programming, in a way t= hat + was not practical with other common languages such as Python and Jav= a. + There is thus a desire to make use of either Rust or Go, or more lik= ely + a combination of both, to incrementally replace existing use of C, a= nd + also for greenfield development. +

+

+ With this in mind the libvirt project has set a vision for language + usage in the future +

+ +
+
C
+
The core libvirt library, daemons, and helper tools are all writ= ten + in the C language.
+
Rust
+
Parts of the core libvirt library / daemon are to be able to lev= erage + Rust to replace C. (TBD vs Go)
+
Go
+
Parts of the core libvirt library / daemon are to be able to lev= erage + Rust to replace C. (TBD vs Rust). Helper tools are able to be writ= ten + in Go.
+
Meson
+
The core build system is to be written in meson.
+
Python
+
Various supporting build/test scripts are written in Python 3 + compatible mode only.
+
RST
+
The website and command man pages are to be written in RST, using + Sphinx as the engine to convert to end user formats like HTML, tro= ff, + etc
+
+ +

+ Some notable points from the above. Whether the core library / daemo= ns + will use Rust or Go internally is still to be decided based on more + detailed evaluation of their pros and cons, to identify the best fit, + as the need to link & embed this functionality in other processes has + complex interactions both at a technical and non-technical level. For + standalone helper tools, Go is a good fit for rapid development as + there are no concerns around interactions with other in-process code + from 3rd parties. +

+ +

+ The meson build system is written in Python, at time of writing, + requiring version 3.4 or later. This directly informs the choice to = use + Python 3.4 as the language for all supporting build scripts, re-info= rcing + the other benefits of Python, over Perl, Shell, M4, automake, etc. +

+ +

+ 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 wi= dely + used, as seen by the huge repository of content on + https://readthedocs.org/. The ability embed raw HTML in the RST docs= will + greatly facilitate its adoption, avoiding the need for a big bang + conversion of existing content. Given the desire to eliminate Perl + usage, replacing the use of POD documentation for manual pages is an + obvious followup task. RST is the obvious choice to given alignment + with the website, allowing the man pages to be easily published onli= ne + with other docs. It is further anticipated that the current API docs + generator which uses XSLT to convert the XML API description would be + converted to something which generates RST using Python instead of X= SL. +

+ + --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list