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 1jy5Cf-0008JF-MD for pljava-dev@arkaria.postgresql.org; Wed, 22 Jul 2020 03:13:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jy5Ce-0002O9-H3 for pljava-dev@arkaria.postgresql.org; Wed, 22 Jul 2020 03:13:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jy5Ce-0002O2-8N for pljava-dev@lists.postgresql.org; Wed, 22 Jul 2020 03:13:56 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jy5CX-0006x2-3p for pljava-dev@lists.postgresql.org; Wed, 22 Jul 2020 03:13:55 +0000 Received: by mail-ej1-x631.google.com with SMTP id l4so581612ejd.13 for ; Tue, 21 Jul 2020 20:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JfrcmCi1huwT6ZQRP5uheCtXuYBk3Y4Q8QT5q/m379Q=; b=f7gj0iMpEYNddswREyLIzKIxaEtGoxVMJZ94Gm0t/1rOR6gCpIk4kDFL7hx+Ctnmw2 xmcPtTq1/O7elIq6biEonGdNcf0OeA3+CQQuBY70elyriTXjgNtHwzh30SzmFJvI+21Z +oOoU8ZLPZRpBTeX3Xo0MN0o7WfZIIsEDYLAq14jaEAeKm4QShW/b85flBV6115R5nui ZmuH5FQmvMlGtTGIJtIbbA0zYSUfjFjSMGze5ZaHbBQdBUT6NYQKpBrbYI9Be/vzqku3 PX0MkImCDeOLTq6xat8Vl3Qn3IaP0BGH1dw+e0U5vLriPKSWHqxDHPDJRjHGbcbW7yto nlLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JfrcmCi1huwT6ZQRP5uheCtXuYBk3Y4Q8QT5q/m379Q=; b=evtpNpY+XH4ep1rAqvyY8m8ssHuxRo5uWgeWK/uXvKsboD53JkodDFPEmt4/6CHksh fX+cfs6qkVXknFxABxr1wfOn7bSGi7U255k8CK2mG4gDq/ngGJ/L42+Td4jq2qy5yJRv LuamxzSkgTClLlAC0ALUmvpS9y47zUHwWUVNnSV6SHkvRddc6CEWP8XooX8d4JWgiZz1 uFBDkBROBZzAbMYIjNob+z3rbhVk5cPZcpQVybQuCghU9cgZrM83qz/IyZV3IVbGoKV3 Vp/v9El4PzNeB1wLC5GLSMsX9jXpX/UymMlxBx3dY0cB9VpHMsrzXxIN4KrR6Gb804Wd HBmQ== X-Gm-Message-State: AOAM533fWfQvWmdy7psSb9YrTg0RvkjZ7PKtqjY1Kx7Noi1CQyHxImZ9 qFBC0m4IBKyT4bjBVtRhvaR8oCq4mGqlwxsMHqARalOZtZ1z8g== X-Google-Smtp-Source: ABdhPJwh9lpg1gRqy9Ls6LeS/Xs/9ky7HqTW8WUkRuPlNQwV4ExF9e7W3c5h9iZylkUGzypE28lnoJAJ5Jjan2nj+LQ= X-Received: by 2002:a17:906:71c6:: with SMTP id i6mr29389851ejk.103.1595387627786; Tue, 21 Jul 2020 20:13:47 -0700 (PDT) MIME-Version: 1.0 References: <5F1338F8.6030506@anastigmatix.net> <5F135B84.8070302@anastigmatix.net> <5F14C34E.4020704@anastigmatix.net> <5F14E15A.4040202@anastigmatix.net> <5F1664C5.2070700@anastigmatix.net> <5F1735ED.6020707@anastigmatix.net> <5F1753C9.4060500@anastigmatix.net> <5F175F40.1000905@anastigmatix.net> In-Reply-To: <5F175F40.1000905@anastigmatix.net> From: Kartik Ohri Date: Wed, 22 Jul 2020 08:43:36 +0530 Message-ID: Subject: Re: PL/Java new build plugin To: Chapman Flack Cc: pljava-dev@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000d556c905aaff20ce" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000d556c905aaff20ce Content-Type: text/plain; charset="UTF-8" On Wed, Jul 22, 2020 at 3:03 AM Chapman Flack wrote: > On 07/21/20 17:00, Kartik Ohri wrote: > >> I had set JAVA_HOME and ran javac -version which pointed that Java 15 > was > > being used but I tested again to be sure.I specified the Java Home in the > > mvn statement and ran with debug flags to see which version was running. > > You can see around line 473 here > > https://travis-ci.com/github/amCap1712/pljava/jobs/363479322. The > result is > > the same: the script engine finds nashorn but not graal. > > How odd. When I run the tip of test-graal here with 15-ea, I simply get > "No suitable engine found for specified engine name or mime type". > > If I go to the parent-project POM and edit the nashorngone profile > so that the two graal jars are added as dependencies of pljava-pgxs, > I had missed it during the merge. I had overlooked that the jars were added as a dependency of maven-antrun. So, I added this fix but the CI failed ( https://travis-ci.com/github/amCap1712/pljava/jobs/363573395 commit SHA 8aa3e5c07108d944b66f164ad0b70082148a45b1 ) which made me realise that when the profile is activated the plugin does not exist. The error message also shows this. Maven looks in local and online repositories. Adding dependencies directly to plava-pgxs's pom works. I think we could replicate the profile in pgxs to ensure graal is only added as a dependency if needed. then I run it again, it finds graal. The dependency-collector debug > output now shows the dependencies: > > [DEBUG] org.postgresql:pljava-pgxs:jar:0.0.1-SNAPSHOT: > [DEBUG] org.graalvm.js:js:jar:20.1.0:runtime > [DEBUG] org.graalvm.regex:regex:jar:20.1.0:runtime > [DEBUG] org.graalvm.truffle:truffle-api:jar:20.1.0:runtime > [DEBUG] org.graalvm.sdk:graal-sdk:jar:20.1.0:runtime > [DEBUG] org.ow2.asm:asm:jar:7.1:runtime > [DEBUG] org.ow2.asm:asm-tree:jar:7.1:runtime > [DEBUG] org.ow2.asm:asm-analysis:jar:7.1:runtime > [DEBUG] org.ow2.asm:asm-commons:jar:7.1:runtime > [DEBUG] org.ow2.asm:asm-util:jar:7.1:runtime > [DEBUG] com.ibm.icu:icu4j:jar:66.1:runtime > [DEBUG] org.graalvm.js:js-scriptengine:jar:20.1.0:runtime > [DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1:runtime > [DEBUG] Created new class realm > plugin>org.postgresql:pljava-pgxs:0.0.1-SNAPSHOT > [DEBUG] Importing foreign packages into class realm > plugin>org.postgresql:pljava > -pgxs:0.0.1-SNAPSHOT > [DEBUG] Imported: < project>org.postgresql:pljava-so:1.6.0-SNAPSHOT > [DEBUG] Populating class realm > plugin>org.postgresql:pljava-pgxs:0.0.1-SNAPSHOT > [DEBUG] Included: org.postgresql:pljava-pgxs:jar:0.0.1-SNAPSHOT > [DEBUG] Included: org.graalvm.js:js:jar:20.1.0 > [DEBUG] Included: org.graalvm.regex:regex:jar:20.1.0 > [DEBUG] Included: org.graalvm.truffle:truffle-api:jar:20.1.0 > [DEBUG] Included: org.graalvm.sdk:graal-sdk:jar:20.1.0 > [DEBUG] Included: org.ow2.asm:asm:jar:7.1 > [DEBUG] Included: org.ow2.asm:asm-tree:jar:7.1 > [DEBUG] Included: org.ow2.asm:asm-analysis:jar:7.1 > [DEBUG] Included: org.ow2.asm:asm-commons:jar:7.1 > [DEBUG] Included: org.ow2.asm:asm-util:jar:7.1 > [DEBUG] Included: com.ibm.icu:icu4j:jar:66.1 > [DEBUG] Included: org.graalvm.js:js-scriptengine:jar:20.1.0 > [DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.1 > > and the logging you added: > > [ERROR] Graal.js > [INFO] setProjectProperty("PGSQL_BINDIR", > ... > [DEBUG] com.oracle.truffle.js.scriptengine.GraalJSScriptEngine@66dfc523 > > > So I think the dependency info explains why your run was not finding > graal. I remain baffled regarding how your run was managing to find > Nashorn instead. I wonder if you downloaded a more recent 15-ea than > I have, and there was a chorus of complaints and they put Nashorn back > in for now? > I was using the latest JDK 15+32. I checked the release notes which mark the nashorn removal as delivered. But they go only upto 15+29 till there is no mention of nashorn again. So, I did a build again and checked again. This time with automated travis build instead of debug and it detects only Graal (no nashorn). Despite specifying JAVA_HOME with maven, it seems it was using a different Java installation or I made an inadvertent error in the JAVA_HOME due to which it used the wrong installation, :( but plausible. I would be interested to see what a similar Travis run will do after > making sure the graal dependencies are listed: will it then find nashorn, > or graal? > I did a build with JDK 14 with the dependencies to find this out. Interestingly, it fails when both coexist. https://travis-ci.com/github/amCap1712/pljava/jobs/363575841 commit SHA b5950dedc7018470e5331f20d9300344a00f40ce I think we will need to add the profile in that case then. (The Java 15 build failing in this case is probably because of some error I made while merging the denashorn branch since the builds on the branch itself were passing.) Regards, Kartik --000000000000d556c905aaff20ce Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jul 22, 2020 at 3:03 AM Chapman F= lack <chap@an= astigmatix.net> wrote:
On 07/21/20 17:00, Kartik Ohri wro= te:
>> I had set JAVA_HOME and ran javac -version which pointed that Java= 15 was
> being used but I tested again to be sure.I specified the Java Home in = the
> mvn statement and ran with debug flags to see which version was runnin= g.
> You can see around line 473 here
> https://travis-ci.com/github/amCap1= 712/pljava/jobs/363479322. The result is
> the same: the script engine finds nashorn but not graal.

