From patchwork Tue Aug 5 14:46:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 376713 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2F42C1400B6 for ; Wed, 6 Aug 2014 00:48:11 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AE260B390B; Tue, 5 Aug 2014 16:48:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XkmZqPVAWWqf; Tue, 5 Aug 2014 16:48:06 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BE13DB3918; Tue, 5 Aug 2014 16:47:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9A387B3920 for ; Tue, 5 Aug 2014 16:47:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h87CGEfZyKCV for ; Tue, 5 Aug 2014 16:47:35 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yk0-f202.google.com (mail-yk0-f202.google.com [209.85.160.202]) by theia.denx.de (Postfix) with ESMTPS id 8439CB391C for ; Tue, 5 Aug 2014 16:47:28 +0200 (CEST) Received: by mail-yk0-f202.google.com with SMTP id q9so131288ykb.5 for ; Tue, 05 Aug 2014 07:47:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gjVWgdCeA2QLkIWiMT6OeUc1EmdD/OBqbqtL0nWRc5A=; b=bWLba+plA2Zlmp9YSlf91AKCYMLFtEE8Aaj42Ykz/k0w1EUSV/fRamYtMzKOX7HTmC 8b2MnavcRDtSIMqmGcSvBoq4vnH0RzinrnjaJAkfrABXcmZTUuza3GgemhKKQEhvD120 NIbk5p6luGc+0wOP17o+mc4ZqnPdAf7e/hXufWtQ5jJ+4HzKcYw/ZapSQW3l58lnPmyA uaa8U+lQttAllxIP5adCGWmu4jGCyMJgWqt/zVmCsWX0GRhEO669cTTyddGPVOx87fXf UFV7uerL7ylZ++l4IxU8AxNOFO68/LRPuzybXI9rOjrHuaZ8Ibdtdi+f9P5BUuwV3U26 4rCg== X-Gm-Message-State: ALoCoQlzVME1xNEaZf88hrJi+CLKnYSnvr10LGK/WZ20z6wrbAmBo4LSQv4zFIJakx97k3tm+x4y X-Received: by 10.236.43.20 with SMTP id k20mr1118228yhb.54.1407250047271; Tue, 05 Aug 2014 07:47:27 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id a66si110262yhg.7.2014.08.05.07.47.27 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Aug 2014 07:47:27 -0700 (PDT) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 0AC8831C446; Tue, 5 Aug 2014 07:47:27 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id A2535220B9E; Tue, 5 Aug 2014 08:47:26 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 5 Aug 2014 08:46:57 -0600 Message-Id: <1407250023-9501-8-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1407250023-9501-1-git-send-email-sjg@chromium.org> References: <1407250023-9501-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , Jeroen Hofstee Subject: [U-Boot] [PATCH v4 07/13] buildman: Add verbose option to display errors as they happen X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Normally buildman operates in two passes - one to do the build and another to summarise the errors. Add a verbose option (-v) to display build problems as they happen. With -e also given, this will display errors too. When building the current source tree (rather than a list of commits in a branch), both -v and -e are enabled automatically. Signed-off-by: Simon Glass --- Changes in v4: None Changes in v3: - Add new patch to add a verbose option Changes in v2: None tools/buildman/README | 46 ++++++++++++++++++++++++++++++++++++---------- tools/buildman/builder.py | 16 +++++++++++++--- tools/buildman/buildman.py | 2 ++ tools/buildman/control.py | 4 +++- 4 files changed, 54 insertions(+), 14 deletions(-) diff --git a/tools/buildman/README b/tools/buildman/README index 1c919af..6ba24c0 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -41,9 +41,10 @@ Theory of Operation Buildman is a builder. It is not make, although it runs make. It does not produce any useful output on the terminal while building, except for -progress information. All the output (errors, warnings and binaries if you -are ask for them) is stored in output directories, which you can look at -while the build is progressing, or when it is finished. +progress information (except with -v, see below). All the output (errors, +warnings and binaries if you are ask for them) is stored in output +directories, which you can look at while the build is progressing, or when +it is finished. Buildman produces a concise summary of which boards succeeded and failed. It shows which commit introduced which board failure using a simple @@ -77,12 +78,17 @@ Buildman automatically selects the correct tool chain for each board. You must supply suitable tool chains, but buildman takes care of selecting the right one. -Buildman always builds a branch, and always builds the upstream commit as -well, for comparison. It cannot build individual commits at present, unless -(maybe) you point it at an empty branch. Put all your commits in a branch, -set the branch's upstream to a valid value, and all will be well. Otherwise -buildman will perform random actions. Use -n to check what the random -actions might be. +Buildman generally builds a branch (with the -b flag), and in this case +builds the upstream commit as well, for comparison. It cannot build +individual commits at present, unless (maybe) you point it at an empty +branch. Put all your commits in a branch, set the branch's upstream to a +valid value, and all will be well. Otherwise buildman will perform random +actions. Use -n to check what the random actions might be. + +If you just want to build the current source tree, leave off the -b flag. +This will display results and errors as they happen. You can still look +at them later using -s. Note that buildman will assume that the source +has changed, and will build all specified boards in this case. Buildman is optimised for building many commits at once, for many boards. On multi-core machines, Buildman is fast because it uses most of the @@ -659,6 +665,15 @@ It is expected that any variables added are dealt with in U-Boot's config.mk file and documented in the README. +Quick Sanity Check +================== + +If you have made changes and want to do a quick sanity check of the +currently-checked-out source, run buildman without the -b flag. This will +build the selected boards and display build status and errors as it runs +(i.e. -v amd -e are enabled automatically). + + Other options ============= @@ -685,7 +700,15 @@ First you need to set up your tool chains - see the 'Setting up' section for details. Once you have your required toolchain(s) detected then you are ready to go. -Buildman works on entire branches, so the normal use is: +To build the current source tree, run buildman without a -b flag: + + ./tools/buildman/buildman + +This will build the current source tree for the given boards and display +the results and errors. + +However buildman usually works on entire branches, and for that you must +specify a board flag: ./tools/buildman/buildman -b @@ -698,6 +721,9 @@ buildman just shows a summary, with red indicating that a commit introduced an error and green indicating that a commit fixed an error. Use the -e flag to see the full errors. +If you really want to see build results as they happen, use -v when doing a +build (and -e if you want to see errors as well). + You don't need to stick around on that branch while buildman is running. It checks out its own copy of the source code, so you can change branches, add commits, etc. without affecting the build in progress. diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index f3d0435..af8f3f3 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -321,7 +321,8 @@ class Builder: """Process the result of a build, showing progress information Args: - result: A CommandResult object + result: A CommandResult object, which indicates the result for + a single build """ col = terminal.Color() if result: @@ -339,6 +340,13 @@ class Builder: self.warned += 1 if result.already_done: self.already_done += 1 + if self._verbose: + print '\r', + self.ClearLine(0) + boards_selected = {target : result.brd} + self.ResetResultSummary(boards_selected) + self.ProduceResultSummary(result.commit_upto, self.commits, + boards_selected) else: target = '(starting)' @@ -362,7 +370,7 @@ class Builder: name += target print line + name, - length = 13 + len(name) + length = 14 + len(name) self.ClearLine(length) def _GetOutputDir(self, commit_upto): @@ -1041,7 +1049,7 @@ class Builder: if dirname not in dir_list: shutil.rmtree(dirname) - def BuildBoards(self, commits, board_selected, keep_outputs): + def BuildBoards(self, commits, board_selected, keep_outputs, verbose): """Build all commits for a list of boards Args: @@ -1049,9 +1057,11 @@ class Builder: boards_selected: Dict of selected boards, key is target name, value is Board object keep_outputs: True to save build output files + verbose: Display build results as they are completed """ self.commit_count = len(commits) if commits else 1 self.commits = commits + self._verbose = verbose self.ResetResultSummary(board_selected) builderthread.Mkdir(self.base_dir) diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py index da6025a..f32557f 100755 --- a/tools/buildman/buildman.py +++ b/tools/buildman/buildman.py @@ -113,6 +113,8 @@ parser.add_option('-T', '--threads', type='int', default=None, help='Number of builder threads to use') parser.add_option('-u', '--show_unknown', action='store_true', default=False, help='Show boards with unknown build result') +parser.add_option('-v', '--verbose', action='store_true', + default=False, help='Show build results while the build progresses') parser.usage = """buildman -b [options] diff --git a/tools/buildman/control.py b/tools/buildman/control.py index d8fa74b..cc8593f 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -158,6 +158,8 @@ def DoBuildman(options, args): series) else: series = None + options.verbose = True + options.show_errors = True # By default we have one thread per CPU. But if there are not enough jobs # we can have fewer threads and use a high '-j' value for make. @@ -216,4 +218,4 @@ def DoBuildman(options, args): builder.ShowSummary(commits, board_selected) else: builder.BuildBoards(commits, board_selected, - options.keep_outputs) + options.keep_outputs, options.verbose)