problems with continuations plugin and scala 2.8.0

28 views
Skip to first unread message

steffen...@googlemail.com

unread,
Sep 5, 2010, 7:42:07 AM9/5/10
to simple-build-tool
Hello,

I've problems my running code using continuations when compiled with
sbt.

My sbt configuations file is:

import sbt._

class MyProject(info:ProjectInfo) extends DefaultProject(info)
with AutoCompilerPlugins {

val scalazCore = "com.googlecode.scalaz" %% "scalaz-core" %
"5.0"

val cont = compilerPlugin("org.scala-lang.plugins" %
"continuations" % "2.8.0")
override def compileOptions =
super.compileOptions ++ compileOptions("-
P:continuations:enable")
}

compilation works fine, but when I start the console via sbt after a
short moment the following error is printed to console:

error: bad option: -P:continuations:enable

Afterwards I have to force quite the console.

But if I try to run my compiled code using the standard
scala REPL (scala -cp <correct classpaths> -P:continuations:enable)
I get a slightly disturbing backtrace telling me about the shift
function can not be found:

java.lang.NoSuchMethodError: scala.util.continuations.package
$.shift(Lscala/Function1;)Ljava/lang/Object;

I use scala-2.8.0, sbt-0.7.4 and configured sbt to use scala-2.8.0 for
my project.

Any ideas?

thanks!

Mark Harrah

unread,
Sep 8, 2010, 9:38:46 PM9/8/10
to simple-b...@googlegroups.com
On Sunday, September 05, 2010, steffen...@gmail.com wrote:
> Hello,
>
> I've problems my running code using continuations when compiled with
> sbt.
>
> My sbt configuations file is:
>
> import sbt._
>
> class MyProject(info:ProjectInfo) extends DefaultProject(info)
> with AutoCompilerPlugins {
>
> val scalazCore = "com.googlecode.scalaz" %% "scalaz-core" %
> "5.0"
>
> val cont = compilerPlugin("org.scala-lang.plugins" %
> "continuations" % "2.8.0")
> override def compileOptions =
> super.compileOptions ++ compileOptions("-
> P:continuations:enable")
> }
>
> compilation works fine, but when I start the console via sbt after a
> short moment the following error is printed to console:
>
> error: bad option: -P:continuations:enable
>
> Afterwards I have to force quite the console.

According to [1], this was a problem in sbt 0.7.3 but should be fixed in 0.7.4. Can you provide a sample project?

> But if I try to run my compiled code using the standard
> scala REPL (scala -cp <correct classpaths> -P:continuations:enable)
> I get a slightly disturbing backtrace telling me about the shift
> function can not be found:
>
> java.lang.NoSuchMethodError: scala.util.continuations.package
> $.shift(Lscala/Function1;)Ljava/lang/Object;

As far as I can tell, this does not appear to be related to sbt. As a guess, you might have a Scala version mismatch between your project and your 'scala' command. Does your code work when executed with 'sbt run'?

-Mark

[1] http://groups.google.com/group/simple-build-tool/browse_thread/thread/523fbbce5f67ddfe

steffen

unread,
Sep 9, 2010, 6:09:18 AM9/9/10
to simple-build-tool
Thanks, but it is kinda fixed now and I can not reproduce the problem
anymore.
I haven't had problems with mixed up scala versions. I even compared
the sha1 hash values of all the libraries and compiler jars.

What I did to fix this was, I've deleted the directories "project/
boot", "project/build/target", "target" and "lib_managed".
Then when compiling via sbt again it did work.

The difference was, that this time the continuations plugin
"continuations-2.8.0.jar" was downloaded, which did not happen
before.
For any reason, it did even compile without that plugin. But now, if I
delete "continuations-2.8.0.jar" sbt can not compile my program
anymore...

A very simple project can be found at: http://github.com/urso/embeddedmonads

- Steffen


On 9 Sep., 03:38, Mark Harrah <dmhar...@gmail.com> wrote:
> [1]http://groups.google.com/group/simple-build-tool/browse_thread/thread...
Reply all
Reply to author
Forward
0 new messages