Closed tel closed 4 years ago
Can you share the list of other plugins you are including? I think it most likely related to a conflict with one of them, rather than some configuration in your build.
Sure, here's plugins.sbt
resolvers += "spray repo" at "http://repo.spray.io"
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
addSbtPlugin("io.spray" % "sbt-revolver" % "0.8.0")
addSbtPlugin("com.lihaoyi" % "workbench" % "0.2.3")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.9")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.0-RC1")
addSbtPlugin("com.heroku" % "sbt-heroku" % "1.0.1")
logLevel := Level.Warn
Based on a quick review, it's the workbench
plugin which is causing the issues. I'll investigate further.
Here's a relevant part of the definition of workbenchSettings
:
(extraLoggers in ThisBuild) := {
val clientLogger = FullLogger{
new Logger {
def log(level: Level.Value, message: => String) =
if(level >= Level.Info) server.value.Wire[Api].print(level.toString, message).call()
def success(message: => String) = server.value.Wire[Api].print("info", message).call()
def trace(t: => Throwable) = server.value.Wire[Api].print("error", t.toString).call()
}
}
clientLogger.setSuccessEnabled(true)
val currentFunction = extraLoggers.value
(key: ScopedKey[_]) => clientLogger +: currentFunction(key)
},
I'm not right now aware enough of how sbt works to understand why this would be causing the looping issues. For completeness, here's the similar line in sbt-heroku
extraLoggers := {
val currentFunction = extraLoggers.value
(key: ScopedKey[_]) => {
val taskOption = key.scope.task.toOption
val loggers = currentFunction(key)
if (taskOption.map(_.label) == Some("deployHeroku") || taskOption.map(_.label) == Some("deployHerokuSlug"))
new HerokuLogger(target.value / "heroku" / "diagnostics.log") +: loggers
else
loggers
}
}
I was able to get it working locally by filtering out the extraLoggers
key from workbenchSettings
.
.settings(workbenchSettings.filterNot(p => p.key.key == extraLoggers.scopedKey.key))
but this is fairly blunt and unsatisfactory.
Yes, that's not a good long term solution. Thank you for providing so much excellent detail on the problem. I will look into fixing it, but the what's causing the cycle is not immediately obvious to me (so I may have to enlist some help from the SBT folks).
Np! I've also cross-posted this to lihaoyi/workbench as I'm honestly not sure where a fix ought to happen. Thank you for looking into it!
I'm closing this due to inactivity. Feel free to comment in case this issue still be relevant for you and I'll reopen it.
I'm getting an error as soon as I declare the
sbt-heroku
plugin (version 1.0.1)My build.sbt looks like