public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chapman Flack <[email protected]>
To: Kartik Ohri <[email protected]>
Cc: [email protected]
Subject: Re: the ScriptingMojo
Date: Wed, 26 Aug 2020 15:25:02 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAASLQ4MH5JaVbrG9O_S+9dnp=tj_8N3jArxxpf-dJD1ezd5SfQ@mail.gmail.com>
References: <CAASLQ4Mva7dAXiS_c9OLhV4VzNHF=XNKJosuS5gtZTB6b4TW1Q@mail.gmail.com>
	<CAASLQ4OowXOmnbbbT0Wh1ZkB4h=6JQfC61ojmN07EYnO0QCcow@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAASLQ4MBWQeFLdAPNcsgcpLyekU5X=ExQUuGgE49AUFdEYJr8g@mail.gmail.com>
	<[email protected]>
	<CAASLQ4P5oEx0DLoDLEOAkZSwffU2eS2+NKbevgYqpknHGucaTw@mail.gmail.com>
	<[email protected]>
	<CAASLQ4Nr3MPQuZziVU+89ULZ=BgQjaPPnCLsyPR3mhW-eWoOBw@mail.gmail.com>
	<[email protected]>
	<CAASLQ4PkP017rtyUswKO_TCiNmnica-nrQHBgggFw-U_9MstUg@mail.gmail.com>
	<[email protected]>
	<CAASLQ4P47TNiEsuj3ga-vuYeCSBJZmHrPM-49E-X=0T5RTmhKw@mail.gmail.com>
	<[email protected]>
	<CAASLQ4MH5JaVbrG9O_S+9dnp=tj_8N3jArxxpf-dJD1ezd5SfQ@mail.gmail.com>

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_M...

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





view thread (78+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: the ScriptingMojo
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox