hoarder
hoarder copied to clipboard
stashApply succeeds but compilation still triggers
On all sbt projects at work we have this issue.
We run sbt test:compile stash
in Gitlab CI job and share the stashed folder as an artifact.
On the next job we run sbt stashApply test
.
The compilation is still triggered before running the tests.
I've tried on this open-source, simpler project and I reproduce the issue.
I've added addSbtPlugin("com.github.romanowski" % "hoarder" % "1.0.5")
in project\plugins.sbt
then I run these commands:
sbt test:compile stash
I can see in the log that this succeeded:
[info] Project approvals-demo-scala stashed to /Users/michel/.sbt/1.0/sbt-stash/approvals-demo-scala/HEAD/2.12 using classes from List(ExportedCache(/Users/michel/.sbt/1.0/sbt-stash/approvals-demo-scala/HEAD/2.12/approvals-demo-scala/compile/analysis.zip,None), ExportedCache(/Users/michel/.sbt/1.0/sbt-stash/approvals-demo-scala/HEAD/2.12/approvals-demo-scala/test/analysis.zip,None))
sbt clean
sbt stashApply test
Here is the log where you can see that the compilation triggers even after stashApply:
[info] Set current project to approvals-demo-scala (in build file:/Users/michel/git/katas/approvals-demo-scala/)
[success] Total time: 0 s, completed Dec 26, 2019, 4:55:32 PM
[info] Stash for approvals-demo-scala applied from /Users/michel/.sbt/1.0/sbt-stash/approvals-demo-scala/HEAD/2.12 to List(/Users/michel/git/katas/approvals-demo-scala/target/scala-2.12/classes, /Users/michel/git/katas/approvals-demo-scala/target/scala-2.12/test-classes)
[success] Total time: 1 s, completed Dec 26, 2019, 4:55:33 PM
[info] Compiling 1 Scala source to /Users/michel/git/katas/approvals-demo-scala/target/scala-2.12/classes ...
[info] Compiling 4 Scala sources to /Users/michel/git/katas/approvals-demo-scala/target/scala-2.12/test-classes ...
I've checked the logs for pipelines since months and it seems this issue has been present for a long time, I have not found a CI job where the compilation was not triggered.
Hi @tyrcho
I am looking at the problem. So to seems that this commit and follows ups by @eatkins added to sbt a custom mechanism to track changed sources and binaries.
I need to investigate if I can plug in into its current form or I will need to create PR to sbt to support it.
cc @eed3si9n
Hi, thanks for replying. If I understand correctly, a recent change in sbt prevents it to pickup stashed files from hoarder and compilation is triggered again ?
Yes. I am working on workaround (but I am still not sure if it will just works).
Thanks, I see this issue as well - using sbt 1.3.6 on AWS Codebuild (backed by GitHub).
Hi, any news ? we have stopped using hoarder until this is resolved ...
Hi, @tyrcho did you find some ad-hoc workaround for preventing recompilation or maybe find how to replace 'hoarder'?
unfortunately not :(
On Fri, May 1, 2020 at 12:21 PM Daniel Esik [email protected] wrote:
Hi, @tyrcho https://github.com/tyrcho did you found some ad-hoc workaround for preventing recompilation or maybe you found how to replace 'hoarder'?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/romanowski/hoarder/issues/70#issuecomment-622332220, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFK6ZFRO56224FKV5LRE23RPKPAXANCNFSM4J7MP6RQ .