mirror of https://github.com/sbt/sbt.git
**Problem** When a val definition in build.sbt changes and the user runs `reload`, sbt crashes with `NoClassDefFoundError: $Wrap<hash>$`. ``` java.lang.NoClassDefFoundError: $Wrape8743d4f36$ at $Wrap0b8ea34d40$.$anonfun$1(build.sbt:1) ``` The workaround was to delete `project/target` directory. **Solution** The root cause was that imports were not included in the hash calculation when evaluating build.sbt expressions. When a val definition changes: 1. Its `$Wrap` module gets a new hash 2. Settings that reference the val get new imports pointing to the new module 3. But if the setting expression didn't change, its hash was the same 4. The old cached class was loaded with bytecode referencing the old module Fix: Include imports in the hash calculation in `Eval.evalCommon`. Also re-enable `cleanEvalClasses` in `Load.scala` which was disabled pending this fix. |
||
|---|---|---|
| .. | ||
| main/scala/sbt/internal | ||
| test | ||