[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Scala error when trying to build latest version of pilon



Hi Andreas,

Le 09/09/2021 à 08:31, Andreas Tille a écrit :
Hi Pierre (and others)

when trying to build the latest version of pilon[1] I get:

...
scalac -classpath /usr/share/java/htsjdk.jar -d pilon.jar src/main/scala/org/broadinstitute/pilon/*
src/main/scala/org/broadinstitute/pilon/BamFile.scala:24: error: object jdk is not a member of package scala
import scala.jdk.CollectionConverters._
              ^
src/main/scala/org/broadinstitute/pilon/BamFile.scala:65: error: value asScala is not a member of java.util.List[htsjdk.samtools.SAMSequenceRecord]
     val seqs = r.getFileHeader.getSequenceDictionary.getSequences.asScala
                                                                   ^
src/main/scala/org/broadinstitute/pilon/BamFile.scala:96: error: value asScala is not a member of htsjdk.samtools.SAMRecordIterator
     val reads = r.queryUnmapped.asScala.filter(validateRead(_)).toList
                                 ^
src/main/scala/org/broadinstitute/pilon/BamFile.scala:119: error: value asScala is not a member of htsjdk.samtools.SAMRecordIterator
possible cause: maybe a semicolon is missing before `value asScala'?
       (region.start-10000) max 0, (region.stop+10000) min region.contig.length).asScala
                                                                                 ^
src/main/scala/org/broadinstitute/pilon/PileUpRegion.scala:22: error: object jdk is not a member of package scala
import scala.jdk.CollectionConverters._
              ^
src/main/scala/org/broadinstitute/pilon/BamFile.scala:297: error: value asScala is not a member of htsjdk.samtools.SAMRecordIterator
     for (read <- r.iterator.asScala) {
                             ^
src/main/scala/org/broadinstitute/pilon/BamFile.scala:341: error: value asScala is not a member of htsjdk.samtools.SAMRecordIterator
     val reads = r.queryOverlapping(region.name, region.start, region.stop).asScala.filter(validateRead(_)).toList
                                                                            ^
src/main/scala/org/broadinstitute/pilon/Scaffold.scala:31: error: object jdk is not a member of package scala
import scala.jdk.CollectionConverters._
              ^
src/main/scala/org/broadinstitute/pilon/PileUpRegion.scala:136: error: value asScala is not a member of java.util.List[htsjdk.samtools.CigarElement]
     val cigarElements = cigar.getCigarElements.asScala
                                                ^
src/main/scala/org/broadinstitute/pilon/Scaffold.scala:351: error: value asScala is not a member of htsjdk.samtools.SAMRecordIterator
     for (read <- reader.iterator.asScala if (!read.getReadUnmappedFlag)) {
                                  ^
10 errors found
make[1]: *** [debian/rules:10: override_dh_auto_build] Fehler 1


Unfortunately this is because upstream has just begun using Scala files from Scala 2.13.* (typically, the scala.jdk package) whereas we only have Scala 2.11 in Debian. If I remember correctly, the main blocker with Scala 2.12 or more is we need sbt [2], which needs Scala 2.12... I should have a look again, but it seems we will have to do some bootstrap at some point.


Any hint how to fix this?

Well, /maybe/ we could patch this last pilon version to use Scala 2.11 with it... but I see there were quite a lot of changed in pilon seemingly related to newer Scala [3,4], so I am unsure we would succeed. Anyway, for sure the right thing would be to upgrade Scala.

This is one thing I would like to do and discuss with the Java team, will try to do it quite soon...


Kind regards

        Andreas.


[1] https://salsa.debian.org/med-team/pilon


Best regards,
Pierre


[2] https://tracker.debian.org/pkg/sbt
[3] https://github.com/broadinstitute/pilon/commit/74371e9e62b0d51f3273935a88e30f92208bd91e [4] https://github.com/broadinstitute/pilon/commit/9d55013cedae575f141ff74415cc577ce2c7900a


Reply to: