Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1227277imm; Wed, 17 Oct 2018 15:56:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV61WvLpjO4IqL+di51fTuFfT91/T9W9ciAL/cst9ehIn0xaLb53hAbKKm1opYKbqUGMXq0c4 X-Received: by 2002:a62:449b:: with SMTP id m27-v6mr28168391pfi.82.1539816989225; Wed, 17 Oct 2018 15:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539816989; cv=none; d=google.com; s=arc-20160816; b=PepKbG2msdlWUfMGopZP8ougGT9KdMTpYqgCCMGjYalZSBqFQN0D0agSoq2UHAZy51 pstValMSAKSAcidLpQMx7hXZmOhTqspNVeR0yVtsUsV6LxZHLNhc8WPs/erC4cF9Uod9 YI/RLk7vJNthgl03xj10yDDOVXXtuB+evLWTIMTQ6Iva5dXlhRfHk2MAq7ZVD+J/mtgj B4AP1/uFuI1d6Qu5rtg5s7Wi99jWWrddc1V848ZlRNqrDOlTSxyUxTUG/7mSIywMNlaG ZCx7KEIJ499NnmuKRJi9D5XwiinTnMxSx129RltHK3nsKnBiWtI+IcYjol7h3l+yiqkn 5ZYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=bNESkNxCOWW8Ejq6D8r1fBvFZjNyszr3sZAte5jf1Dw=; b=fUEeK12zU5aJizusbp2xKTxwDHD+Zbhoi+MagilgVbDDxJnH2oL+DJE4B9y0odnSmf sKxgA+4ukD7RDs5Ra3Y0vQhYAfP9XCEdRUR9UOXUVIPYfNXyRrNY2O+U+1ubTeXBfmES Eiik0sKjcTa5rxOhnEdLp9Xs9hkgKiwbf23jC5SDgHbc5FoEGr5zDg73mcryA11digTV GybT04Tgj5P76+qZUK5fOMi4WOAuhKSf/dHWYRksHwCxALrUsC0L8ENgNXk5RF3k3c1P u25rNYMa5lHgPuzNQ7IHHOirOlZp6304Q2UjwjDtko2Mc/oFsYcXQd+mEUjZT3qsV3Lp 6pfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lLHQ6aDs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97-v6si18952834pla.34.2018.10.17.15.56.14; Wed, 17 Oct 2018 15:56:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lLHQ6aDs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727776AbeJRGxe (ORCPT + 99 others); Thu, 18 Oct 2018 02:53:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:42110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbeJRGxe (ORCPT ); Thu, 18 Oct 2018 02:53:34 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 076852087A; Wed, 17 Oct 2018 22:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539816940; bh=iW8zQLc4wNSCOL2ahA6Qp7dYA7K6jaI3V5BpugIxpa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lLHQ6aDs7t3tLgBgd2kyZaXaLbzfoEXgA7WMsTosTdEgOe/OdjINgyy+CrdorW9ad auOq9994RX5CkgzmCY0CihancgEqFJsVBaex52o2DnQ2gmZjAS9+4En6Q16B/Z+hIF h/dFylQtAsxinau5gjGQP5JwJqkfzyHbra4b0tM4= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Jarod Wilson , Alexander Shishkin , Namhyung Kim , Peter Zijlstra , Stephane Eranian , William Cohen , Arnaldo Carvalho de Melo Subject: [PATCH 06/11] perf tools: Fix use of alternatives to find JDIR Date: Wed, 17 Oct 2018 19:54:56 -0300 Message-Id: <20181017225501.32150-7-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181017225501.32150-1-acme@kernel.org> References: <20181017225501.32150-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jarod Wilson When a build is run from something like a cron job, the user's $PATH is rather minimal, of note, not including /usr/sbin in my own case. Because of that, an automated rpm package build ultimately fails to find libperf-jvmti.so, because somewhere within the build, this happens... /bin/sh: alternatives: command not found /bin/sh: alternatives: command not found Makefile.config:849: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel ...and while the build continues, libperf-jvmti.so isn't built, and things fall down when rpm tries to find all the %files specified. Exact same system builds everything just fine when the job is launched from a login shell instead of a cron job, since alternatives is in $PATH, so openjdk is actually found. The test required to get into this section of code actually specifies the full path, as does a block just above it, so let's do that here too. Signed-off-by: Jarod Wilson Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: William Cohen Fixes: d4dfdf00d43e ("perf jvmti: Plug compilation into perf build") Link: http://lkml.kernel.org/r/20180906221812.11167-1-jarod@redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index f6d1a03c7523..e30d20fb482d 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -833,7 +833,7 @@ ifndef NO_JVMTI JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}') else ifneq (,$(wildcard /usr/sbin/alternatives)) - JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') + JDIR=$(shell /usr/sbin/alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') endif endif ifndef JDIR -- 2.14.4