From patchwork Tue Sep 1 14:14:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 7105581 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 47E739F1D5 for ; Tue, 1 Sep 2015 14:14:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65E1C204D6 for ; Tue, 1 Sep 2015 14:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75F96205FD for ; Tue, 1 Sep 2015 14:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754045AbbIAOO1 (ORCPT ); Tue, 1 Sep 2015 10:14:27 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:36570 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753976AbbIAOOZ (ORCPT ); Tue, 1 Sep 2015 10:14:25 -0400 Received: by lbcao8 with SMTP id ao8so387967lbc.3 for ; Tue, 01 Sep 2015 07:14:24 -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; bh=93RPXo7cz8Bt1XCRrw7I6ybwAjFYQEJJVyHB9FprUQU=; b=cndAj6S+bji9kMnbdvb1II8SAs1OYqr8a7zxRmknfdiS5/vbIeQd2TZ4+m7k7uWy5v k5O9RQDmv+ecEnsFraBu+OuGIZd2xlMn84/HziuxXR7GRG7DA+dQpHzON3AAR/o4SqTY NNIVJwZWaQOU/XJtx6PR5H1bYe46aU3JIiUpSnbIviS3exhY5ZCRvtb7hWyMhzchEM6P 2msj2xwRdak6gC57+TpQJhzONGTfkvFx3PIHpc7i4BtbQrdeei36tMFS2f1mdmje7ww3 gKw+NYsQTxMmLVR3tmu1Ug+4OQJTLx66xugYJ7wu0vvFvf7bkZexlNiowkPtBO+xPNvo D5qw== X-Gm-Message-State: ALoCoQnq8sYfhLXKE2Yg7stMEwUOeylL+5RRwJtROS8HZj/gx1s4tjg4VqOO+yufbTpC4tpNH+Qx X-Received: by 10.153.7.137 with SMTP id dc9mr13559352lad.16.1441116863565; Tue, 01 Sep 2015 07:14:23 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by smtp.gmail.com with ESMTPSA id w3sm4821235lag.13.2015.09.01.07.14.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Sep 2015 07:14:22 -0700 (PDT) From: riku.voipio@linaro.org To: linux-kbuild@vger.kernel.org, mmarek@suse.cz Cc: Riku Voipio Subject: [PATCH v3] package Makefile: fix perf-tar targets when outdir is set Date: Tue, 1 Sep 2015 17:14:21 +0300 Message-Id: <1441116861-28604-1-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 2.4.6 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Riku Voipio building with $srctree != $objtree, perf-tar-* targets fail to read the MANIFEST file and add the PERF-VERSION-FILE needed by out-of-tree builds. The build errors and an incorrect tar is created: $ make O=build-x86 perf-targz-src-pkg TAR cat: ../tools/perf/MANIFEST: No such file or directory tar: perf-4.1.0-rc8/PERF-VERSION-FILE: Cannot stat: No such file or dir.. tar: Exiting with failure status due to previous errors Kbuild sets objtree to "." and srctree to ".." The command to output MANIFEST becomes: $(cd ..; echo $(cat ../tools/perf/MANIFEST)) Without MANIFEST, the entire kernel source tree is added to the perf source tarball. The *correct* fix is to keep the cd and remove srctree from cat command line since MANIFEST has wildcards that fail to expand working directory isn't srctree. Second, PERF-VERSION-FILE gets not added, because in-tree build path is hardcoded to Makefile: util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null) The PERF-VERSION-GEN needs to be run from tools/perf directory, and the output directory needs to be changed from relative to to absolute. This can be achieved using the $(CURDIR) variable. Also remove the error redirect to /dev/null which hid the error. Signed-off-by: Riku Voipio --- v3: use $(CURDIR) v2: switch from easy fix to correct fix scripts/package/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 562aa15..f127f7e 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -117,12 +117,12 @@ quiet_cmd_perf_tar = TAR cmd_perf_tar = \ git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \ HEAD^{tree} $$(cd $(srctree); \ - echo $$(cat $(srctree)/tools/perf/MANIFEST)) \ + echo $$(cat tools/perf/MANIFEST)) \ -o $(perf-tar).tar; \ mkdir -p $(perf-tar); \ git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \ (cd $(srctree)/tools/perf; \ -util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null); \ +util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \ tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \ rm -r $(perf-tar); \ $(if $(findstring tar-src,$@),, \