Received: from eggs.gnu.org ([2001:4830:134:3::10]:36939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRMp2-00070I-GN for qemu-devel@nongnu.org; Thu, 04 Feb 2016 11:31:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRMox-0008Gp-Co for qemu-devel@nongnu.org; Thu, 04 Feb 2016 11:31:56 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:34916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRMox-0008Fy-1A for qemu-devel@nongnu.org; Thu, 04 Feb 2016 11:31:51 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <145459675563.11777.5257429454748921678.stgit@localhost> <56B36EF8.6080309@redhat.com> Date: Thu, 04 Feb 2016 17:31:46 +0100 In-Reply-To: (Peter Maydell's message of "Thu, 4 Feb 2016 15:36:56 +0000") Message-ID: <87h9ho5te5.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH ] [trivial] qapi: Build-depend on all json files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Michael Roth , Markus Armbruster Peter Maydell writes: > 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=C3=ADs Vilanova = wrote: >>>> Dynamically detects the files used to generate QAPI code, thus ensuring >>>> it's never out of sync with the sources. >>>>=20 >>>> Signed-off-by: Llu=C3=ADs Vilanova >>>> --- >>>> Makefile | 6 ++---- >>>> 1 file changed, 2 insertions(+), 4 deletions(-) >>>>=20 >>>> 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)/scri= pts/qapi-commands.py $(qapi-py) >>>> $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ >>>> " GEN $@") >>>>=20 >>>> -qapi-modules =3D $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common= .json \ >>>> - $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-cor= e.json \ >>>> - $(SRC_PATH)/qapi/event.json $(SRC_PATH)/qapi/introspec= t.json \ >>>> - $(SRC_PATH)/qapi/crypto.json >>>> +qapi-modules =3D $(SRC_PATH)/qapi-schema.json >>>> +qapi-modules +=3D $(shell find $(SRC_PATH)/qapi -name "*.json") >>>=20 >>> All the .json files are in the same directory, so I don't think we shou= ld >>> need to use find here. Does >>>=20 >>> qapi-modules +=3D $(wildcard $(SRC_PATH)/qapi/*.json)) >>>=20 >>> work ? >>=20 >> 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. >>=20 >> I won't reject the patch if others like it, but I won't approve it mysel= f. > 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. Ok, so I found that qapi/trace.json is missing in qapi-modules. I'm prototy= ping some changes to it, but suddenly found that QAPI was failing to compile due= to outdated code. So I followed the same approach used in tracetool, where find/wildcard will= pull in all relevant files as a dependency, without fear of missing any. An explicit list makes a good case for reproducible builds wrt the distribu= tion tarball, but find/wildcard eliminate these type of compilation errors I've = found when a json file is not listed. Cheers, Lluis