Cannot enable continuations plugin with Scala 2.10
In Scala 2.10 the continuations plugin needs to be explicitly enabled by passing the option `-P:continuations:enable`. However, passing this option in the Scala IDE does not work: bad option: -P:continuations:enable.
The workaround is to pass the location of the continuations.jar plugin in Xplugin.This can be easily done by appending `continuations.jar` to the the default path set for Xpluginsdir.
For instance, in my installation I have:
P: continuations:enable
Xpluginsdir: /Users/mirco/Desktop/eclipse/configuration/org.eclipse.osgi/bundles/203/1/.cp/lib
Xplugin: /Users/mirco/Desktop/eclipse/configuration/org.eclipse.osgi/bundles/203/1/.cp/lib/continuations.jar
And I'm able to compile with CPS enabled.
The workaround is to pass the location of the continuations.jar plugin in Xplugin.This can be easily done by appending `continuations.jar` to the the default path set for Xpluginsdir.
For instance, in my installation I have:
P: continuations:enable
Xpluginsdir: /Users/mirco/Desktop/eclipse/configuration/org.eclipse.osgi/bundles/203/1/.cp/lib
Xplugin: /Users/mirco/Desktop/eclipse/configuration/org.eclipse.osgi/bundles/203/1/.cp/lib/continuations.jar
And I'm able to compile with CPS enabled.
Leave a comment
on 2012-05-18 10:03 *
By Mirco Dotta
Assigned to set to Mirco Dotta
Component changed from None to Scala 2.10 support
Milestone set to Helium M2
on 2012-07-30 14:04 *
By Mirco Dotta
Eclipse version changed from Indigo to All
Milestone changed from Helium M2 to Helium
on 2012-12-05 09:59 *
By Iulian Dragos
Beside the related ticket, there's another factor at play:
The `-Xpluginsdir` default value is calculated once, when the user clicks `Use Project Settings`, or when the user empties the field. However, that path is "volatile", since it depends on where Eclipse extracts the `continuations.jar`, and that may change between runs, or when the Scala IDE is upgraded, uninstalled, etc. We should investigate using a better default value that does not depend on UI actions.
The `-Xpluginsdir` default value is calculated once, when the user clicks `Use Project Settings`, or when the user empties the field. However, that path is "volatile", since it depends on where Eclipse extracts the `continuations.jar`, and that may change between runs, or when the Scala IDE is upgraded, uninstalled, etc. We should investigate using a better default value that does not depend on UI actions.
(In scala-ide:aa2ecb9dd0fefc08ab540158e976b7a9c219843b) Do not force default location of -XpluginsDir in Scala Compiler Preferences
Trying to force the default location to the plugins directory containing the
continuations.jar plugin turned out to be a very bad idea (this was done as
part of commit SHA-cbfd82d874f998b7726fec895ad4d83194ad1e5b).
The issue is that the default location where the continuations.jar is stored
changes each time a user updates the Scala IDE and, when updating, the
former location is deleted. The net effect of this is that after upgrading,
all projects using the continuations plugin would report the following error
`bad option: -P:continuations:enable` is reported
Simply because the continuations.jar can no longer be located.
The fix is to somewhat restore the former implementation wrt how we handle the
`-Xpluginsdir` compiler setting. Basically, the solution consists in not
showing the default value of `-Xpluginsdir` to the user in the Preferences
dialog, and pass this default to the different compiler instance we create
unless the user specifices a different location (in which case, we do use the
location provided by the user).
There is one more catch due to the current way `ScalaProject.scalacArguments`
is implemented (the method is used to pass the compiler arguments to the Sbt
builder). In short, the returned arguments are only the ones forces by the user
via the Preference dialog. Since the `-Xpluginsdir` default directory is
**not** shown in the Preference dialog, the Sbt builder would fail to compiler
projects with continuations enabled because it wouldn't know where to look for
the continuations.jar. Hence, I had to add some ad-hoc code to handle this
correctly in `ScalaProject.scalacArguments`.
This whole fix is far from ideal, but I want to keep the changeset as small as
possible to avoid regressions, since this commit should be included in the
upcoming 3.0.0 release.
By the way, all existing projects that were affected by the error should
restore the defaults (Preferences > Scala > Compiler and hit the Restore
Defaults button).
Fixes #1001030, #1000700
Branch: master
Trying to force the default location to the plugins directory containing the
continuations.jar plugin turned out to be a very bad idea (this was done as
part of commit SHA-cbfd82d874f998b7726fec895ad4d83194ad1e5b).
The issue is that the default location where the continuations.jar is stored
changes each time a user updates the Scala IDE and, when updating, the
former location is deleted. The net effect of this is that after upgrading,
all projects using the continuations plugin would report the following error
`bad option: -P:continuations:enable` is reported
Simply because the continuations.jar can no longer be located.
The fix is to somewhat restore the former implementation wrt how we handle the
`-Xpluginsdir` compiler setting. Basically, the solution consists in not
showing the default value of `-Xpluginsdir` to the user in the Preferences
dialog, and pass this default to the different compiler instance we create
unless the user specifices a different location (in which case, we do use the
location provided by the user).
There is one more catch due to the current way `ScalaProject.scalacArguments`
is implemented (the method is used to pass the compiler arguments to the Sbt
builder). In short, the returned arguments are only the ones forces by the user
via the Preference dialog. Since the `-Xpluginsdir` default directory is
**not** shown in the Preference dialog, the Sbt builder would fail to compiler
projects with continuations enabled because it wouldn't know where to look for
the continuations.jar. Hence, I had to add some ad-hoc code to handle this
correctly in `ScalaProject.scalacArguments`.
This whole fix is far from ideal, but I want to keep the changeset as small as
possible to avoid regressions, since this commit should be included in the
upcoming 3.0.0 release.
By the way, all existing projects that were affected by the error should
restore the defaults (Preferences > Scala > Compiler and hit the Restore
Defaults button).
Fixes #1001030, #1000700
Branch: master
on 2013-02-25 17:40 *
By Mirco Dotta
(In scala-ide:36d0fcc4c16b01ba982d6c03b341d6d8611efc6f) Do not force default location of -XpluginsDir in Scala Compiler Preferences
Trying to force the default location to the plugins directory containing the
continuations.jar plugin turned out to be a very bad idea (this was done as
part of commit SHA-cbfd82d874f998b7726fec895ad4d83194ad1e5b).
The issue is that the default location where the continuations.jar is stored
changes each time a user updates the Scala IDE and, when updating, the
former location is deleted. The net effect of this is that after upgrading,
all projects using the continuations plugin would report the following error
`bad option: -P:continuations:enable` is reported
Simply because the continuations.jar can no longer be located.
The fix is to somewhat restore the former implementation wrt how we handle the
`-Xpluginsdir` compiler setting. Basically, the solution consists in not
showing the default value of `-Xpluginsdir` to the user in the Preferences
dialog, and pass this default to the different compiler instance we create
unless the user specifices a different location (in which case, we do use the
location provided by the user).
There is one more catch due to the current way `ScalaProject.scalacArguments`
is implemented (the method is used to pass the compiler arguments to the Sbt
builder). In short, the returned arguments are only the ones forces by the user
via the Preference dialog. Since the `-Xpluginsdir` default directory is
**not** shown in the Preference dialog, the Sbt builder would fail to compiler
projects with continuations enabled because it wouldn't know where to look for
the continuations.jar. Hence, I had to add some ad-hoc code to handle this
correctly in `ScalaProject.scalacArguments`.
This whole fix is far from ideal, but I want to keep the changeset as small as
possible to avoid regressions, since this commit should be included in the
upcoming 3.0.0 release.
By the way, all existing projects that were affected by the error should
restore the defaults (Preferences > Scala > Compiler and hit the Restore
Defaults button).
Fixes #1001030, #1000700
(cherry picked from commit aa2ecb9dd0fefc08ab540158e976b7a9c219843b)
Branch: release/scala-ide-3.0.x
Trying to force the default location to the plugins directory containing the
continuations.jar plugin turned out to be a very bad idea (this was done as
part of commit SHA-cbfd82d874f998b7726fec895ad4d83194ad1e5b).
The issue is that the default location where the continuations.jar is stored
changes each time a user updates the Scala IDE and, when updating, the
former location is deleted. The net effect of this is that after upgrading,
all projects using the continuations plugin would report the following error
`bad option: -P:continuations:enable` is reported
Simply because the continuations.jar can no longer be located.
The fix is to somewhat restore the former implementation wrt how we handle the
`-Xpluginsdir` compiler setting. Basically, the solution consists in not
showing the default value of `-Xpluginsdir` to the user in the Preferences
dialog, and pass this default to the different compiler instance we create
unless the user specifices a different location (in which case, we do use the
location provided by the user).
There is one more catch due to the current way `ScalaProject.scalacArguments`
is implemented (the method is used to pass the compiler arguments to the Sbt
builder). In short, the returned arguments are only the ones forces by the user
via the Preference dialog. Since the `-Xpluginsdir` default directory is
**not** shown in the Preference dialog, the Sbt builder would fail to compiler
projects with continuations enabled because it wouldn't know where to look for
the continuations.jar. Hence, I had to add some ad-hoc code to handle this
correctly in `ScalaProject.scalacArguments`.
This whole fix is far from ideal, but I want to keep the changeset as small as
possible to avoid regressions, since this commit should be included in the
upcoming 3.0.0 release.
By the way, all existing projects that were affected by the error should
restore the defaults (Preferences > Scala > Compiler and hit the Restore
Defaults button).
Fixes #1001030, #1000700
(cherry picked from commit aa2ecb9dd0fefc08ab540158e976b7a9c219843b)
Branch: release/scala-ide-3.0.x
on 2013-06-05 08:55 *
By Mirco Dotta
(In scala-ide:aa2ecb9dd0fefc08ab540158e976b7a9c219843b) Do not force default location of -XpluginsDir in Scala Compiler Preferences
Trying to force the default location to the plugins directory containing the
continuations.jar plugin turned out to be a very bad idea (this was done as
part of commit SHA-cbfd82d874f998b7726fec895ad4d83194ad1e5b).
The issue is that the default location where the continuations.jar is stored
changes each time a user updates the Scala IDE and, when updating, the
former location is deleted. The net effect of this is that after upgrading,
all projects using the continuations plugin would report the following error
`bad option: -P:continuations:enable` is reported
Simply because the continuations.jar can no longer be located.
The fix is to somewhat restore the former implementation wrt how we handle the
`-Xpluginsdir` compiler setting. Basically, the solution consists in not
showing the default value of `-Xpluginsdir` to the user in the Preferences
dialog, and pass this default to the different compiler instance we create
unless the user specifices a different location (in which case, we do use the
location provided by the user).
There is one more catch due to the current way `ScalaProject.scalacArguments`
is implemented (the method is used to pass the compiler arguments to the Sbt
builder). In short, the returned arguments are only the ones forces by the user
via the Preference dialog. Since the `-Xpluginsdir` default directory is
**not** shown in the Preference dialog, the Sbt builder would fail to compiler
projects with continuations enabled because it wouldn't know where to look for
the continuations.jar. Hence, I had to add some ad-hoc code to handle this
correctly in `ScalaProject.scalacArguments`.
This whole fix is far from ideal, but I want to keep the changeset as small as
possible to avoid regressions, since this commit should be included in the
upcoming 3.0.0 release.
By the way, all existing projects that were affected by the error should
restore the defaults (Preferences > Scala > Compiler and hit the Restore
Defaults button).
Fixes #1001030, #1000700
Branch: platform/juno
Trying to force the default location to the plugins directory containing the
continuations.jar plugin turned out to be a very bad idea (this was done as
part of commit SHA-cbfd82d874f998b7726fec895ad4d83194ad1e5b).
The issue is that the default location where the continuations.jar is stored
changes each time a user updates the Scala IDE and, when updating, the
former location is deleted. The net effect of this is that after upgrading,
all projects using the continuations plugin would report the following error
`bad option: -P:continuations:enable` is reported
Simply because the continuations.jar can no longer be located.
The fix is to somewhat restore the former implementation wrt how we handle the
`-Xpluginsdir` compiler setting. Basically, the solution consists in not
showing the default value of `-Xpluginsdir` to the user in the Preferences
dialog, and pass this default to the different compiler instance we create
unless the user specifices a different location (in which case, we do use the
location provided by the user).
There is one more catch due to the current way `ScalaProject.scalacArguments`
is implemented (the method is used to pass the compiler arguments to the Sbt
builder). In short, the returned arguments are only the ones forces by the user
via the Preference dialog. Since the `-Xpluginsdir` default directory is
**not** shown in the Preference dialog, the Sbt builder would fail to compiler
projects with continuations enabled because it wouldn't know where to look for
the continuations.jar. Hence, I had to add some ad-hoc code to handle this
correctly in `ScalaProject.scalacArguments`.
This whole fix is far from ideal, but I want to keep the changeset as small as
possible to avoid regressions, since this commit should be included in the
upcoming 3.0.0 release.
By the way, all existing projects that were affected by the error should
restore the defaults (Preferences > Scala > Compiler and hit the Restore
Defaults button).
Fixes #1001030, #1000700
Branch: platform/juno
on 2013-06-07 12:48 *
By Iulian Dragos
Fixed in version changed from 3.0.0-RC1 to -none-
Version changed from 2.1.0-M1-210 to 3.0.0-210
Milestone changed from Current to Helium