Skip to content

Commit

Permalink
Fix build output when no platform rules matched
Browse files Browse the repository at this point in the history
Addresses issue #485: anyone unlucky enough to build in an environment
matching none of the probe methods for known platform rules would
be faced with a JavaScript null-pointer exception instead of a message
giving any clue where to look for the problem.
  • Loading branch information
jcflack committed Apr 25, 2024
1 parent 66c0b80 commit 46835bb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pljava-so/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@
var os_name = java.lang.System.getProperty("os.name");
var implementation = null;
var extension = null;
var pgxs = null;
for (var index = 0; index < configuration.length; index ++) {
if(configuration[index].probe(os_name)) {
implementation = configuration[index];
Expand All @@ -342,10 +343,23 @@
}
}
var pgxs = new org.postgresql.pljava.pgxs.AbstractPGXS(implementation);
if ( null !== implementation )
pgxs = new org.postgresql.pljava.pgxs.AbstractPGXS(implementation);
function execute()
{
if ( null === pgxs )
{
return plugin.exceptionWrap("\
No compiling/linking rules were selected for this platform. Rules for \
supported platforms can be found below 'var configuration = [' in \
pljava-so/pom.xml. If you believe one of the supported platforms should have \
matched, studying its probe: function may reveal why it did not match. \
An expected environment variable might not be set, for example. If your \
platform is not one of those supported, please consider adding a rule set \
for it, and submitting a pull request so that PL/Java can support it.", true);
}
try
{
var files = utils.getFilesWithExtension(source_path, ".c");
Expand Down

0 comments on commit 46835bb

Please sign in to comment.