Materials-Consortia / OPTIMADE

Specification of a common REST API for access to materials databases
https://optimade.org/specification
Creative Commons Attribution 4.0 International
83 stars 37 forks source link

'make' fails on Ubuntu 18.04 and 20.04 #379

Closed merkys closed 2 years ago

merkys commented 3 years ago

I am trying to run specification tests for v1.1.0 on Ubuntu 18.04 and 20.04, but they seem to fail due to building problems of Grammatica:

+ cd grammatica-1.6
+ ant -k
Buildfile: /home/andrius/optimade/specification/tests/tools/grammatica-1.6/build.xml

codegen:

compile-clean:
    [mkdir] Created dir: /home/andrius/optimade/specification/tests/tools/grammatica-1.6/classes

compile-java:
    [javac] Compiling 96 source files to /home/andrius/optimade/specification/tests/tools/grammatica-1.6/classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.4
    [javac] error: Source option 1.4 is no longer supported. Use 6 or later.
    [javac] error: Target option 1.5 is no longer supported. Use 1.6 or later.
Target 'compile-java' failed with message 'Compile failed; see the compiler error output for details.'.
Target 'codegen' failed with message 'The following error occurred while executing this line:
/home/andrius/optimade/specification/tests/tools/grammatica-1.6/build.xml:76: Compile failed; see the compiler error output for details.'.

[snip]

BUILD FAILED
/home/andrius/optimade/specification/tests/tools/grammatica-1.6/build.xml:36: The following error occurred while executing this line:
/home/andrius/optimade/specification/tests/tools/grammatica-1.6/build.xml:76: Compile failed; see the compiler error output for details.

After that, all tests fail due to missing JAR. Pinging @sauliusg and @rartino.

By the way, starting with Ubuntu 20.04, Grammatica appears in standard Ubuntu repositories as libgrammatica-java.

merkys commented 3 years ago

I managed to get around this by patching Grammatica's build.xml to set both source and target versions to 1.6 for javac. GitHub runner seemingly uses newer OpenJDK which auto-updates versions to 1.6 for javac.

I suggest us patching Grammatica's build.xml during make execution. This way specification tests will work on Ubuntu 18.04 and 20.04.