Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxiug-0006lg-I8 for pljava-dev@arkaria.postgresql.org; Tue, 21 Jul 2020 03:25:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jxiue-000666-CZ for pljava-dev@arkaria.postgresql.org; Tue, 21 Jul 2020 03:25:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxiud-00063y-Sa for pljava-dev@lists.postgresql.org; Tue, 21 Jul 2020 03:25:52 +0000 Received: from anastigmatix.net ([68.171.219.55]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxiub-0002Mv-AA for pljava-dev@lists.postgresql.org; Tue, 21 Jul 2020 03:25:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uyg3eTH0uhcYHL17tTsRovl6oypZ+loueZ0KK0ox6yU=; b=FaYlmk2v+UOwkDiwSuZyzbljeM +Ya94m2R8ONGko09Ar4er2Loi6fGvgV0P3YYylw+82a9R1kV2QlJOYjcWaOMFdLxkzvwGXSe1V6hw fHFfDAyfOsnBkW4njonrGgJYZp+GCjs+V1MeTNJApfqwq5paDzIx/hAo73R431dRHTSql/syI8cSl /G4a+PsDMkJPAt+NuINQtsWi8iEJHniOVl7q3dAU9YCDCiKRHYjfkgYwL2hWys4acjjLwvXVOJybo sERni2BSn5FBI+8ToORNPH0i7lxtHgfwy7Y2ajP3yfVT7wbGm3QKateepvqx+5cpWqfd2r3OfyfXp IGozzXcw==; Received: from [184.19.31.139] (port=52426) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jxiu6-00HKs3-Db; Mon, 20 Jul 2020 23:25:46 -0400 Subject: Re: PL/Java new build plugin To: Kartik Ohri References: <5F0E3972.5070609@anastigmatix.net> <5F0F2DA2.5090603@anastigmatix.net> <5F12FF49.6090906@anastigmatix.net> <5F12FF80.5020208@anastigmatix.net> <5F1338F8.6030506@anastigmatix.net> <5F135B84.8070302@anastigmatix.net> <5F14C34E.4020704@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5F16601D.4080502@anastigmatix.net> Date: Mon, 20 Jul 2020 23:25:17 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/20/20 23:00, Kartik Ohri wrote: > On Tue, Jul 21, 2020 at 8:29 AM Kartik Ohri wrote: > >> Something isn't quite right about the handling of -Dpljava.libjvmdefault; >>> the C compiler gives syntax errors if I use it (the build succeeds if >>> I don't). Running with -X shows this being passed to the compiler: >>> >>> -DPLJAVA_LIBJVMDEFAULT=${pljava.qlibjvmdefault} >>> >> It is because the plugin is no longer detecting PLJAVA_LIBJVMDEFAULT. I >> did not retain the method to automatically detect the variable and use it >> and set its value. Should we keep it in the configuration block in pom.xml >> since we have exposed the C quoting as well to the script engine or make an >> exception for this to be specified via command line ? >> > To be sure and also to confirm, I didn't misunderstand something, can you > share the configuration block and the maven command you executed ? I didn't change the configuration block; my usual mvn command is like: mvn -Duser.home=/var/tmp/nohome -Ppgjdbc-ng -Psaxon-examples -Pwnosign \ -Dnar.cores=1 -Dso.debug=true \ -Dpljava.libjvmdefault=/var/tmp/jdk-14+36/lib/server/libjvm.so \ -Dpgsql.pgconfig=/var/tmp/nohome/pg$v/bin/pg_config clean install The purpose is for -Dpgsql.pgconfig to be specified via command line; it is there so that package maintainers (e.g. for Debian) can have it built to refer to the default libjvm location on a deployed system according to their packaging conventions. That doesn't have to be the same as the jvm being used to build, so autodetecting wouldn't help. It should be up to the package maintainer to choose what -Dpljava.libjvmdefault path to give. At present, how it gets from there to the compiler is Rube Goldberg; the command line sets pljava.libjvmdefault, an antrun script checks if that is non-null and defines a C-quoted version pljava.qlibjvmdefault, and the haslibjvmdefault profile in pom.xml is activated if the first property (without the q) exists, and when activated, it augments the maven-nar-plugin configuration with a C compiler define for PLJAVA_LIBJVMDEFAULT=${pljava.qlibjvmdefault}. That could be a lot less circuitous once the nar plugin is out of the picture, but for right now that's the way it works. If the block of script had a test for the non-null system property and set the 'q' property from it (like the last 8 lines of the old antrun script), that at least would preserve the current behavior. Regards, -Chap