Skip to content

Commit

Permalink
Fix cleaning packed dir
Browse files Browse the repository at this point in the history
`clean` should delete the packed dir. If it does not,
the next `compileIncremental`, which is a cache hit, will see that
the packed dir is already there and will not unpack it.
  • Loading branch information
adpi2 committed Aug 26, 2024
1 parent ba5ac77 commit 038b96c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions main/src/main/scala/sbt/Defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -919,9 +919,12 @@ object Defaults extends BuildCommon {
compileOutputs := {
import scala.jdk.CollectionConverters.*
val c = fileConverter.value
val (_, vfDir, _) = compileIncremental.value
val (_, vfDir, packedDir) = compileIncremental.value
val classFiles = compile.value.readStamps.getAllProductStamps.keySet.asScala
classFiles.toSeq.map(c.toPath) :+ compileAnalysisFile.value.toPath :+ c.toPath(vfDir)
classFiles.toSeq.map(c.toPath) :+
compileAnalysisFile.value.toPath :+
c.toPath(vfDir) :+
c.toPath(packedDir)
},
compileOutputs := compileOutputs.triggeredBy(compile).value,
tastyFiles := Def.taskIf {
Expand Down
10 changes: 5 additions & 5 deletions server-test/src/test/scala/testpkg/BuildServerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class BuildServerTest extends AbstractServerTest {
assertMessage(s""""id":"$id"""", """"class":"main.Main"""")(duration = 30.seconds)
}

ignore("buildTarget/run") {
test("buildTarget/run") {
val buildTarget = buildTargetUri("runAndTest", "Compile")
val id = nextId()
svr.sendJsonRpc(
Expand All @@ -388,7 +388,7 @@ class BuildServerTest extends AbstractServerTest {
|} }""".stripMargin
)
assertProcessing("buildTarget/run")
assertMessage("build/logMessage", """"message":"Hello World!"""")(debug = true)
assertMessage("build/logMessage", """"message":"Hello World!"""")()
assertMessage(s""""id":"$id"""", """"statusCode":1""")()
}

Expand All @@ -412,7 +412,7 @@ class BuildServerTest extends AbstractServerTest {
)()
}

ignore("buildTarget/jvmTestEnvironment") {
test("buildTarget/jvmTestEnvironment") {
val buildTarget = buildTargetUri("runAndTest", "Test")
val id = nextId()
svr.sendJsonRpc(
Expand All @@ -432,7 +432,7 @@ class BuildServerTest extends AbstractServerTest {
)()
}

ignore("buildTarget/scalaTestClasses") {
test("buildTarget/scalaTestClasses") {
val buildTarget = buildTargetUri("runAndTest", "Test")
val badBuildTarget = buildTargetUri("badBuildTarget", "Test")
val id = nextId()
Expand Down Expand Up @@ -462,7 +462,7 @@ class BuildServerTest extends AbstractServerTest {
assertMessage(s""""id":"$id"""", """"statusCode":2""")()
}

ignore("buildTarget/test: run one test class") {
test("buildTarget/test: run one test class") {
val buildTarget = buildTargetUri("runAndTest", "Test")
val id = nextId()
svr.sendJsonRpc(
Expand Down

0 comments on commit 038b96c

Please sign in to comment.