Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Vladimir Pavkin
    @vpavkin

    @romanowski Hi! I just tried to stash a cache for our project and seems it doesn't support scala-js crossprojects.
    ScalaJS crossproject produces two regular projects JS and JVM. and out of two one (randomly chosen) fails with this:

    [error] (sharedJS/*:stash) java.lang.AssertionError: assertion failed: Cache already exists in /Users/user/.sbt/0.13/sbt-stash/root_folder/HEAD/2.11/shared/compile!

    My guess is that scala version in the cache path is not encoded precisely enough. it probably requires a separate name for js project

    Krzysztof Romanowski
    @romanowski
    hello @vpavkin ! I didn't tested ScalaJs project and now I know I should! Can you give me pointers to any repo I can test it on?
    We can hang up tommorow and we can take look together.
    Vladimir Pavkin
    @vpavkin

    Sure, let’s chat tomorrow at SD!
    basically any library that claims to cross-compile to scalajs should be a test-case for you :)

    For example monix :)

    Krzysztof Romanowski
    @romanowski
    Will try! I hope I can present you with solution tommorow:D
    Vladimir Pavkin
    @vpavkin
    sounds wonderful! anyway no worries!)
    Krzysztof Romanowski
    @romanowski
    Lesson learned: project names are not uniqe
    Fix is here: romanowski/hoarder#42
    Vladimir Pavkin
    @vpavkin
    Hey! :) cool thanks!
    Is it already released?
    Krzysztof Romanowski
    @romanowski
    1.0.1-M3 is released
    Vladimir Pavkin
    @vpavkin

    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

    for all other projects (including scala-js ones) cache seemed to work fine. sad thing is that the project that depends on the PB sources is responsible for 75% of the compile time :smile:
    Krzysztof Romanowski
    @romanowski
    hmm soureces are hashed based on content so i theory it should work
    is there open source example I can try?
    Vladimir Pavkin
    @vpavkin
    I will try to creat a small reproduction project on github and send it to you today.
    Vladimir Pavkin
    @vpavkin
    sbt
    stash
    clean
    cleanFiles
    stashApply
    compile
    You’ll notice that after last compile it regenerates the protobuf classes
    Krzysztof Romanowski
    @romanowski
    thanks! I will give it a try
    Krzysztof Romanowski
    @romanowski
    ok, I found a problem
    I need to generate source files before all classes are applied
    romanowski/hoarder#43
    Vladimir Pavkin
    @vpavkin
    :+1: thanks!
    Krzysztof Romanowski
    @romanowski
    @vpavkin I've just fixed tested and I hope it should work in your case
    can you publish hoarder locally and try newest version (from master)? I don't want to create a release after each bug and I've not setup snapshot releases yet (now I think I should)
    Vladimir Pavkin
    @vpavkin
    Sure, will try tomorrow hopefully :)
    Vladimir Pavkin
    @vpavkin

    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 :)

    Krzysztof Romanowski
    @romanowski
    Hello @vpavkin! Sorry for late response but I've got to fix all life-related stuff (that I postponed after ScalaDays).
    I've created a branch (https://github.com/romanowski/hoarder/tree/debugging-info) with added debugging infos