scalap.jar incompatibility with 2.8.0 when building Scala plugin

I just came across what looks like a bug in the Scala plugin build.xml.
I was getting this error when building the plugin on a new machine:

   [scalac] C:\Users\chilang\code\scala-plugin\src\org\jetbrains\plugins\scala\decompiler\DecompilerUtil.scala:134: error: type mismatch;
   [scalac]  found   : scala.tools.scalap.scalax.rules.scalasig.HideInstancePrivate.type (with underlying type object scala.tools.scalap.scalax.rules.scalasig.HideInstancePrivate)
   [scalac]  required: Boolean
   [scalac]       val printer = new ScalaSigPrinter(stream, HideInstancePrivate)
   [scalac]                                                 ^
   [scalac] one error found



I was a bit baffled as I was getting the build fine with pretty much the same config/sources.
It turned out that Scala plugin is using a different version of scalap.jar (bundled with its sources under \SDK\scalap\scalap.jar) instead of the jar coming from scala distribution (specified via scala.properties, I was using 2.8.0.final).
The build.xml is a bit naughty as it is copying its version of scalap.jar into scala distribution lib folder unless it sees a newer version, i.e.:

make.project:
     [copy] scalap.jar omitted as c:\apps\scala-2.8.0.final\lib\scalap.jar is up to date.


The results is that both version scalap.jar ends up in the build classpath and in certain path combination (when you scala distribution scalap.jar path ended up before the bundled scalap.jar), the build will fail as above.

Attached is a patch to build.xml which fix this problem by excluding scalap.jar from scala distribution and explicitly including the bundled one.

Hope this helps,
Chi Lang


Attachment(s):
fix_scalap_jar_incompatibility.patch.zip
0

Thank you for patch, of course it's better then move scalap from one folder to another.

Best regards,
Alexander Podkhalyuzin.

0

请先登录再写评论。