Skip to content

Commit

Permalink
fix: zinc issue with duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyklim committed Jul 15, 2024
1 parent 1369dea commit 08bf3c3
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .bazelrc_shared
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ common --announce_rc
common --color=yes

build --experimental_strict_action_env
build --java_language_version=21
build --java_runtime_version=21
build --tool_java_language_version=21
build --tool_java_runtime_version=21
build --extra_toolchains=@local_jdk//:all

build --strategy=ScalaCompile=worker
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ hash2
.bazel_cache
/external-tools/
target/
tests/compile/zinc-inc/A.scala

!bazel-*.rc
!bazel-multiversion
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions tests/compile/zinc-inc/A.scala

This file was deleted.

5 changes: 5 additions & 0 deletions tests/compile/zinc-inc/A1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package test

sealed trait A
object A:
case object Item extends A
5 changes: 5 additions & 0 deletions tests/compile/zinc-inc/A2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package test

opaque type A = Int
object A:
val A: Item = 1
5 changes: 4 additions & 1 deletion tests/compile/zinc-inc/B.scala
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
final class B
package test

def test(): Unit =
println(A.Item)
8 changes: 7 additions & 1 deletion tests/compile/zinc-inc/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
load("@rules_scala3//rules:scala.bzl", "scala_library")

scala_library(
name = "a",
srcs = ["A1.scala"],
)

scala_library(
name = "lib",
srcs = glob(["*.scala"]),
srcs = ["B.scala"],
deps = [":a"],
)
4 changes: 0 additions & 4 deletions tests/compile/zinc-inc/C.scala

This file was deleted.

3 changes: 3 additions & 0 deletions tests/compile/zinc-inc/test
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
. "$(dirname "$0")"/../../common.sh

# rm -fr "$(bazel info execution_root)/.bazel-zinc"
cat A1.scala > A.scala
bazel build --noworker_sandboxing --worker_extra_flag=ScalaCompile=--persistence_dir=/tmp/.bazel-zinc --worker_extra_flag=ScalaCompile=--extracted_file_cache=/tmp/.bazel-zinc-outputs :lib
cat A2.scala > A.scala
bazel build --noworker_sandboxing --worker_extra_flag=ScalaCompile=--persistence_dir=/tmp/.bazel-zinc --worker_extra_flag=ScalaCompile=--extracted_file_cache=/tmp/.bazel-zinc-outputs :lib

0 comments on commit 08bf3c3

Please sign in to comment.