vectorpipe icon indicating copy to clipboard operation
vectorpipe copied to clipboard

Move to Scala 2.12

Open jpolchlo opened this issue 4 years ago • 2 comments

Overview

This PR updates the scala version to 2.12 and any required dependencies to enable this upgrade.

Checklist

  • [x] Add entry to CHANGELOG.md

jpolchlo avatar Dec 17 '21 20:12 jpolchlo

CircleCI was fighting me on this. I believe it was failing to properly load paradise macros, and giving a misleading compiler error as a result:

[error] argument expression's type is not compatible with formal parameter type;
[error]  found   : java.util.function.Function[String,Map[String,vectorpipe.sources.AugmentedDiffSource.RF]]
[error]     (which expands to)  java.util.function.Function[String,Map[String,vectorpipe.util.RobustFeature[org.locationtech.jts.geom.Geometry,vectorpipe.model.ElementWithSequence]]]
[error]  required: java.util.function.Function[_ >: String, _ <: ?R]
[error] Note: String <: Any, but Java-defined trait Function is invariant in type T.
[error] You may wish to investigate a wildcard type such as `_ <: Any`. (SLS 3.2.10)
[error]         .map { line =>
[error]          ^
[error] /home/circleci/project/src/main/scala/vectorpipe/sources/AugmentedDiffSource.scala:67:21: type mismatch;
[error]  found   : java.util.function.Function[String,Map[String,vectorpipe.sources.AugmentedDiffSource.RF]]
[error]     (which expands to)  java.util.function.Function[String,Map[String,vectorpipe.util.RobustFeature[org.locationtech.jts.geom.Geometry,vectorpipe.model.ElementWithSequence]]]
[error]  required: java.util.function.Function[_ >: String, _ <: R]
[error]         .map { line =>
[error]                     ^
[error] /home/circleci/project/src/main/scala/vectorpipe/sources/AugmentedDiffSource.scala:74:10: value toSeq is not a member of java.util.stream.Stream[R]
[error] possible cause: maybe a semicolon is missing before `value toSeq'?
[error]         .toSeq
[error]          ^

However, I could not reproduce the error anywhere else, and paradise macros were included properly. (I later discovered these same errors while trying to streamline the build.sbt after removing paradise.)

It may have been possible to make circle work, but I opted to move to Github actions for CI and deployment, following the template provided by locationtech/geotrellis#3440. The setup is similar to Circle, and doesn't require integration with an external service.

jpolchlo avatar Dec 21 '21 19:12 jpolchlo

I believe that this PR is stalled for the moment because moving to GT 3.7 is going to require an upgrade to Spark 3, which means that the data sources will need to be updated to use the V3 spark SQL data source API. This will require some amount of fuss, which we don't have time for at the moment.

jpolchlo avatar Jan 10 '22 19:01 jpolchlo