forked from bazelbuild/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump to Bazel 8.0.0rc6, fix //third_party tests
Fixes `{strict_deps,unused_dependency_checker}_test` from `//third_party/dependency_analyzer/src/test` by updating `$(location)` to `$(rootpath)`. Part of bazelbuild#1652. `//third_party/dependency_analyzer/src/test:strict_deps_test` and `//third_party/dependency_analyzer/src/test:unused_dependency_checker_test` both failed with errors of the form: ```txt StrictDepsTest: - error on indirect dependency target *** FAILED *** (379 milliseconds) nice errors on sequence of strings.this.infos.exists(nice errors on sequence of strings.this.checkErrorContainsMessage(target)) was false expected an error on //commons:Target to appear in errors (with buildozer command)! Errors: List(object apache is not a member of package org) (StrictDepsTest.scala:85) ``` This happened both under `WORKSPACE` and Bzlmod. These targets both depend on `@org_apache_commons_commons_lang_3_5_without_file//:linkable_org_apache_commons_commons_lang_3_5_without_file`. The `@org_apache_commons_commons_lang_3_5_without_file` repo is now instantiated by `dev_deps_repositories()` from `scala/private/extensions/dev_deps.bzl`. These tests pass on Bazel 6 and 7. I added code to the "error on indirect dependency target" test case from `third_party/dependency_analyzer/src/test/io/bazel/rulesscala/ dependencyanalyzer/StrictDepsTest.scala` to see the result of `compileWithDependencyAnalyzer()`: ```diff diff --git a/third_party/dependency_analyzer/src/test/io/bazel/rulesscala/dependencyanalyzer/StrictDepsTest.scala b/third_party/dependency_analyzer/src/test/io/bazel/rulesscala/dependencyanalyzer/StrictDepsTest.scala index b26ba5e5..76b19e90 100644 --- a/third_party/dependency_analyzer/src/test/io/bazel/rulesscala/dependencyanalyzer/StrictDepsTest.scala +++ b/third_party/dependency_analyzer/src/test/io/bazel/rulesscala/dependencyanalyzer/StrictDepsTest.scala @@ -37,7 +37,9 @@ class StrictDepsTest extends AnyFunSuite { val commonsTarget = "//commons:Target" val indirect = List(apacheCommonsClasspath -> commonsTarget) - compileWithDependencyAnalyzer(testCode, withIndirect = indirect).expectErrorOn(commonsTarget) + val errors = compileWithDependencyAnalyzer(testCode, withIndirect = indirect) + System.out.println(errors) + errors.expectErrorOn(commonsTarget) } test("error on multiple indirect dependency targets") { ``` Under Bazel 7.4.1, the test passed and shows this output: ```txt $ bazel test --test_output=streamed \ //third_party/dependency_analyzer/src/test:strict_deps_test [ ...snip... ] StrictDepsTest: List(Target '//commons:Target' is used but isn't explicitly declared, please add it to the deps. You can use the following buildozer command: buildozer 'add deps //commons:Target' //...) ``` Under Bazel 8.0.0rc6, it failed and showed this: ```txt $ bazel test --test_output=streamed \ //third_party/dependency_analyzer/src/test:strict_deps_test [ ...snip... ] StrictDepsTest: List(object apache is not a member of package org) ```
- Loading branch information
Showing
16 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.1 | ||
8.0.0rc6 |