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 1je2qz-0000FW-V4 for pljava-dev@arkaria.postgresql.org; Wed, 27 May 2020 20:40:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1je2qy-0004OI-Nn for pljava-dev@arkaria.postgresql.org; Wed, 27 May 2020 20:40:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1je2qy-0004Mi-7z for pljava-dev@lists.postgresql.org; Wed, 27 May 2020 20:40:44 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1je2qv-0003l8-R0 for pljava-dev@lists.postgresql.org; Wed, 27 May 2020 20:40:43 +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=ZyC2QxxaaLMZBWUB4Wk1unyPRcPyathFfxWIR38g4oI=; b=VPT3aQJvYSikFcPch/8//YGHCo +tfbigPAoV+YxUdwO6Hgztz2c1ek8KwscOXVC3TYsvTKPH5Q/60ES1WTOZYHs1xY89x/vRJnv0uvi EY6+WiwgbQNUF0HxoxrzN48tGSE8Vdy4NNs8+YP8TIw/9ruN/cSGK20Izj/343i3Y2bjjNrJlEKcw /SBJnRKKwK9Y+f5q4XshId2jxlDIGUsbzqlkRaQXetcXZqWgxcOCbbVcBa0ywGiMd4wZlvv3jiOMB AjqSLmD18Yqe/jjDESRAlFm5a7/5JnU/D0NsaeGiqfyLV2vjqhh1hLSd2Fhybuivws24ctHa+bNxN KQbTDNJw==; Received: from [184.19.31.139] (port=48892) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1je2qt-00FfHC-HR; Wed, 27 May 2020 16:40:40 -0400 Subject: Re: Starting build-system work (Windows/Mac users please speak up) To: Kartik Ohri References: <5EC17E17.7070002@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5ECED046.3000308@anastigmatix.net> Date: Wed, 27 May 2020 16:40:38 -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 05/27/20 12:42, Kartik Ohri wrote: >> -ea:org.postgresql.pljava... -Xcheck:jni >> >> The -Xcheck:jni makes big output and big slowdown; it might be ok to >> include that in a subset of the tested configurations rather than all >> of them. >> > I think this is the major option left to be added to builds for Linux and > macOS. To which builds should I add the -Xcheck:jni flag I don't think it will make much difference ... maybe start with a build that's against the latest supported PG. Once things are going, maybe we can get a better sense of which outputs from -Xcheck:jni are innocuous and which ones really deserve attention, and write a filter that cuts down that volume effectively, then it might be desirable to add the option to more of the builds. > Also, I do not know about the -ea:org.postgresql.pljava... flag Good question, you got me to look again at the 'java' manual page and see that there is a long form for the option, -enableassertions. I have been using the -ea form by habit because it is shorter to type, but when putting it into a CI script the length doesn't matter, and it would be better to say -enableassertions:org.postgresql.pljava... and then it will not be as puzzling to the next person reading the CI script. If the idea of assertions isn't familiar, there's a very good explanation in [1]. In a lot of programming languages, there will be something like assert ; where you are saying you are certain will be true at that point in the program, because your analysis of the possibilities leaves no way it can be false. So it is a check on whether you've made an analytical mistake (or maybe a dumb typo five lines earlier). It does nothing at all if the condition is true (as it should be), and signals an error if it is false, so you know there is a problem. In production, after you're happy with testing results, sometimes you don't want the overhead of checking assertions anymore; after all, they are all testing conditions that are supposed to be true every time, and doing nothing else useful. Historically, in a language like C, 'assert' was provided as a macro [2], and you could compile the code for production with the macro defined to be nothing at all, so all your 'assert's just disappear and there is no cost in the running code. The disadvantage was that if some rare bug only showed up in production, you would not have any of the assertions there potentially showing where things went wrong. You would have to go back and completely recompile with assertions enabled, and run that version of the program, and hope the bug showed up again. Because Java does just-in-time compilation in the JVM, they can get the same efficiency when you don't want assertions checked, but without that disadvantage. The assertions are always written into the .class files, and you can decide at run time to give the -enableassertions option or not, and if you don't, the JIT compiler just leaves them out of the compiled code, but you can get them back whenever you want by just running again with -enableassertions. And as you can see, the option can be selective; you can -enableassertions:org.postgresql.pljava... for testing all the packages and subpackages in PL/Java but not in other libraries or Java itself. Naturally, CI testing is a context where we definitely want to be running with assertions enabled. Regards, -Chap [1] https://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html [2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html