Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/remove continuations plugin support #617

Merged

Conversation

dotta
Copy link
Member

@dotta dotta commented Jan 6, 2014

Removed special support for Scala continuations

The Scala IDE used to package the continuations plug-in to match the Scala
distribution. While this conveniency was appreciated by the few using
continuations in their projects, it imposed a technical debt on the Scala IDE
codebase (have a look at how the compiler Settings used to be instantiated).

Recently, the continuations plug-in has been refactored and splitted into two
separate JARs (a compiler plug-in, and a library). After this modularization,
the Scala IDE codebase could no longer be compiled inside Eclipse because the
continuations library isn't included in the project's classpath. Of course, we
could implement a workaround to restore the functionality, but it just doesn't
seem worth the time, considering the Scala Team has deprecated the
continuations plug-in and will effectively drop supporting it the moment 2.12
is released. Hence, the decision of dropping the out-of-the-box support in the
Scala IDE.

From now on, if you want to use continutions in a project, you will have to
provide the location of the continuations JAR via the -Xplugins setting.

Finally, a couple of tests exercicing the behavior of both the presentation
compiler and the build compiler when compiling a sourcefile that requires the
continuations plug-in are now executed only for Scala 2.11 or later. This is
needed because the continuations.jar is no longer loaded when starting the
compiler inside Eclipse, and that turns out to affect semantic of programs
using continuations in Scala 2.10, because the compiler does no longer report
an error if a source file (requiring continuations) is compiled without passing
the flag to enable the plugin. Why? Because up until Scala 2.10 the compilation
error is reported by the continuations.jar (!!). Of course, that error cannot
be reported if the continuations.jar isn't available anymore (which is the
whole point of this commit). The behavior with Scala 2.11 is different because
the continuations library has been moved out of the scala library (see
scala/scala@858a5d5),
and hence a compilation error is reported whenever a source is compiled without
the continuations library in the classpath. That explains why the tests are now
only executed on 2.11+.

This commit undos all changes related to supporting continuations made by
@adriaanm in #604

Fix #1002012
Fix #1002011

@ghprb-bot
Copy link

Test FAILed.
Refer to this link for build results: https://jenkins.scala-ide.org:8496/jenkins/job/ghprb-scala-ide-validator/468/

@ghprb-bot
Copy link

Test FAILed.
Refer to this link for build results: https://jenkins.scala-ide.org:8496/jenkins/job/ghprb-scala-ide-validator/469/

@adriaanm
Copy link
Contributor

adriaanm commented Jan 6, 2014

Thanks, @dotta!

@ghprb-bot
Copy link

Test PASSed.
Refer to this link for build results: https://jenkins.scala-ide.org:8496/jenkins/job/ghprb-scala-ide-validator/470/

@ghprb-bot
Copy link

Test PASSed.
Refer to this link for build results: https://jenkins.scala-ide.org:8496/jenkins/job/ghprb-scala-ide-validator/471/

@dotta
Copy link
Member Author

dotta commented Jan 7, 2014

@hseeberger This PR may be of interest for sbt-eclipse, as we are changing the way we handle the scalac -XpluginsDir setting. In short, we no longer override its value. Hence, if it isn't set, the continuations.jar isn't in the project's classpath. My guess is that you no longer need this hack after this PR is merged, but there may be other side-effects. Last but not least, this change is only going to affect the next Scala IDE 4.0.0 release.

val source = scalaCompilationUnit("cps/CPS.scala")
openAndWaitUntilTypechecked(source)
assertTrue(Option(source.getProblems).toList.nonEmpty)
}

@Test
def failingToBuildSourceThatRequiresContinuationPlugin() {
def failingToBuildSourceThatRequiresContinuationPlugin() = runIfInstalledScalaVersionGreaterOrEquals(SCALA_2_11_0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need this test. It looks to me we are simply testing scalac behaviour. Is there anything on our side that's involved here, other than the ability to build an existing project?

@dragos
Copy link
Member

dragos commented Jan 7, 2014

Great to see all this code going away! One of the dark corners of the IDE is now a little brighter!

@dotta
Copy link
Member Author

dotta commented Jan 8, 2014

@dragos @sschaef I agree with all the comments you guys made. Thanks a ton for the great review, will soon push a new commit with the required changes.

Pushed up `libraryEntries` method so that it can be used by the two subclasses
of `ScalaClasspathContainerInitializer`
@dotta
Copy link
Member Author

dotta commented Jan 8, 2014

Actually, there is some more clean-up I can do in the test. Hold your thumb (up) a little longer ;-)

@ghprb-bot
Copy link

Test PASSed.
Refer to this link for build results: https://jenkins.scala-ide.org:8496/jenkins/job/ghprb-scala-ide-validator/472/

@dragos
Copy link
Member

dragos commented Jan 8, 2014

LGTM

@ghprb-bot
Copy link

Test PASSed.
Refer to this link for build results: https://jenkins.scala-ide.org:8496/jenkins/job/ghprb-scala-ide-validator/473/

The Scala IDE used to package the continuations plug-in to match the Scala
distribution.  While this conveniency was appreciated by the few using
continuations in their projects, it imposed a technical debt on the Scala IDE
codebase (have a look at how the compiler `Settings` used to be instantiated).

Recently, the continuations plug-in has been refactored and splitted into two
separate JARs (a compiler plug-in, and a library). After this modularization,
the Scala IDE codebase could no longer be compiled inside Eclipse because the
continuations library isn't included in the project's classpath. Of course, we
could implement a workaround to restore the functionality, but it just doesn't
seem worth the time, considering the Scala Team has deprecated the
continuations plug-in and will effectively drop supporting it the moment 2.12
is released.  Hence, the decision of dropping the out-of-the-box support in the
Scala IDE.

From now on, if you want to use continutions in a project, you will have to
provide the location of the continuations JAR via the -Xplugins setting.

Finally, a couple of tests exercicing the behavior of both the presentation
compiler and the build compiler when compiling a sourcefile that requires the
continuations plug-in are now executed only for Scala 2.11 or later. This is
needed because the continuations.jar is no longer loaded when starting the
compiler inside Eclipse, and that turns out to affect semantic of programs
using continuations in Scala 2.10, because the compiler does no longer report
an error if a source file (requiring continuations) is compiled without passing
the flag to enable the plugin. Why? Because up until Scala 2.10 the compilation
error is reported by the continuations.jar (!!). Of course, that error cannot
be reported if the continuations.jar isn't available anymore (which is the
whole point of this commit).  The behavior with Scala 2.11 is different because
the continuations library has been moved out of the scala library (see
scala/scala@858a5d5),
and hence a compilation error is reported whenever a source is compiled without
the continuations library in the classpath. That explains why the tests are now
only executed on 2.11+.

This commit undos all changes related to supporting continuations made by
@adriaanm in scala-ide#604

Fix #1002012
Fix #1002011
@dotta
Copy link
Member Author

dotta commented Jan 8, 2014

@dragos Thanks! I've squashed the commits and will merge this PR the moment I get a green status from the buildbot.

@ghprb-bot
Copy link

Test PASSed.
Refer to this link for build results: https://jenkins.scala-ide.org:8496/jenkins/job/ghprb-scala-ide-validator/475/

dotta added a commit that referenced this pull request Jan 8, 2014
…support

Issue/remove continuations plugin support
@dotta dotta merged commit 4abf98c into scala-ide:master Jan 8, 2014
@dotta dotta deleted the issue/remove-continuations-plugin-support branch January 8, 2014 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants