Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 732E2200B81 for ; Tue, 13 Sep 2016 15:13:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 71C33160AD2; Tue, 13 Sep 2016 13:13:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 92BB6160AC6 for ; Tue, 13 Sep 2016 15:13:55 +0200 (CEST) Received: (qmail 1351 invoked by uid 500); 13 Sep 2016 13:13:54 -0000 Mailing-List: contact dev-help@yetus.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@yetus.apache.org Delivered-To: mailing list dev@yetus.apache.org Received: (qmail 1335 invoked by uid 99); 13 Sep 2016 13:13:54 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2016 13:13:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EA7DDC1506 for ; Tue, 13 Sep 2016 13:13:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.528 X-Spam-Level: X-Spam-Status: No, score=-1.528 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-1.426, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=effectivemachines.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id X-WfWZsUXoD0 for ; Tue, 13 Sep 2016 13:13:49 +0000 (UTC) Received: from effectivemachines.com (effectivemachines.com [104.236.136.112]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 5A8695FBFB for ; Tue, 13 Sep 2016 13:13:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by effectivemachines.com (Postfix) with ESMTP id B0FF2163C38 for ; Tue, 13 Sep 2016 06:13:40 -0700 (PDT) Received: from effectivemachines.com ([127.0.0.1]) by localhost (effectivemachines.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id W6bZczWdpyZ9 for ; Tue, 13 Sep 2016 06:13:40 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by effectivemachines.com (Postfix) with ESMTP id 37F3616516F for ; Tue, 13 Sep 2016 06:13:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.9.2 effectivemachines.com 37F3616516F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=effectivemachines.com; s=D35149BA-5A53-11E6-AF53-2EA667C55D35; t=1473772420; bh=IlXuR4Dbab7L5iuly0N+39GCMvqqdjH4VjUaMetHdqU=; h=Content-Type:Mime-Version:Subject:From:Date: Content-Transfer-Encoding:Message-Id:To; b=kDZJwNyPGu+lxRL40rJt+Ac3+LMDsRKGsP/4tQoK0gp3HDXIJy4rQj0sK0IYZTO5R qLz3ShX/tMimyErSKm/NN5x1hUAPtjGKqb53ZfAwmro+eWpOne9XHELOh4JOYete2k gH3Vg5LBA+qa+qHTZNp6+QPiHV1qSSEqFJev+qzQ= X-Virus-Scanned: amavisd-new at effectivemachines.com Received: from effectivemachines.com ([127.0.0.1]) by localhost (effectivemachines.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VksaPgSzh2IK for ; Tue, 13 Sep 2016 06:13:40 -0700 (PDT) Received: from dhcp-211.private.iobm.com (108-193-1-249.lightspeed.sntcca.sbcglobal.net [108.193.1.249]) by effectivemachines.com (Postfix) with ESMTPSA id E53A3163C38 for ; Tue, 13 Sep 2016 06:13:39 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Avro Pre-commit. From: Allen Wittenauer In-Reply-To: Date: Tue, 13 Sep 2016 06:13:40 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <60E9D2CC-B77B-4B56-AF6F-EE4F11CF43E7@effectivemachines.com> References: To: dev@yetus.apache.org X-Mailer: Apple Mail (2.3124) archived-at: Tue, 13 Sep 2016 13:13:56 -0000 I've been thinking about this issue. With a bit of work, I think the = approach should probably be to: a) make a custom build tool that knows which dirs use which = other tools b) add a new file in each dir that can tell precommit where to = break for modules For example, let's say we have a dir structure like this: build.sh c/ Makefile java/ pom.xml perl/ Makefile.PL Let's add a file called multibuild.sh that precommit can use: build.sh multibuild.sh c/ Makefile multibuild.sh java/ pom.xml multibuild.sh perl/ Makefile.PL multibuild.sh In our "multibuild" build tool plugin, we'd define function multibuild_buildfile { echo "multibuild.sh" } Now when precommit gets a patch, it will know that a change in = c/ is a different module than a change in java/ or perl/ because of the = presence of the multibuild.sh file. This prevents the "build the world" = problem for a largely diverse project like avro.=20 The place where this gets hard is our theoretical = multibuild_executor function because precommit doesn't pass as a param = the module that's currently being processed. (we should probably fix = that) But we can still make it work and reality, it might have led us = down a false path. If we make this function look like this: function multibuild_executor { echo "multibuild.sh" } and make sure that BUILDTOOLCWD=3Dmodule (the default), then precommit = will run our file that we placed to actually do the work. This file can = then take whatever parameters we're getting passed and convert it as = appropriate to the build tool for that directory. Since this is a custom = build tool, you can dictate what parameters to pass to which modules via = _modules_workers. For example, an easy route might be: function multibuild_modules_workers { modules_workers $2 } then multibuild.sh for each language becomes a series of case = statements. For C, it might look like: testname=3D$1 shift case ${testname} in compile) make -Dcustomflag=3D1 ;; doc) make man unit) make -Danotherflag=3D1 test ;; *) ;; esac It's pretty hacky, but theoretically it would work until we get = a chance to make precommit smarter about multiple build tools in a = single project. (which would be a pretty hard undertaking, but something = we should probably do) > On Sep 10, 2016, at 6:32 PM, suraj acharya = wrote: >=20 > Yes. > The ./build.sh test > command = helps run > all the tests from the top level. > However, I am not sure if we need to run all the tests when a change = is > made? > I was thinking of running language specific tests for changes in the > specific directory. > For example for changes in python will trigger ant test > . > If this is not a good idea let me know. Ill start another tread on = dev@avro > to see what the community thinks about it >=20 > Thanks >=20 > -Suraj Acharya >=20 > On Sat, Sep 10, 2016 at 5:45 PM, Sean Busbey = wrote: >=20 >> my understanding of Avro's build system is that there are = per-language >> build tools and everything gets unified via shell scripts. is there >> just the top level build.sh file, or do the individual components = have >> their own? >>=20 >> On Sat, Sep 10, 2016 at 11:48 AM, suraj acharya >> wrote: >>> Hi, >>> I have been working on AVRO-1887 >>> to add pre-commit >> test to >>> avro. >>> I have been successful in adding the personality for java file using >> maven. >>> I having some questions about the other plugins. >>> Example :ant >>>=20 >>> The structure of avro is that there is a top level pom. >>> And then there is different langs in subdirectory below it. >>> So there is avro/lang/py >>> which has python >> code >>> in it. The build tool for that is ant. >>> My understanding is running add_test ant will run ant test. >>> However, that doesn't actually run any tests. My assumption is that = since >>> there is no build.xml present there it is unable to run any ant = tests. >>>=20 >>> I tried cd to lang/py and run add_test ant from there. However, it = throws >>> an error saying unable to find pom.xml. >>>=20 >>> Can someone give me some pointers on how to continue? >>>=20 >>>=20 >>> Thanks >>> -Suraj Acharya >>=20