Skip to content

Unhelpful output when build fails because no platform rules matched #485

Closed

Description

@escannord

Hello everyone, I hope you are well, I have a problem installing my pl/java, all the prerequisites are installed but I don't understand why there is this error (when I runs mvn clean install) and I tried everything possible to resolve it without success.
here is a picture of the error it gives me, thank you in advance for your help on thisCapture d’écran 2024-04-25 123816

Activity

  1. changed the title [-]mvn clean install forn pl/java doesn't work[/-] [+]mvn clean install for pl/java doesn't work[/+] on Apr 25, 2024
  2. jcflack commented on Apr 25, 2024

    @jcflack
    Contributor

    Hmm, I have not seen that one before.

    I see that you are building 1.5-SNAPSHOT. Does the same thing happen when you build from a released version?

    Also, the 1.5 series has not been the development focus for a while now. Its native portion was built with the nar-maven-plugin, which was a frequent source of issues and difficult workarounds.

    Do you have a requirement that prevents you using the PL/Java 1.6 series?

  3. escannord commented on Apr 25, 2024

    @escannord
    Author

    no I don't have any particular requirements on the version, but everything I've tried always gives an error on the backend native code.
    but I'm still going to try 1.6 see

  4. escannord commented on Apr 25, 2024

    @escannord
    Author

    voici la nouvelle erreur avec 1.6-SNAPSHOT
    Capture d’écran 2024-04-25 143903

  5. jcflack commented on Apr 25, 2024

    @jcflack
    Contributor

    Ah, there's a slightly more traceable error message, anyway. A JavaScript error, null is not an Object, no doubt from the JS code in pljava-so/pom.xml that handles compiling and linking. Says line number 315, and that JS code begins at line 31 of the POM, so it's right after the code that tries to select the right compiling/linking rules for the platform:

    https://github.com/tada/pljava/blob/REL1_6_STABLE/pljava-so/pom.xml#L336

    It seems that none of the platform probe tests succeeded (which explains why there was no Using compiling/linking rules for ... message shown).

    I am not sure whether you are trying to build with Windows MinGW or with Windows MSVC. I see there are msys64 components in some of your paths, which would make me think MinGW, but I noticed in your earlier screenshot, nar-maven-plugin said Using AOL: amd64-Windows-msvc.

    At any rate, it seems that neither probe succeeded, so you might start by looking at the two probe tests to see how they identify each platform:

    https://github.com/tada/pljava/blob/REL1_6_STABLE/pljava-so/pom.xml#L206

    https://github.com/tada/pljava/blob/REL1_6_STABLE/pljava-so/pom.xml#L264

    My first guess would be that you might not have set one of the expected environment variables. I hope that those are documented in the corresponding build pages, but something might need to be clarified.

    https://tada.github.io/pljava/build/mingw64.html

    https://tada.github.io/pljava/build/buildmsvc.html

    As a side note, if you are planning to contribute to development of PL/Java, it can be useful to build from the development snapshots, but if you simply intend to use it, building from a version that has been released is preferable. The latest release in the 1.6 series has tag V1_6_7.

  6. escannord commented on Apr 25, 2024

    @escannord
    Author

    I will try your suggestions and see. THANKS

  7. escannord commented on Apr 25, 2024

    @escannord
    Author

    when I try the V1_6_7 tag, I have the same problem, maybe it's my version of postgres (version 14) or I didn't install maven correctly?
    Thank you in advance for your answer?

  8. escannord commented on Apr 25, 2024

    @escannord
    Author

    hello @jcflack , I finally got around to it thanks to your help, and I thank you for it.
    finally I used Windows MSVC and the V1_6_7 tag after noticing that my postgre was built with MSVC:
    Capture d’écran 2024-04-25 201834
    And here is the result:
    Capture d’écran 2024-04-25 200512

  9. escannord commented on Apr 25, 2024

    @escannord
    Author

    Thank you again for your help

  10. jcflack commented on Apr 25, 2024

    @jcflack
    Contributor

    I am glad that it worked.

    I will treat this issue as a bug report that the build process gives a null-pointer exception instead of an explanatory message when no supported platform rules have matched.

  11. changed the title [-]mvn clean install for pl/java doesn't work[/-] [+]Unhelpful output when build fails because no platform rules matched[/+] on Apr 25, 2024
  12. escannord commented on Apr 26, 2024

    @escannord
    Author

    All right

  13. jcflack commented on Oct 20, 2024

    @jcflack
    Contributor

    Believed resolved in 1.6.8.

  14. Adarsh-k0802 commented on Oct 22, 2024

    @Adarsh-k0802

    Hi @jcflack , my postgre is not built with MSVC, i am using mingw32, Apache Maven 3.9.9, postgres 16, java 21 & pljava v 1.6.8, But still facing the same issue.
    image
    image
    image
    image
    image
    Can you please help me to resolve this as i am unable to create a build of pljava

  15. Adarsh-k0802 commented on Oct 22, 2024

    @Adarsh-k0802

    e

    Hi , Can you help me with this I am facing the same issue. How you have resolved this issue?

  16. jcflack commented on Oct 22, 2024

    @jcflack
    Contributor

    @Adarsh-k0802, maybe open a new issue? This issue is closed, and yours is not the same.

    This issue involved the build system not detecting what build rules to use.

    Your screenshot shows a simple conflict. You have Maven's environment set up so that a MinGW build is selected. However, the pg_config found on the PATH (or specified on the mvn command line, if you did that) definitely refers to a PostgreSQL that was built with MSVC. (The quoted version string shown comes straight from the version of PostgreSQL that is installed, so what it says is true.)

    If there is also a PostgreSQL built with MinGW installed on your system, all you need to do is adjust your PATH (or use a -Dpgsql.pgconfig= option on the mvn command line) to make sure that the MinGW-built PostgreSQL is the one that will be found for the build.

  17. Adarsh-k0802 commented on Oct 22, 2024

    @Adarsh-k0802

    Hi @jcflack , I have resolved that issue. Now I am facing a new issue at the time of installation when I run "CREATE EXTENSION pljava;" it's showing access is denied.

  18. jcflack commented on Oct 22, 2024

    @jcflack
    Contributor

    Hi @Adarsh-k0802,

    Again, if you don't find a solution, that would warrant opening a new issue. It would not be related to this one at all.

    If you do open a new issue, please be sure to include the full error output.

    It is often more helpful to copy/paste the text than to post screenshots. For example, others can more easily find a relevant issue using a search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions