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

"Runtime references to undefined settings" error when use sbt.ProjectRef #63

Open
xuwei-k opened this issue Dec 16, 2017 · 3 comments
Open

Comments

@xuwei-k
Copy link
Contributor

xuwei-k commented Dec 16, 2017

a/build.sbt

val b = project

build.sbt

val b = ProjectRef(file("a"), "b")

val c = project.dependsOn(b)

project/build.properties

sbt.version=0.13.16

project/plugin.sbt

addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.14")

error log

Runtime references to undefined settings: 
  {file:/home/travis/build/xuwei-k/neo-scalafmt-ProjectRef-error/a/}a/sbt:scalafmtOnCompile from */*:onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin) ScalafmtSbtPlugin.scala:16)
  {file:/home/travis/build/xuwei-k/neo-scalafmt-ProjectRef-error/a/}b/sbt:scalafmtOnCompile from */*:onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin) ScalafmtSbtPlugin.scala:16)
 
	at sbt.Init$class.Uninitialized(Settings.scala:270)
	at sbt.Def$.Uninitialized(Def.scala:10)
	at sbt.Init$class.make(Settings.scala:148)
	at sbt.Def$.make(Def.scala:10)
	at sbt.Load$$anonfun$8.apply(Load.scala:161)
	at sbt.Load$$anonfun$8.apply(Load.scala:156)
	at sbt.Load$.timed(Load.scala:1025)
	at sbt.Load$.apply(Load.scala:156)
	at sbt.Load$.defaultLoad(Load.scala:39)
	at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:503)
	at sbt.BuiltinCommands$.doLoadProject(Main.scala:503)
	at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:495)
	at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:495)
	at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
	at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
	at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
	at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
	at sbt.Command$.process(Command.scala:93)
	at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
	at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
	at sbt.State$$anon$1.runCmd$1(State.scala:183)
	at sbt.State$$anon$1.process(State.scala:187)
	at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
	at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.MainLoop$.next(MainLoop.scala:96)
	at sbt.MainLoop$.run(MainLoop.scala:89)
	at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
	at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
	at sbt.Using.apply(Using.scala:24)
	at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
	at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
	at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
	at sbt.MainLoop$.runLogged(MainLoop.scala:22)
	at sbt.StandardMain$.runManaged(Main.scala:61)
	at sbt.xMain.run(Main.scala:35)
	at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
	at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
	at xsbt.boot.Launch$.run(Launch.scala:109)
	at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
	at xsbt.boot.Launch$.launch(Launch.scala:117)
	at xsbt.boot.Launch$.apply(Launch.scala:18)
	at xsbt.boot.Boot$.runImpl(Boot.scala:41)
	at xsbt.boot.Boot$.main(Boot.scala:17)
	at xsbt.boot.Boot.main(Boot.scala)
[error] Runtime references to undefined settings: 
[error] 
[error]   {file:/home/travis/build/xuwei-k/neo-scalafmt-ProjectRef-error/a/}a/sbt:scalafmtOnCompile from */*:onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin) ScalafmtSbtPlugin.scala:16)
[error] 
[error]   {file:/home/travis/build/xuwei-k/neo-scalafmt-ProjectRef-error/a/}b/sbt:scalafmtOnCompile from */*:onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin) ScalafmtSbtPlugin.scala:16)
[error]  
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 
@1015bit
Copy link

1015bit commented Jan 31, 2018

Hi. Are there any updates or workarounds for this issue?

@pheymann
Copy link

pheymann commented Aug 7, 2018

I am also running into this issue, but I am not able to grasp why it is failing when looking into the piece of code throwing this exception:
https://github.com/lucidsoftware/neo-sbt-scalafmt/blob/1.10/sbt-scalafmt/src/main/scala/com/lucidchart/sbt/scalafmt/ScalafmtSbtPlugin.scala#L16

Btw, my error looks a be different (v1.10 and sbt 1.0.5):

ProjectRef(uri("file:/Users/paul.heymann/<path to other subproject b>"), "b") / Sbt / scalafmtOnCompile from Global / onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin.globalSettings) ScalafmtSbtPlugin.scala:16)

My only guess it that Global hasn't evaluated b when resolving the ProjectRef and therefore cannot find the setting. But I would assume that it should be available since sbt brings the subproject sbt configuration into the scope of the parent project.

@jvujcic
Copy link

jvujcic commented Aug 15, 2018

Hi,
I'm also having this issue. Any updates?

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

4 participants