mirror of https://github.com/sbt/sbt.git
Fix for #4148 (SessionSettingsSpec intermittently fails)
It turns out that `syntaxAnalyzer.UnitParser()` in global now also needs to be synchronized. The alternative is adding `synchronizeNames = true` in the global constructor, but that already proved unreliable in the case of #3743 (see comment https://github.com/sbt/sbt/issues/3170#issuecomment-355218833)
This commit is contained in:
parent
7e8e18b9fa
commit
f2a7e1f1c3
|
|
@ -148,7 +148,9 @@ private[sbt] object SbtParser {
|
|||
reporter.reset()
|
||||
val wrapperFile = new BatchSourceFile(reporterId, code)
|
||||
val unit = new CompilationUnit(wrapperFile)
|
||||
val parser = new syntaxAnalyzer.UnitParser(unit)
|
||||
val parser = SbtParser.synchronized { // see https://github.com/sbt/sbt/issues/4148
|
||||
new syntaxAnalyzer.UnitParser(unit)
|
||||
}
|
||||
val parsedTrees = SbtParser.synchronized { // see https://github.com/scala/bug/issues/10605
|
||||
parser.templateStats()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue