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

typechecker blowup while editing a file that imports scoobi definitions #9192

Open
scabug opened this issue Feb 28, 2015 · 6 comments
Open
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 28, 2015

A Scala IDE user reported a compiler blowup, which makes the IDE unusable: https://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1002389?comment=695983983#/activity/ticket:

I managed to minimize the problem far enough to reproduce it on the commandline, see instructions here: https://github.com/sschaef/scoobi-blowup

Looking at the output of svelto (https://github.com/dragos/svelto), it seems that the compiler is doing too much work in the typechecker.

@scabug
Copy link
Author

scabug commented Feb 28, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9192?orig=1
Reporter: @sschaef
Affected Versions: 2.11.5, 2.11.6

@scabug
Copy link
Author

scabug commented Feb 28, 2015

@retronym said (edited on Feb 28, 2015 2:02:20 AM UTC):
Here's a smaller minimization:

object X {
  implicitly[com.nicta.scoobi.core.WireFormat[Nothing]]
}

-Xlog-implicits shows that we are cutting off lots of divergent nested implicit searches. We tread a fairly perilous path with divergent implicits, it seems in this case we are too lenient and should call the whole search off rather than continuing. But it is hard to be sure about what's going on without first creating a smaller set of implicits that demonstrates the essense of Scoobi's WireFormat and AvroSchema implicits.

I remember that these implicits were involved in another compilation speed problem I spent some time on: NICTA/scoobi#324

AFAICT, this behaviour isn't a regression from 2.11.5, so I'm demoting it as a blocker for 2.11.6.

@scabug
Copy link
Author

scabug commented Feb 28, 2015

@adriaanm said:
Agreed. Changing implicit behavior is probably a 2.12 thing (generally speaking) unless it's a regression.

@scabug
Copy link
Author

scabug commented Mar 1, 2015

Alex Cozzi (alecozzi) said:
Thanks for looking into it.
Not sure about the compiler itself, but least from the scala-ide I have the impression that it got worse with 2.11. I was able to edit scoobi programs with the scala ide based on 2.10. It did lock up once in a while, but was overall usable. When I updated to scala-ide based on 2.11 it would lock up almost immediately when editing a scoobi program.

@scabug
Copy link
Author

scabug commented Mar 2, 2015

Alex Cozzi (alecozzi) said:
If you change the build file as:
resolvers += "staging1" at "https://oss.sonatype.org/content/repositories/orgscala-lang-1184/"

scalaVersion in ThisBuild := "2.10.4"

libraryDependencies += "com.nicta" %% "scoobi" % "0.9.2"
it does not fail:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[info] Loading global plugins from /Users/acozzi/.sbt/0.13/plugins
[info] Loading project definition from /Users/acozzi/Documents/workspace-4.0/scoobi-blowup/project
[info] Set current project to scoobi-blowup (in build file:/Users/acozzi/Documents/workspace-4.0/scoobi-blowup/)
[info] Updating {file:/Users/acozzi/Documents/workspace-4.0/scoobi-blowup/}scoobi-blowup...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/acozzi/Documents/workspace-4.0/scoobi-blowup/target/scala-2.10/classes...
[error] /Users/acozzi/Documents/workspace-4.0/scoobi-blowup/x.scala:5: diverging implicit expansion for type com.nicta.scoobi.core.WireFormat[K]
[error] starting with method hlistHasWireFormat in trait WireFormatImplicits
[error] def filtered = lines.groupBy { x => ??? }
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 9 s, completed Mar 1, 2015 9:13:42 PM

but from 2.11.0 and above it does lock up.

@scabug
Copy link
Author

scabug commented Mar 2, 2015

@retronym said:
That's probably related to scala/scala#2428 and scala/scala#3669. This is a pretty shadowy area of the compiler, we seem to be oscillating between solutions which don't strike the right balance between recovering from diverging implicit expansions vs bailing out the search blows up.

@scabug scabug added this to the Backlog milestone Apr 7, 2017
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

No branches or pull requests

2 participants