From owner-freebsd-ports-bugs Thu Mar 13 16:40:18 2003 Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EED737B401 for ; Thu, 13 Mar 2003 16:40:15 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F9D743FD7 for ; Thu, 13 Mar 2003 16:40:14 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2E0eDNS011889 for ; Thu, 13 Mar 2003 16:40:13 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2E0eDUp011888; Thu, 13 Mar 2003 16:40:13 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F62E37B401 for ; Thu, 13 Mar 2003 16:35:24 -0800 (PST) Received: from knight.volant.org (knight.volant.org [207.111.218.254]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC96643FBD for ; Thu, 13 Mar 2003 16:35:23 -0800 (PST) (envelope-from root@knight.volant.org) Received: from root by knight.volant.org with local (Exim 4.12) id 18tdAQ-000OwF-00 for FreeBSD-gnats-submit@freebsd.org; Thu, 13 Mar 2003 16:35:22 -0800 Message-Id: Date: Thu, 13 Mar 2003 16:35:22 -0800 From: Pat Lashley To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/49995: Native JDK1.4.1 build fails if WRKDIRPREFIX starts with /d or /i Sender: owner-freebsd-ports-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 49995 >Category: ports >Synopsis: Native JDK1.4.1 build fails if WRKDIRPREFIX starts with /d or /i >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 13 16:40:13 PST 2003 >Closed-Date: >Last-Modified: >Originator: Pat Lashley >Release: FreeBSD 4.8-RC i386 >Organization: Henry Davis Consulting >Environment: System: FreeBSD mccaffrey.phoenix.volant.org 4.8-RC FreeBSD 4.8-RC #1: Sat Mar 8 22:32:11 PST 2003 root@mccaffrey.phoenix.volant.org:/d3/obj/usr/src/sys/MCCAFFREY i386 >Description: An attempt to build the native JDK 1.4.1 can fail with a message about *** No rule to make target `.../control/build/bsd-i586/classes/org/omg/ PortableServer/AdapterActivator.class' Examination of the build log will reveal that every invocation of the IDL toJavaPortable compiler reports a bogus 'invalid argument: -td' error. NOTE that the invalid argument errors do -NOT- cause make errors!!! The actual cause of the problem is some brain-damage in the arguments parsing in j2se/src/share/classes/com/sun/tools/corba/se/idl/Arguments.java For each argument checked; it first verifies that it starts with a dash or a slash. (If not, an invalidargument exception is thrown.) It then makes a lower-case copy of the argument, minus that first character; and proceeds to compare the lowercased string against each of the recognized parameters. If it doesn't find a match, the parameter, and any immediately following parameters that don't start with a dash or a slash are copied into a vector to be passed to the parseOtherArgs() function. (Which is there to provide a mechanism for subclasses to recognize additional parameters.) The problem lies with the checking for the '-i' and '-d' parameters. They each take an additional string; which is concatenated directly to the parameter rather than being a following parameter. (E.g., '-dmumble' rather than '-d mumble'). This means that a unix-style filepath option to an 'extra' parameter may not start with a 'd' or a 'i'. In a FreeBSD ports install, this is only a problem if WRKDIRPREFIX is set to something starting /d or /i Which in my case, it was. (I share a single ports tree via NFS mounts and set WRKDIRPREFIX to space on a local partition on each machine to avoid conflicts. In this case, the WRKDIRPREFIX was set to /d4/FreeBSDobj.) >How-To-Repeat: Set the WRKDIRPREFIX environment variable to some path that starts with /d or /i (E.g., /disk2). (Note that this has to be the actual path, not a symlink.) cd /usr/ports/java/jdk14 make build >Fix: This patch modifies the argument parsing loops to only remove the leading char if it is a dash. --- ../../j2se/src/share/classes/com/sun/tools/corba/se/idl/Arguments.java.~1~ Fri Sep 6 00:16:27 2002 +++ ../../j2se/src/share/classes/com/sun/tools/corba/se/idl/Arguments.java Thu Mar 13 15:30:33 2003 @@ -100,7 +100,15 @@ for (i = 0; i < args.length - 1; ++i) { if (args[i].charAt (0) != '-' && args[i].charAt (0) != '/') throw new InvalidArgument (args[i]); - String lcArg = args[i].substring (1).toLowerCase (); + + String lcArg = args[i].toLowerCase (); + + // NOTE that if we were to also chop off a leading /, we + // would have problems with parameters to 'other' args + // which consist of unix-style filepaths which have + // mountpoints starting with /d or /i + if (args[i].charAt (0) == '-') + lcArg = lcArg.substring (1); // Include path if (lcArg.equals ("i")) { --- ../../j2se/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java.~1~ Fri Sep 6 00:16:36 2002 +++ ../../j2se/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java Thu Mar 13 15:28:51 2003 @@ -77,7 +77,9 @@ if (lcArg.charAt (0) != '-' && lcArg.charAt (0) != '/') throw new InvalidArgument (args[i]); - lcArg = lcArg.substring (1); + + if (lcArg.charAt (0) == '-') + lcArg = lcArg.substring (1); // Proxy options; default is -fclient. if (lcArg.startsWith ("f")) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports-bugs" in the body of the message