]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Fix use of alternatives to find JDIR
authorJarod Wilson <jarod@redhat.com>
Thu, 6 Sep 2018 22:18:12 +0000 (18:18 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 16 Oct 2018 15:06:47 +0000 (12:06 -0300)
commit74835b6c26fc4a436d156c13ab13c2ad07b88dbc
treefe8260d967ca4e6d33a80c6293feb3ed026d1d31
parent590d0a85c5c054fa79a588f26bfb78d2a9876467
perf tools: Fix use of alternatives to find JDIR

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 <jarod@redhat.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: William Cohen <wcohen@redhat.com>
Fixes: 3217bcc3f123 ("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 <acme@redhat.com>
tools/perf/Makefile.config