Cool, now stash works. I have another issue and this time I’m not so sure what can be done here.
I have a bunch of protobuf definitions that are being generated by ScalaPB. resulting classes are placed into src_managed folder.
Thing is that when I apply the cache back, these generated sources are not there. ScalaPB generates them and this means that all the code is being recompiled (because the sources “changed”)
If you have time today I can find you and show the case. maybe you will have ideas on what can be done
sbt
stash
clean
cleanFiles
stashApply
compile
You’ll notice that after last compile it regenerates the protobuf classes
Sadly - this time stashApply failed for projects that were depending on generated sources:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at sbt.internal.inc.FormatCommons$class.toPair$1(FormatCommons.scala:118)
at sbt.internal.inc.FormatCommons$$anonfun$readMappedPairs$1.apply(FormatCommons.scala:125)
at sbt.internal.inc.FormatCommons$$anonfun$readMappedPairs$1.apply(FormatCommons.scala:125)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.Range.foreach(Range.scala:141)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sbt.internal.inc.FormatCommons$class.readMappedPairs(FormatCommons.scala:125)
at sbt.inc.MappableFormat.readMappedPairs(MappableFormat.scala:13)
at sbt.internal.inc.FormatCommons$class.readPairs(FormatCommons.scala:112)
at sbt.inc.MappableFormat.readPairs(MappableFormat.scala:13)
at sbt.inc.RelationsTextFormat$RelationsF$.sbt$inc$RelationsTextFormat$RelationsF$$readRelation$1(RelationsTextFormat.scala:77)
at sbt.inc.RelationsTextFormat$RelationsF$$anonfun$1.apply(RelationsTextFormat.scala:96)
at sbt.inc.RelationsTextFormat$RelationsF$$anonfun$1.apply(RelationsTextFormat.scala:96)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sbt.inc.RelationsTextFormat$RelationsF$.read(RelationsTextFormat.scala:96)
at sbt.inc.MappableFormat$$anonfun$2.apply(MappableFormat.scala:39)
at sbt.inc.MappableFormat$$anonfun$2.apply(MappableFormat.scala:39)
at sbt.inc.FormatTimer$.aggregate(TextAnalysisFormat.scala:17)
at sbt.inc.FormatTimer$.time(TextAnalysisFormat.scala:24)
at sbt.inc.MappableFormat.read(MappableFormat.scala:39)
at org.romanowski.hoarder.core.HoarderEngine$class.importCacheTaskImpl(HoarderEngine.scala:104)
at org.romanowski.hoarder.actions.Stash$.importCacheTaskImpl(Stash.scala:19)
at org.romanowski.hoarder.actions.Stash$$anonfun$doStashApplyImpl$1$$anonfun$apply$1$$anonfun$apply$2.apply(Stash.scala:32)
at org.romanowski.hoarder.actions.Stash$$anonfun$doStashApplyImpl$1$$anonfun$apply$1$$anonfun$apply$2.apply(Stash.scala:27)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (protocolJS/compile:doStashApplyKey) java.lang.StringIndexOutOfBoundsException: String index out of range: -1
I can’t share the source, but it you could give a hit of what debugging actions I can do - I’d be glad :)
src_managed
.
1.0.2
. Please try it using addSbtPlugin("com.github.romanowski" % "hoarder" % "1.0.2")
.shouldUseCache
and .shouldPublishCaches
files?
java.lang.AssertionError: assertion failed: Cache does not exists in [...]