Skip to content

Commit

Permalink
Pull in Zinc 0.10.3 (#3773)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi authored Oct 19, 2024
1 parent 9aeba6d commit 2bc599d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ object Deps {
val sourcecode = ivy"com.lihaoyi::sourcecode:0.3.1"
val upickle = ivy"com.lihaoyi::upickle:3.3.1"
val windowsAnsi = ivy"io.github.alexarchambault.windows-ansi:windows-ansi:0.0.5"
val zinc = ivy"org.scala-sbt::zinc:1.10.2"
val zinc = ivy"org.scala-sbt::zinc:1.10.3"
// keep in sync with doc/antora/antory.yml
val bsp4j = ivy"ch.epfl.scala:bsp4j:2.2.0-M2"
val fansi = ivy"com.lihaoyi::fansi:0.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,15 @@ object CodeSigSubfolderTests extends UtestIntegrationTestSuite {
// Changing stuff in subfolder/package.mill does not invalidate unrelated tasks in build.mill
val cached3 = eval("foo")
assert(cached3.out == "")
// This should only compile 1 source but it seems there's an upstream bug in Zinc
// https://github.com/sbt/zinc/issues/1461
assert(cached3.err.contains("compiling 2 Scala sources"))
assert(cached3.err.contains("compiling 1 Scala source"))

modifyFile(
workspacePath / "subfolder/package.mill",
_.replace("running helperFoo", "running helperFoo2")
)
val mangledHelperFoo = eval("foo")
assert(mangledHelperFoo.out.linesIterator.toSeq == Seq("running foo2", "running helperFoo2"))
// This should only compile 1 source but it seems there's an upstream bug in Zinc
// https://github.com/sbt/zinc/issues/1461
assert(mangledHelperFoo.err.contains("compiling 2 Scala sources"))
assert(mangledHelperFoo.err.contains("compiling 1 Scala source"))

// Make sure changing `val`s, which only affects the Module constructor and
// not the Task method itself, causes invalidation
Expand All @@ -68,9 +64,7 @@ object CodeSigSubfolderTests extends UtestIntegrationTestSuite {
)
val mangledValFoo = eval("foo")
assert(mangledValFoo.out.linesIterator.toSeq == Seq("running foo2", "running helperFoo2"))
// This should only compile 1 source but it seems there's an upstream bug in Zinc
// https://github.com/sbt/zinc/issues/1461
assert(mangledValFoo.err.contains("compiling 2 Scala sources"))
assert(mangledValFoo.err.contains("compiling 1 Scala source"))

// Even modifying `val`s that do not affect the task invalidates it, because
// we only know that the constructor changed and don't do enough analysis to
Expand All @@ -85,9 +79,7 @@ object CodeSigSubfolderTests extends UtestIntegrationTestSuite {
"running helperFoo2"
))

// This should only compile 1 source but it seems there's an upstream bug in Zinc
// https://github.com/sbt/zinc/issues/1461
assert(mangledValFooUsedInBar.err.contains("compiling 2 Scala sources"))
assert(mangledValFooUsedInBar.err.contains("compiling 1 Scala source"))

val cached4 = eval("foo")
assert(cached4.out == "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ object ZincBuildCompilationTests extends UtestIntegrationTestSuite {
_.replace("running helperFoo", "running helperFoo2")
)
val mangledHelperFoo = eval(("dummy"))
// This should only compile 1 source but it seems there's an upstream bug in Zinc
// https://github.com/sbt/zinc/issues/1461
assert(mangledHelperFoo.err.contains("compiling 2 Scala source"))
assert(mangledHelperFoo.err.contains("compiling 1 Scala source"))

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ class ZincWorkerImpl(
ConsistentFileAnalysisStore.binary(
file = path.toIO,
mappers = ReadWriteMappers.getEmptyMappers(),
sort = true,
// No need to utilize more that 8 cores to serialize a small file
parallelism = math.min(Runtime.getRuntime.availableProcessors(), 8)
)
Expand Down

0 comments on commit 2bc599d

Please sign in to comment.