Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Aug 2019 04:17:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 239705] java/javavmwrapper: fix pkg-install (broken 7 years ago)
Message-ID:  <bug-239705-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D239705

            Bug ID: 239705
           Summary: java/javavmwrapper: fix pkg-install (broken 7 years
                    ago)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: glewis@FreeBSD.org
          Reporter: jcfyecrayz@liamekaens.com
             Flags: maintainer-feedback?(glewis@FreeBSD.org)
          Assignee: glewis@FreeBSD.org

Created attachment 206349
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D206349&action=
=3Dedit
[patch] fix javavmwrapper/files/pkg-install.in for globbing problem &
insufficient bootstrap-openjdk exclusion pattern

I believe that the following commit broke java/javavmwrapper's pkg-install
7-ish years ago:

r306536 | jkim | 2012-10-27 20:11:29 -0600

The problem is that the wildcards used for the find(1) regex expression get
evaluated by the shell before they are passed to find(1).

In particular, 'find *jdk* *jre* -depth 2 -regex .*/bin/java' when run from
/usr/local expands to 'find openjdk8 openjdk11 -depth 2 -regex ./bin/java'
which returns no hits.  Thus nothing is passed to a 'registervm' invocation.

And, if a user does not have /usr/ports tree installed, then the javavmwrap=
per
does not find any java (or for testing, if JAVAVM_FALLBACK_ONLY is set):

% java -version
java: error: no suitable JavaVMs found

An old installation that might already have java VMs registered (in
/usr/local/etc/javavms) could still work, but new installations would fail =
as
above (again, that's if the /usr/ports tree is not installed - since
javavmwrapper looks there first for the default location).

It's a little surprising this has not been noticed in 7 years, so maybe I
missed something in my analysis.

To try to reproduce the failure, I think you could do the following (assumes
some java/openjdk* is installed):

% sudo pkg delete -f javavmwrapper
% sudo rm /usr/local/etc/javavms
% sudo make -C /usr/ports/java/javavmwrapper install clean

Then either:
% env JAVAVM_FALLBACK_ONLY=3D1 java -version

 or

% mv /usr/ports /usr/ports.tmp-mv-away
% java -version


The attached path resolves this by modifying pkg-install to use noglob when=
 the
wildcard characters should not be evaluated by the shell.

While here, fix the bootstrap exclusion now that /usr/local/bootstrap-openj=
dk*
dirs are named bootstrap-openjdk8, ...jdk11, etc. (rather than the old
bootstrap-openjdk removed in 2017-12).  The patch excludes bootstrap-openjd=
k.*
(regex) instead.  I believe this was changed when java/bootstrap-openjdk was
replaced with java/bootstrap-openjdkXX, and pkg-install was not updated to
accommodate the change.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-239705-7788>