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

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Kartik Ohri <kartikohri13(at)gmail(dot)com>
Cc: pljava-dev(at)lists(dot)postgresql(dot)org
Subject: Re: Starting build-system work (Windows/Mac users please speak up)
Date: 2020-05-23 15:06:22
Message-ID: 5EC93BEE.5060608@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

On 05/23/20 03:16, Kartik Ohri wrote:
>>
>> Also -Psaxon-examples is needed to build a set of XML examples that are
>> not built by default.
>
> ERROR: java.sql.SQLNonTransientException: Unable to find static method
> org.postgresql.pljava.example.saxon.S9.like_regex with signature
> (String,String,String,boolean)boolean
>
> 5638
>
> CONTEXT: SQL statement "CREATE OR REPLACE FUNCTION javatest.like_regex(

Good, good! In the 1.6 branch, PL/Java now has a validator, which will
produce an error at CREATE FUNCTION time if anything the function depends
on can't be resolved. (In 1.5, you would be able to create the function,
and only find out it didn't work later when trying to call it.)

The Saxon examples depend on the Saxon jar, which hasn't been installed
or isn't on the classpath. So there are two ways to proceed:

1. sqlj.install_jar the Saxon jar first, and sqlj.set_classpath to put
it on the classpath, before the sqlj.install_jar of the examples jar.

After a build completes, the needed jar will be present in the local
Maven repository as
.m2/repository/net/sf/saxon/Saxon-HE/*/Saxon-HE-*.jar

The * is there for the Saxon version, which could change with time.
In a build from a clean slate, there should be only one version there.
If .m2/repository is being cached, it is possible from time to time
Maven will find a later Saxon version available and download it and
an older one will still be there, and a script would have to select
the latest match.

2. Or, SET check_function_bodies TO off; before the sqlj.install_jar for
the examples, and dependencies won't be checked. That will be more like
the old 1.5 behavior, where the CREATE FUNCTION will succeed, but later
the function won't work.

> I was unable to find this issue in Github Issues. Is this a known issue or
> should I file one on Github or is this an error due to some
> misconfiguration in the build environment ?

If the PL/Java documentation that you are reading is what is online
at https://tada.github.io/pljava/ then it's worth remembering that what
is published there is the latest *released* version's documentation,
for 1.5.5 at the moment. So there's nothing in that version about the
function validator.

As you're working on the never-yet-released 1.6.0-SNAPSHOT branch,
the best way to read the documentation is to generate it locally

mvn site site:stage

and then point your browser at the local file
target/staging/index.html

However, just at the moment the javadoc build is failing for me.
I'm quite sure it worked in February when I committed 5ee9b6b.

This is one of those moments when I do not love Maven. I'll take
a look at what's broken this time.

Regards,
-Chap

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Chapman Flack 2020-05-23 15:58:44 Re: Starting build-system work (Windows/Mac users please speak up)
Previous Message Kartik Ohri 2020-05-23 07:16:17 Re: Starting build-system work (Windows/Mac users please speak up)