From patchwork Mon Oct 12 23:37:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11834483 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8C981580 for ; Mon, 12 Oct 2020 23:40:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 854E320838 for ; Mon, 12 Oct 2020 23:40:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b+ScMeME" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 854E320838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:54832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kS7QF-0004gm-G7 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Oct 2020 19:40:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kS7OJ-0002tI-HG; Mon, 12 Oct 2020 19:38:07 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:46674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kS7OH-000738-I9; Mon, 12 Oct 2020 19:38:07 -0400 Received: by mail-pf1-x436.google.com with SMTP id y14so15227234pfp.13; Mon, 12 Oct 2020 16:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zIq5Sy+gMMi2e/JhMz5LQuAYUsiRKE1wPRc6NTkJBrI=; b=b+ScMeMEFWcKJjtjIQksxJjmWKeo6FU9JLdg5gI3/1t6vTDoBituk8wgEJkm6eswOk qmlT+hkqIviwsB2F5Ji2W8nB1jlrGeGRMAjBheoArU41wHoHhawNQIxXIcBNtKzZeM2O cYjHlFrlv6LZHz7mHJ/KbsP/C6PNccWDIpcG7kMdhzhQrg8VSo263em1DZ7Eugsl1XrF IqiIB0kTPyDmJJU0w7TSMpASVHZ1V5HAbUMiVG4xFBrVCznC927ICzVDuc9VXjLUKENQ PUIQnDd6pC9mDHXcWvWDT87OWOsjz7f1kICWQycUspy1M3ZD+g14VdLcK1AsN6QvIg5q 43EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zIq5Sy+gMMi2e/JhMz5LQuAYUsiRKE1wPRc6NTkJBrI=; b=F2YKjZg3kugCUvaKiYbfQV2wZzXYNBaZ5ZW1HoZeBqtDP8TRe2eKjqtmiJU4OxUOUK gcSat7CkYDI56U7dRyYAEK+hrNnZqA5On5lthGFgsAWa3WSwF8TggeTGSpzsSITQeLhY 0svsplEMDDWHmrfdUA9dUAv16TqsFMMbaBdonW5Ueh8Mv+K9M16DDjc48Pur+A7ILYaB RGjZuBmS5dEyiksdo+FpO5ngC5Lp2WUifd2T2yyiUlO4TtYGnRgswXnhri48P2MKdQbA p6goIV7UVrC0J1tF2/rCrLvSsfqbk2SpxaWunchjxASOM4qIIO9yKPav/MTOf5lFn6l/ 5oAA== X-Gm-Message-State: AOAM530Ex+PCEjHryGXeNGMHE7Gvqia/YuwdZdTx6Uxsui6cCGIb15L6 1nLv1rygAAY9FTCCkKcOwx+P2VI3MCtPeQ== X-Google-Smtp-Source: ABdhPJz7pOVrqmrv1rOjN4BcLriXvvbdZummVhlZPm6O8xpDvJsZWQ91id7XiUh7F06U+AwcoRziIQ== X-Received: by 2002:a17:90a:cb92:: with SMTP id a18mr22251931pju.136.1602545883295; Mon, 12 Oct 2020 16:38:03 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm21975783pfr.156.2020.10.12.16.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 16:38:02 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 1/4] scripts: Convert qemu-version.sh to qemu-version.py Date: Tue, 13 Oct 2020 07:37:37 +0800 Message-Id: <20201012233740.190-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201012233740.190-1-luoyonggang@gmail.com> References: <20201012233740.190-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x436.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , QEMU Trivial , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Yonggang Luo , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The sh script are harder to maintain for compatible different xsh environment so convert it to python script Also incorporate the fixes in https://patchew.org/QEMU/20200929143654.518157-1-marcandre.lureau@redhat.com/ According to https://github.com/msys2/MSYS2-packages/issues/2176 We need use CYGWIN=noglob and MSYS=noglob in the environment variable for disable wildcard expanding in msys or cygwin git, and setting the shell=False Signed-off-by: Yonggang Luo Message-Id: <20201006112139.700-1-luoyonggang@gmail.com> Signed-off-by: Paolo Bonzini --- meson.build | 2 +- scripts/qemu-version.py | 37 +++++++++++++++++++++++++++++++++++++ scripts/qemu-version.sh | 25 ------------------------- 3 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 scripts/qemu-version.py delete mode 100755 scripts/qemu-version.sh diff --git a/meson.build b/meson.build index 17c89c87c6..c23167c61b 100644 --- a/meson.build +++ b/meson.build @@ -1132,7 +1132,7 @@ tracetool = [ '--backend=' + config_host['TRACE_BACKENDS'] ] -qemu_version_cmd = [find_program('scripts/qemu-version.sh'), +qemu_version_cmd = [find_program('scripts/qemu-version.py'), meson.current_source_dir(), config_host['PKGVERSION'], meson.project_version()] qemu_version = custom_target('qemu-version.h', diff --git a/scripts/qemu-version.py b/scripts/qemu-version.py new file mode 100644 index 0000000000..cf97b2bbb5 --- /dev/null +++ b/scripts/qemu-version.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# +# Script for retrieve qemu git version information +# +# Authors: +# Yonggang Luo +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or, at your option, any later version. See the COPYING file in +# the top-level directory. + +import sys +import subprocess +import os +import os.path + +def main(_program, dir, pkgversion, version, *unused): + os.chdir(dir) + if not pkgversion and os.path.exists('.git'): + pc = subprocess.run( + ['git', 'describe', '--match', 'v*', '--dirty', '--always'], + env=dict(os.environ, CYGWIN="noglob", MSYS='noglob'), + stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, + encoding='utf8', shell=False) + if pc.returncode == 0: + pkgversion = pc.stdout.strip() + + fullversion = version + if pkgversion: + fullversion = "{} ({})".format(version, pkgversion) + + print('#define QEMU_PKGVERSION "%s"' % pkgversion) + print('#define QEMU_FULL_VERSION "%s"' % fullversion) + +if __name__ == "__main__": + main(*sys.argv) diff --git a/scripts/qemu-version.sh b/scripts/qemu-version.sh deleted file mode 100755 index 03128c56a2..0000000000 --- a/scripts/qemu-version.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -set -eu - -dir="$1" -pkgversion="$2" -version="$3" - -if [ -z "$pkgversion" ]; then - cd "$dir" - if [ -e .git ]; then - pkgversion=$(git describe --match 'v*' --dirty | echo "") - fi -fi - -if [ -n "$pkgversion" ]; then - fullversion="$version ($pkgversion)" -else - fullversion="$version" -fi - -cat < X-Patchwork-Id: 11834481 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89A2F1580 for ; Mon, 12 Oct 2020 23:40:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 36FDB2076D for ; Mon, 12 Oct 2020 23:40:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OL0L5eQG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36FDB2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:54526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kS7QB-0004Z7-8N for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Oct 2020 19:40:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kS7OM-0002yH-Ji; Mon, 12 Oct 2020 19:38:10 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:38979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kS7OK-00073I-M6; Mon, 12 Oct 2020 19:38:10 -0400 Received: by mail-pf1-x442.google.com with SMTP id n14so15239376pff.6; Mon, 12 Oct 2020 16:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RCiwtCbp232Z/M6MRS2ljqmJJBXyJVJiELXNvh6qszk=; b=OL0L5eQGJ6rvuey/xogh3eQQNsHyY3lLk+4/KvAcAz4SfDTiYsJqB2vczyftIEp5l5 lpkGlLq4XBbv1JIzSM9fil6bVCOTPNnOWmkyVNjQUZOheiSZHnuUMN6XqWXp8Ul8gQdJ e70ddGTRB9mkpYXdXaQ/IisMOF7lrG8Eng/8UzkLua6m6aN6IQje6cOlhhayAYEfj6Xd o2hUmOJlAr6H1sPQnH0gt0fDmRFItEc1tFR9lE0XH4ADI7tpbd4cZi8jbOFyHyZNHYjo Idoj+yXlbVt9Vvt74ROYsUcLjPpc9HDmoLDiCYiT/0KnPb2/j7CEnCEaT5sGVFQTySGi oAHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RCiwtCbp232Z/M6MRS2ljqmJJBXyJVJiELXNvh6qszk=; b=lAi9s27T0Yw5x0iJMVeMnrvok0ucgDJH7dPE/uvPLzp/BeKFOh0s/PGeC2VK8p8HUP ANOdj++gza7n5iRvJrZar2BkrEjcF7e7qtFF7dsrdeQPqYYXs6tJ7qyQ7YBTjF8r4Mlf x/wPkBZlPDFxDIgTQ9xO02+Jfdv0x93YL9Grod5C6tW+dv9JqydshVTm6fg2dUM/KQvH nz95wT716N8FXohUaYyXRpmG4o7COCq7L4qvLcL+Y+ymxZhBpVuI1IvA10OLbt/sAgJt LbAHPWQVqGwuEItq7xzMxDHDQOqsqg+tfNIJGyJSSKY8mPiY/HKhrzsUV3068lZFqcFf Ni8w== X-Gm-Message-State: AOAM532iCQkVSSSyNmGcvj3/89wC5MRrlShRL3wQ68tsFv7sI4ifauiZ jibfv+XjIejrdhgfVZq6fiyQHza4oS1LuA== X-Google-Smtp-Source: ABdhPJxJVu0P6bXjsMjNtBNsoLyTrGKWC9QAp8bvNI8d7odPoKdWTRjsRoUrPcLj+9FOvS3+57kOfw== X-Received: by 2002:aa7:955b:0:b029:152:883a:9a93 with SMTP id w27-20020aa7955b0000b0290152883a9a93mr25157722pfq.25.1602545886598; Mon, 12 Oct 2020 16:38:06 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm21975783pfr.156.2020.10.12.16.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 16:38:05 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 2/4] gitignore: ignore a bit more Date: Tue, 13 Oct 2020 07:37:38 +0800 Message-Id: <20201012233740.190-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201012233740.190-1-luoyonggang@gmail.com> References: <20201012233740.190-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , QEMU Trivial , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Yonggang Luo , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Enable the creating multiple build directory at the source root. Ignore /meson/ and /roms/ for better search experience. Signed-off-by: Yonggang Luo --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b32bca1315..f78ee9f297 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /GNUmakefile -/build/ +/build*/ *.pyc .sdk .stgit-* @@ -10,3 +10,5 @@ TAGS *~ *.ast_raw *.depend_raw +/meson/ +/roms/**/* From patchwork Mon Oct 12 23:37:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11834485 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CDCE1592 for ; Mon, 12 Oct 2020 23:42:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9A4F2076D for ; Mon, 12 Oct 2020 23:42:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jIt/qDWh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9A4F2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kS7S4-00070q-2b for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Oct 2020 19:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kS7OQ-00035p-0R; Mon, 12 Oct 2020 19:38:14 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:36955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kS7OO-00073Y-0H; Mon, 12 Oct 2020 19:38:13 -0400 Received: by mail-pf1-x42f.google.com with SMTP id 144so15243295pfb.4; Mon, 12 Oct 2020 16:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L6PNQoyNWpTKNJhBfsEjGJ+daBNStQN7zXzdYI1k/ZU=; b=jIt/qDWhnuxApOXOtkUiNpAdl7lLSiUTyKSGPauriZmyYjE/GpKJIqg5audgdjfcWi 2kqym5Uj2n3B0fYeNArKi9fTFc9gXOqtadK6Mca3Z9MO0OUwf9NDobjThlvAFIpGVScw NN5dkSyULw0Mq1A8W2vBXPSy+SCOcJdM7yHCP1mg0jqtLTonNug+/wMmRWGL2Hh8nJXz gtupvC3PeplF2IOZUOc3UQW2enuXHjFcsQreCLgSIQeazxtiOwAn2GqHAT1JkTHYbty9 ftDsVLu7XpUnRR/ZaHGmhlNPsm4KnkA7Kj1BKiOBWRKroOz5f6B+8ljCakZ4rd+zQs4H hYdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L6PNQoyNWpTKNJhBfsEjGJ+daBNStQN7zXzdYI1k/ZU=; b=B+Oaw83uFXp3ojwGvF8JuqA6jIt88DijqvBIZTCGB98F2O6kZygxNCTioUhg9Y6Mqq Y3EY31Sc7gWhwZCouTlmExdzkUZERc/OYQSZLvkRHF4n7UUlz/1cX0U979Ev0ZpUxEqU DwBjTTNnfPP/T4yb6TdoJS97vbqKSi/65bgQ5x2+eecP8t1nUpTo1dM7JscsR3EKnVZ0 3jqttVpa8TTqsZmQc/3UdsrIivesk8qWIPyE/hts7ACq4EqBYnSu8CDjxixD5NVIEiwq Z9LDWb/wyhsusccy+YqHfIMJkSSqNb4vU10Hgpj+11TyjZYdxmuM9gawAMPCqTNzv0tX 3lxA== X-Gm-Message-State: AOAM531BwBstTp++QcIWrCQwKbnhh6MQD5F8t3ASk8UjWi8kbF0CXNfc vkoGh0Chq/vYuFALnkbRn8X1awmU+Ut/6g== X-Google-Smtp-Source: ABdhPJyZYsLCZVcXZWCFW6/YxJathcD31bENolQpBfkxQujNBmDkgmNZU0aQMYf09Ho4DE9CIGUHBA== X-Received: by 2002:a62:e104:0:b029:152:4f37:99da with SMTP id q4-20020a62e1040000b02901524f3799damr25438622pfh.17.1602545889832; Mon, 12 Oct 2020 16:38:09 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm21975783pfr.156.2020.10.12.16.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 16:38:09 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 3/4] docs: Fixes build docs on msys2/mingw Date: Tue, 13 Oct 2020 07:37:39 +0800 Message-Id: <20201012233740.190-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201012233740.190-1-luoyonggang@gmail.com> References: <20201012233740.190-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , QEMU Trivial , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Yonggang Luo , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Yonggang Luo --- docs/conf.py | 2 +- docs/sphinx/kerneldoc.py | 2 +- scripts/rst-sanitize.py | 21 +++++++++++++++++++++ tests/qapi-schema/meson.build | 5 +++-- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 scripts/rst-sanitize.py diff --git a/docs/conf.py b/docs/conf.py index 00e1b750e2..e584f68393 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -241,7 +241,7 @@ texinfo_documents = [ # We use paths starting from qemu_docdir here so that you can run # sphinx-build from anywhere and the kerneldoc extension can still # find everything. -kerneldoc_bin = os.path.join(qemu_docdir, '../scripts/kernel-doc') +kerneldoc_bin = ['perl', os.path.join(qemu_docdir, '../scripts/kernel-doc')] kerneldoc_srctree = os.path.join(qemu_docdir, '..') hxtool_srctree = os.path.join(qemu_docdir, '..') qapidoc_srctree = os.path.join(qemu_docdir, '..') diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 3e87940206..3ac277d162 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -67,7 +67,7 @@ class KernelDocDirective(Directive): def run(self): env = self.state.document.settings.env - cmd = [env.config.kerneldoc_bin, '-rst', '-enable-lineno'] + cmd = env.config.kerneldoc_bin + ['-rst', '-enable-lineno'] filename = env.config.kerneldoc_srctree + '/' + self.arguments[0] export_file_patterns = [] diff --git a/scripts/rst-sanitize.py b/scripts/rst-sanitize.py new file mode 100644 index 0000000000..26060f1208 --- /dev/null +++ b/scripts/rst-sanitize.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +# +# Script for remove cr line ending in file +# +# Authors: +# Yonggang Luo +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or, at your option, any later version. See the COPYING file in +# the top-level directory. + +import sys + +def main(_program, file, *unused): + with open(file, 'rb') as content_file: + content = content_file.read() + sys.stdout.buffer.write(content.replace(b'\r', b'')) + +if __name__ == "__main__": + main(*sys.argv) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index 1f222a7a13..20a7641af8 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -251,18 +251,19 @@ qapi_doc_out = custom_target('QAPI rST doc', # using an explicit '\' character in the command arguments to # a custom_target(), as Meson will unhelpfully replace it with a '/' # (https://github.com/mesonbuild/meson/issues/1564) +rst_sanitize_cmd = [find_program('../../scripts/rst-sanitize.py'), '@INPUT@'] qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized', output: ['doc-good.txt.nocr'], input: qapi_doc_out[0], build_by_default: build_docs, - command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'], + command: rst_sanitize_cmd, capture: true) qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized', output: ['doc-good.ref.nocr'], input: files('doc-good.txt'), build_by_default: build_docs, - command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'], + command: rst_sanitize_cmd, capture: true) if build_docs From patchwork Mon Oct 12 23:37:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11834487 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2CF091580 for ; Mon, 12 Oct 2020 23:42:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4D422076D for ; Mon, 12 Oct 2020 23:42:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sE7/TY/n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4D422076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kS7S8-000764-3u for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Oct 2020 19:42:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kS7OT-0003E1-GN; Mon, 12 Oct 2020 19:38:17 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:35734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kS7OR-00073j-GR; Mon, 12 Oct 2020 19:38:17 -0400 Received: by mail-pf1-x441.google.com with SMTP id k8so15257998pfk.2; Mon, 12 Oct 2020 16:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S+jw+88sOrD1wBdO71U4c/3Vn26m+fCHMRsX5Ywl9XU=; b=sE7/TY/n5hiWsrAJNYROeuQhOA9+ZqydruPmZMXVWoPdUP7BR/CIuqgkjGc0PBbt4e xI2uuGKWn5++0HywN0l+wp7K5IWv8k2vLpBfoopY/gUDgP+Wf6K3gD7jWBcAVS05YsYw O1Zpvurjn6QILiLIFsT2e0tCHU5uyojowwZRsAKGopmn2jEJRbXWlY+5LoL47lBQRRGP kwVrNK/CUPUnD35N2Fu6Ylai94PcTkJRBthKfwEDJqJ6cl3ulQxAXLqYm45SHTRo1p0I jDCewjIJ4mpZGBY8sodqdTncA+z3o6mBsTRUhYxpboybTk2ws6tVSNO/oPwcsgwEWnnH muBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S+jw+88sOrD1wBdO71U4c/3Vn26m+fCHMRsX5Ywl9XU=; b=hxaALV4IWcKSbgpZUyhtuIDKWD7tIvcEhwn9khvKIO9LTPZblUho6f+4RP0yyp/XCb bbMkxuDWqKNLJ4QYegSzPvYw3cLXiCsOaNiobolKQsx7ZaW+eOUMRgdhhATpa2K6PhCT Zs61e5uTigt0dGg3rmfaVd4j7cqok5BT2C5PqtxHf5ol1WSHOrEmwbNL+yJeQRuA/xXd xolMVORkswVb8KQCBlwCpES9ffa8BsUJkaVmeltTOz1UYTexkhXkw4BmbgZis4E+aIyK 2CHOE0rdPwi/z9CWFS9JfLTCc2NQ7DnYk7EgMaNJGFC53rEdqMvexIxCqb7F9/CcBxy5 2zcA== X-Gm-Message-State: AOAM5304C9sp5xQHIEqHBZahyrPKWEA86oJm7nSh4sK6DR1/bUbHW+eg 7blldSPLnYvNrGrL3DZMSePp4Dm4MMWTYQ== X-Google-Smtp-Source: ABdhPJz0d10AETOleY0sdY6elfz5CDdu3KEENDEnVNRWT6j8NL2fCcFD62mB14Or0jo9bg1E4diBpQ== X-Received: by 2002:a62:644c:0:b029:155:fdf4:52ed with SMTP id y73-20020a62644c0000b0290155fdf452edmr8099527pfb.9.1602545893196; Mon, 12 Oct 2020 16:38:13 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm21975783pfr.156.2020.10.12.16.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 16:38:12 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 4/4] cirrus: Enable doc build on msys2/mingw Date: Tue, 13 Oct 2020 07:37:40 +0800 Message-Id: <20201012233740.190-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201012233740.190-1-luoyonggang@gmail.com> References: <20201012233740.190-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , QEMU Trivial , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Yonggang Luo , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Currently rST depends on old version sphinx-2.x. Install it by downloading it. Remove the need of university mirror, the main repo are recovered. Signed-off-by: Yonggang Luo --- .cirrus.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 99d118239c..f42ccb956a 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -76,7 +76,6 @@ windows_msys2_task: ((Get-Content -path C:\tools\msys64\etc\\post-install\\07-pacman-key.post -Raw) -replace '--refresh-keys', '--version') | Set-Content -Path C:\tools\msys64\etc\\post-install\\07-pacman-key.post C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf" C:\tools\msys64\usr\bin\bash.exe -lc "export" - C:\tools\msys64\usr\bin\bash.exe -lc "grep -rl 'repo.msys2.org/' /etc/pacman.d/mirrorlist.* | xargs sed -i 's/repo.msys2.org\//mirrors.tuna.tsinghua.edu.cn\/msys2\//g'" C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Sy echo Y | C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Suu --overwrite=* taskkill /F /FI "MODULES eq msys-2.0.dll" @@ -111,6 +110,11 @@ windows_msys2_task: mingw-w64-x86_64-curl \ mingw-w64-x86_64-gnutls \ " + bitsadmin /transfer msys_download /dynamic /download /priority FOREGROUND ` + https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-python-sphinx-2.3.1-1-any.pkg.tar.xz ` + C:\tools\mingw-w64-x86_64-python-sphinx-2.3.1-1-any.pkg.tar.xz + C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -U /c/tools/mingw-w64-x86_64-python-sphinx-2.3.1-1-any.pkg.tar.xz" + del C:\tools\mingw-w64-x86_64-python-sphinx-2.3.1-1-any.pkg.tar.xz C:\tools\msys64\usr\bin\bash.exe -lc "rm -rf /var/cache/pacman/pkg/*" cd C:\tools\msys64 echo "Start archive"