romaintailhurat / darkr

R API for the Trevas VTL engine :8ball:
MIT License
0 stars 1 forks source link

Java dependency mismatch when releasing on R-hub #5

Open romaintailhurat opened 4 years ago

romaintailhurat commented 4 years ago

Before pushing to CRAN, i use R-hub as is advised.

When doing so, the tests are in error because the provided JVM is not adapted to the version used to compile classes:

* checking tests ...
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:

  ── 6. Error: Instantiate InMemoryDataset (@test-java_utils.R#2)  ───────────────
  java.lang.UnsupportedClassVersionfr/insee/vtl/model/Dataset has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 0 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 6 ]
  1. Error: Creating a list of components from a dataframe (@test-dataset.R#3) 
  2. Error: Can create a list of data from a df (@test-dataset.R#10) 
  3. Error: Can create a dataset from a dataframe (@test-dataset.R#17) 
  4. Error: Evaluation is done right (@test-evaluation.R#5) 
  5. Error: Datasets, drop operation (@test-evaluation.R#11) 
  6. Error: Instantiate InMemoryDataset (@test-java_utils.R#2) 

  Error: testthat unit tests failed
  Execution halted

This easiest solution would be to recompile the classes with Java 8 (52), see the list of java versions.

Another more complex option would be to see if another runtime can be used with R-hub and CRAN.

romaintailhurat commented 4 years ago

Java 11+ seems required as it allows modularization.

romaintailhurat commented 4 years ago

Today, on R-hub, at least one build ok: https://builder.r-hub.io/status/darkr_0.2.0.tar.gz-9bee1d706df34a2dbfb19e4276a66de7

romaintailhurat commented 4 years ago

But, it didn't built on Windows:

  -- ERROR (test-java_utils.R:2:3): Instantiate InMemoryDataset ------------------
  Error: java.lang.UnsupportedClassVersionError: fr/insee/vtl/model/Dataset has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

See: https://win-builder.r-project.org/hQ3JHyYHce9W

romaintailhurat commented 4 years ago

I sent a mail to the CRAN to discuss the problem.

romaintailhurat commented 4 years ago

The problem is the same using GitHub actions, see https://github.com/romaintailhurat/darkr/actions/runs/304692453