From dd976e9b5b87e8665627f6990ef17835003972cc Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Wed, 16 Apr 2014 14:03:03 -0400 Subject: [PATCH] Within buildPluginDefinition(), the call to setProject() can (and usually will) return a modified structure together with the new state. The subsequent call to evalPluginDef() should use the updated structure, rather the old stucture that was present before the setProject() ("pluginDef"); if that is not the case, the code called by evalPluginDef() will find an inconsistent structure/state combination, and behave in bizarre ways as a result. More in general, it is a bit dangerous to pass to routines in parallel the two separate state and structure, as the two may easily inadvertently fall out of alignment, as in this case. This patch should be applied to both the 0.13 branch as well as to a future 0.12.5 release (the corresponding file there is ./main/Load.scala). (from @cunei). --- main/Load.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/Load.scala b/main/Load.scala index cc9e3660d..129c9248a 100755 --- a/main/Load.scala +++ b/main/Load.scala @@ -531,7 +531,7 @@ object Load { val (eval,pluginDef) = apply(dir, s, config) val pluginState = Project.setProject(Load.initialSession(pluginDef, eval), pluginDef, s) - config.evalPluginDef(pluginDef, pluginState) + config.evalPluginDef(Project.structure(pluginState), pluginState) } def definitions(base: File, targetBase: File, srcs: Seq[File], plugins: LoadedPlugins, definesClass: DefinesClass, compilers: Compilers, log: Logger): LoadedDefinitions =