From patchwork Thu Feb 4 15:44:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 8224621 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9808ABEEE5 for ; Thu, 4 Feb 2016 15:44:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 355A120384 for ; Thu, 4 Feb 2016 15:44:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39F33201B9 for ; Thu, 4 Feb 2016 15:44:45 +0000 (UTC) Received: from localhost ([::1]:42481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRM5M-0007pQ-Km for patchwork-qemu-devel@patchwork.kernel.org; Thu, 04 Feb 2016 10:44:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRM5B-0007kf-Cz for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:44:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRM57-0005EM-W5 for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:44:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRM57-0005EB-OA for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:44:29 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 537A43BF528; Thu, 4 Feb 2016 15:44:29 +0000 (UTC) Received: from redhat.com (vpn1-6-8.ams2.redhat.com [10.36.6.8]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u14FiPLf030469 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 4 Feb 2016 10:44:27 -0500 Date: Thu, 4 Feb 2016 15:44:25 +0000 From: "Daniel P. Berrange" To: Peter Maydell Message-ID: <20160204154425.GY30301@redhat.com> References: <145459675563.11777.5257429454748921678.stgit@localhost> <56B36EF8.6080309@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: =?utf-8?B?TGx1w61z?= Vilanova , QEMU Developers , Michael Roth , Markus Armbruster Subject: Re: [Qemu-devel] [PATCH ] [trivial] qapi: Build-depend on all json files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Feb 04, 2016 at 03:36:56PM +0000, Peter Maydell wrote: > On 4 February 2016 at 15:32, Eric Blake wrote: > > On 02/04/2016 07:55 AM, Peter Maydell wrote: > >> On 4 February 2016 at 14:39, Lluís Vilanova wrote: > >>> Dynamically detects the files used to generate QAPI code, thus ensuring > >>> it's never out of sync with the sources. > >>> > >>> Signed-off-by: Lluís Vilanova > >>> --- > >>> Makefile | 6 ++---- > >>> 1 file changed, 2 insertions(+), 4 deletions(-) > >>> > >>> diff --git a/Makefile b/Makefile > >>> index d0de2d4..627f772 100644 > >>> --- a/Makefile > >>> +++ b/Makefile > >>> @@ -269,10 +269,8 @@ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) > >>> $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ > >>> " GEN $@") > >>> > >>> -qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \ > >>> - $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \ > >>> - $(SRC_PATH)/qapi/event.json $(SRC_PATH)/qapi/introspect.json \ > >>> - $(SRC_PATH)/qapi/crypto.json > >>> +qapi-modules = $(SRC_PATH)/qapi-schema.json > >>> +qapi-modules += $(shell find $(SRC_PATH)/qapi -name "*.json") > >> > >> All the .json files are in the same directory, so I don't think we should > >> need to use find here. Does > >> > >> qapi-modules += $(wildcard $(SRC_PATH)/qapi/*.json)) > >> > >> work ? > > > > Does this wildcard affect what goes into a tarball? I'm worried that we > > may run the risk of a stale .json file on one developer's machine > > causing an unreproducible build on other machines where the file is not > > found; explicit lists tend to be safer than wildcards. > > > > I won't reject the patch if others like it, but I won't approve it myself. > > You need to ask Mike Roth about our tarball generation process, not me. > > I do agree that this patch needs to make the case for why .json source > files are special and should be wildcarded, when for instance all our > C source files are explicitly listed in makefiles. Yes, normal practice is that the files are listed in a Makefile that lives in the same dir as the file. The qapi json files are not following that since they live in a dir above. I'd be inclined to say any patch should take us in line with source files, and thus look more like this: NB, this is completely untested - i just hacked the makefile for purpose of illustration. Regards, Daniel diff --git a/Makefile b/Makefile index b7b0f24..5481b57 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,8 @@ dummy := $(call unnest-vars,, \ qom-obj-y \ io-obj-y \ common-obj-y \ - common-obj-m) + common-obj-m \ + qapi-modules) ifneq ($(wildcard config-host.mak),) include $(SRC_PATH)/tests/Makefile @@ -269,10 +270,7 @@ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ " GEN $@") -qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \ - $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \ - $(SRC_PATH)/qapi/event.json $(SRC_PATH)/qapi/introspect.json \ - $(SRC_PATH)/qapi/crypto.json +qapi-modules += $(SRC_PATH)/qapi-schema.json qapi-types.c qapi-types.h :\ $(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs index 2278970..a644a69 100644 --- a/qapi/Makefile.objs +++ b/qapi/Makefile.objs @@ -4,3 +4,10 @@ util-obj-y += string-input-visitor.o string-output-visitor.o util-obj-y += opts-visitor.o util-obj-y += qmp-event.o util-obj-y += qapi-util.o + +qapi-modules += common.json +qapi-modules += block.json +qapi-modules += block-core.json +qapi-modules += event.json +qapi-modules += introspect.json +qapi-modules += crypto.json