Starting build-system work (Windows/Mac users please speak up)

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: pljava-dev(at)lists(dot)postgresql(dot)org
Subject: Starting build-system work (Windows/Mac users please speak up)
Date: 2020-05-17 18:10:31
Message-ID: 5EC17E17.7070002@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

This message is largely for Kartik but may be of interest to others;
please contribute in case of suggestions, questions, concerns, etc.

*In particular, if you use Mac or Windows/MinGW-64 builds of PostgreSQL,
please check what I've said below and supply corrections/better ideas
as necessary.*

Thomas Hallgren, originator of PL/Java, is subscribed on this list, and
may have some thoughts on how GitHub Actions might be usable in place of
Travis without requiring the same level of repository write access.

== Java versions to build for

For setting up CI, I suggest basing the work on the 'master' branch,
which is where the future 1.6.0 release is taking shape. That branch
only supports Java 9 and later, and the build is much simplified
compared to the REL1_5_STABLE branch, which still takes extra pains
to support building back to Java SE 6.

I don't intend to abandon the REL1_5_STABLE branch immediately, so if
time permits, testing that branch and with earlier Java versions would
be ok, but should not be the focus.

== PostgreSQL versions to build for

Also, the newer branch targets a narrower range of PostgreSQL versions.
The obvious starting point would be the versions currently shown as
'supported' in the PostgreSQL versioning policy:

https://www.postgresql.org/support/versioning/ i.e., 12 back to 9.5.

The branch may build successfully for a couple of versions before 9.5.
I know the 'validator' PR knocked out pre-9.0 versions. When it comes
time to announce PL/Java 1.6, we might choose to say it works back
to PG 9.4, 9.3, or 9.2, if it works for those releases without extra fuss.

9.2 is a good stopping place, because the REL1_5_STABLE installation docs
have an extra section for installing on pre-9.2 versions, and that could
go away.

The REL1_5_STABLE branch tries to stay buildable back to PG 8.2, but
again, I would not focus effort there.

== Platforms to build for

Platforms should include at least one common Linux distro, Mac, and
Windows. Windows should test building both with MSVC and with MinGW-64.
(If I remember right, the EnterpriseDB PostgreSQL builds are made
with MSVC, and the BigSQL ones are made with MinGW-64.)

https://www.enterprisedb.com/software-downloads-postgres
https://pgsql.io/

Something may have changed with BigSQL; I see the URL got redirected
now to pgsql.io, and they say "Windows 10 Subsystem for Linux", which
may not involve a native build for Windows anymore.

EnterpriseDB has an installer for Mac. Also, Homebrew has been suggested,
and may now be preferred:

https://www.enterprisedb.com/downloads/postgresql
https://wiki.postgresql.org/wiki/Detailed_installation_guides#MacOS

== Extra options

When testing PL/Java and running the examples, pljava.vmoptions should
additionally contain:

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

The PostgreSQL server used for testing will ideally have been built
with these configure options:

--with-libxml --enable-cassert --enable-debug

and (on platforms where gcc is the compiler)

CFLAGS='-ggdb -Og -g3 -fno-omit-frame-pointer'

Prebuilt PostgreSQL versions available to the CI service might not have
been built with those options (pg_config output will show). So it may be
necessary to build PostgreSQL from source too. Again, it may be adequate
to do this for one platform, say Linux, if it is easiest there.)

If a PL/Java test crashes, the JVM may have written an hs_err_pid<n>.log
file (with n the PID of the backend process), which should be preserved
for review of the failing test.

That file is written by HotSpot JVMs (as the hs_ suggests). It is also
good to test with OpenJ9 JVMs, but I would focus first on covering the
combinations of Java version ✕ PG version ✕ platform, using HotSpot.

Regards,
-Chap

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Chapman Flack 2020-05-18 14:19:48 Re: Starting build-system work (Windows/Mac users please speak up)
Previous Message Chapman Flack 2020-05-15 03:04:14 Please welcome Kartik Ohri, for Google Summer of Code 2020!