How odd. When I run the tip of test-graal here with 15-ea, I simply get
"No suitable engine found for specified engine name or mime type"= .

If I go to the parent-project POM and edit the nashorngone profile
so that the two graal jars are added as dependencies of pljava-pgxs,

I had missed it during the merge. I had overl= ooked that the jars were added as a dependency of maven-antrun. So, I added= this fix but the CI failed (https://travis-ci.com/github/amCap1712/pljava/jo= bs/363573395=C2=A0commit SHA 8aa3e5c07108d944b66f164ad0b70082148a45b1 )= which made me realise that when the profile is activated the plugin does n= ot exist. The error message also shows this. Maven looks in local and onlin= e repositories. Adding dependencies directly to plava-pgxs's pom works.= I think we could replicate the profile in pgxs to ensure graal is only add= ed as a dependency if needed.

then I run it again, it finds graal. The dependency-collector debug
output now shows the dependencies:

[DEBUG] org.postgresql:pljava-pgxs:jar:0.0.1-SNAPSHOT:
[DEBUG]=C2=A0 =C2=A0 org.graalvm.js:js:jar:20.1.0:runtime
[DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0org.graalvm.regex:regex:jar:20.1.0:runtim= e
[DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0org.graalvm.truffle:truffle-api:jar:20.1.= 0:runtime
[DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0org.graalvm.sdk:graal-sdk:jar:20.1.0:runt= ime
[DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0org.ow2.asm:asm:jar:7.1:runtime
[DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0org.ow2.asm:asm-tree:jar:7.1:runtime
[DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0org.ow2.asm:asm-analysis:jar:7.1:runtime<= br> [DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0org.ow2.asm:asm-commons:jar:7.1:runtime [DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0org.ow2.asm:asm-util:jar:7.1:runtime
[DEBUG]=C2=A0 =C2=A0 =C2=A0 =C2=A0com.ibm.icu:icu4j:jar:66.1:runtime
[DEBUG]=C2=A0 =C2=A0 org.graalvm.js:js-scriptengine:jar:20.1.0:runtime
[DEBUG]=C2=A0 =C2=A0 org.codehaus.plexus:plexus-utils:jar:1.1:runtime
[DEBUG] Created new class realm plugin>org.postgresql:pljava-pgxs:0.0.1-= SNAPSHOT
[DEBUG] Importing foreign packages into class realm plugin>org.postgresq= l:pljava
-pgxs:0.0.1-SNAPSHOT
[DEBUG]=C2=A0 =C2=A0Imported:=C2=A0 < project>org.postgresql:pljava-s= o:1.6.0-SNAPSHOT
[DEBUG] Populating class realm plugin>org.postgresql:pljava-pgxs:0.0.1-S= NAPSHOT
[DEBUG]=C2=A0 =C2=A0Included: org.postgresql:pljava-pgxs:jar:0.0.1-SNAPSHOT=
[DEBUG]=C2=A0 =C2=A0Included: org.graalvm.js:js:jar:20.1.0
[DEBUG]=C2=A0 =C2=A0Included: org.graalvm.regex:regex:jar:20.1.0
[DEBUG]=C2=A0 =C2=A0Included: org.graalvm.truffle:truffle-api:jar:20.1.0 [DEBUG]=C2=A0 =C2=A0Included: org.graalvm.sdk:graal-sdk:jar:20.1.0
[DEBUG]=C2=A0 =C2=A0Included: org.ow2.asm:asm:jar:7.1
[DEBUG]=C2=A0 =C2=A0Included: org.ow2.asm:asm-tree:jar:7.1
[DEBUG]=C2=A0 =C2=A0Included: org.ow2.asm:asm-analysis:jar:7.1
[DEBUG]=C2=A0 =C2=A0Included: org.ow2.asm:asm-commons:jar:7.1
[DEBUG]=C2=A0 =C2=A0Included: org.ow2.asm:asm-util:jar:7.1
[DEBUG]=C2=A0 =C2=A0Included: com.ibm.icu:icu4j:jar:66.1
[DEBUG]=C2=A0 =C2=A0Included: org.graalvm.js:js-scriptengine:jar:20.1.0
[DEBUG]=C2=A0 =C2=A0Included: org.codehaus.plexus:plexus-utils:jar:1.1

and the logging you added:

[ERROR] Graal.js
[INFO] setProjectProperty("PGSQL_BINDIR",
...
[DEBUG] com.oracle.truffle.js.scriptengine.GraalJSScriptEngine@66dfc523


So I think the dependency info explains why your run was not finding
graal. I remain baffled regarding how your run was managing to find
Nashorn instead. I wonder if you downloaded a more recent 15-ea than
I have, and there was a chorus of complaints and they put Nashorn back
in for now?
I was using the latest JDK=C2=A015+32. I c= hecked the release notes which mark the nashorn removal as=C2=A0 delivered.= But they go only upto 15+29 till there is no mention of nashorn again. So,= I did a build again and checked again. This time with automated travis bui= ld instead of debug and it detects only Graal (no nashorn).=C2=A0 Despite s= pecifying JAVA_HOME with maven, it seems it was using a different Java inst= allation or I made an inadvertent error in the JAVA_HOME due to which it us= ed the wrong installation, :( but plausible.

I would be interested to see what a similar Travis run will do after
making sure the graal dependencies are listed: will it then find nashorn, or graal?
I did a build with JDK 14 with the dependenc= ies to find this out. Interestingly, it fails when both coexist.=C2=A0https:/= /travis-ci.com/github/amCap1712/pljava/jobs/363575841=C2=A0commit SHA= =C2=A0b5950dedc7018470e5331f20d9300344a00f40ce=C2=A0I think we will need to= add the profile in that case then.

(The Java 15 b= uild=C2=A0failing in this case is probably because of some error I made whi= le merging the denashorn branch since the=C2=A0builds on the branch itself = were passing.)

Regards,
Kartik
--000000000000d556c905aaff20ce--