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 1kB12j-0006kn-OM for pljava-dev@arkaria.postgresql.org; Wed, 26 Aug 2020 19:25:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kB12i-0007U2-Ni for pljava-dev@arkaria.postgresql.org; Wed, 26 Aug 2020 19:25:08 +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 1kB12i-0007Tv-5d for pljava-dev@lists.postgresql.org; Wed, 26 Aug 2020 19:25:08 +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 1kB12f-0003wU-AD for pljava-dev@lists.postgresql.org; Wed, 26 Aug 2020 19:25:07 +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=i1lgTU6S7wERXkVnqJDYswNvqICnwccz2JgVpPRdVNs=; b=rObMsAmkF1ueqZ4VJTzIQVdysb Q8nGSaHJJa78WQ/iLV1J66ig0efk6Uh5JRfUGxmxwVTSIvn4veZmMaiTzBo1Dityl5UCX3e3P4wwR 3kNfWvmn9rjCP36vvNmMNA2G4hcKz0PpdpAiv5/AN1of0ZHKJlqw77WSMOmelemqZCTWSJ3e8Uh3S R2gBzOimenglSwoju4hL/HAOTRe4l2QdEj62f+fuPl3RT6NnNbw5S0oPE7AjduVC+tSKiznjD8SUM T8Hlf9eTFXnEciVWPD2BMyh5a8YgdsJOgr1sPWaWfbrcU0UJzzk5xldWqSe0xJUYTKWTH/ZDO3xLM Rj9+uKvw==; Received: from [184.19.31.139] (port=51359) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kB12d-008pl7-9S; Wed, 26 Aug 2020 15:25:03 -0400 Subject: Re: the ScriptingMojo To: Kartik Ohri References: <5F3D32E9.80504@anastigmatix.net> <5F3D36BE.70703@anastigmatix.net> <5F3D38F8.7050907@anastigmatix.net> <5F3D3A75.5010304@anastigmatix.net> <5F3D3D2E.4070109@anastigmatix.net> <5F3D43BD.4020900@anastigmatix.net> <5F3DA48D.7090408@anastigmatix.net> <5F41943D.9080707@anastigmatix.net> <5F427604.5010103@anastigmatix.net> <5F42A71F.8000002@anastigmatix.net> <5F459B6E.3020803@anastigmatix.net> <5F45EE7F.5020609@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5F46B70E.6070601@anastigmatix.net> Date: Wed, 26 Aug 2020 15:25:02 -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 08/26/20 12:55, Kartik Ohri wrote: > I have made some progress on the plugin. The Mac OS X configuration is > working and passing the CI. I have also begun work on completing the > Windows configuration. I am having some issues with the File.separator > being used in paths. Once I am able to resolve it, we should have all the > basic functionality ready. Also, I noticed that running pg_config in the > Windows command line (MSVC) environment gives values of cc, cflags and > ldflags so on as not recorded. That rings a bell. I seem to recall that PostgreSQL's own build process, when using MSVC, operates rather differently from other build environments. A lot of what would be passed as command-line arguments to other compilers or linkers will be used to generate 'project' or 'solution' files instead, and MSVC reads those: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/tools/msvc/README;hb=HEAD I have not delved into whether the nar-maven-plugin is doing something similar under the hood. PostgreSQL's src/tools/msvc seems to have around 2400 lines of Perl dedicated to writing properly-formatted project and solution files. (In reality, it's not really that bad, because that's the build system /for PostgreSQL itself/, and a lot of the lines in Solution.pm are devoted to writing the files like pg_config.h with the right values in them. When building an extension, that just gets #include'd; it was already written when PostgreSQL was built, so we don't have to generate it.) The info on the (slightly less involved) needs for simply building an extension with MSVC is here: https://wiki.postgresql.org/wiki/Building_and_Installing_PostgreSQL_Extension_Modules#Windows_with_Microsoft_Visual_Studio To me, translating a couple thousand lines of Perl to Java in order to generate project and solution files would have a very unappetizing sound. If the nar-maven-plugin is also generating such files when it uses MSVC to build, then probably it also has some classes to help generating those files (or it uses a dependency that has some classes to help generating those files). It might not be too bad to end up adding that as a dependency of the PGXS plugin (added by a profile conditioned on Windows os) in order to reuse that part of its code, if it is accessible. Regards, -Chap