Skip to content

Commit

Permalink
Sort jars by pre-topological sort to preserve leftmost-first guarantee
Browse files Browse the repository at this point in the history
With topological order, there's no left-to-right order guarantee
https://bazel.build/rules/lib/depset

As a result, `test/shell/test_misc`'s `test_multi_service_manifest`
fails because the order of `exepected_service_manifest.txt` reverses.
  • Loading branch information
tanishiking committed Dec 8, 2022
1 parent c7add52 commit ae85cde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scala/private/phases/phase_compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _phase_compile(
# TODO: simplify the return values and use provider
return struct(
files = depset(out.full_jars),
rjars = depset(out.full_jars, transitive = [rjars], order = "topological"),
rjars = depset(out.full_jars, transitive = [rjars], order = "preorder"),
merged_provider = out.merged_provider,
external_providers = {
"JavaInfo": out.merged_provider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.scalatest.funsuite._

class ScalaLibResourcesDuplicatedTest extends AnyFunSuite {

test("Scala library depending on resources from external resource-only jar should allow to load resources") {
test("Scala library depends on resource + deps that contains same name resources, have higher priority on this target's resource.") {
assert(get("/resource.txt") === "I am a text resource from child!\n")
}

Expand Down

0 comments on commit ae85cde

Please sign in to comment.