Closed gergelyfabian closed 10 months ago
There is still one thing that doesn't work for Bazel 7.0rc2. When running a target like this:
# Important to clean, as the files can stay from a previous bazel build with a lower Bazel version.
bazel clean
bazel run //utils/smth:library.format-test
I receive:
utils/smth/src/main/scala/com/dummy/smth/Smth.scala
diff: /home/gege/.cache/bazel/_bazel_user/7f83a0b1f0940f88aec1f4530f927169/execroot/repo/bazel-out/k8-fastbuild/bin/utils/smth/utils/smth/src/main/scala/com/dummy/smth/Smth.scala.fmt.output: No such file or directory
It seems the action responsible for creating this file executes (I have tested disabling writing the output there, but then obviously it fails due to not generating an output), but at a later step the action running scalafmt from the manifest cannot see the scalafmt outputs.
One difference I can see in the bazel-bin direction between Bazel 6.4.0 and Bazel 7.0rc2 (after running bazel run //utils/smth:library.format-test
):
# 6.4.0:
ls bazel-bin/utils/smth/utils/smth/src/main/scala/com/dummy/smth/
Smth.scala.fmt.output
# 7.0rc2:
ls bazel-bin/utils/smth/utils/smth/src/main/scala/com/dummy/smth/
[empty]
Opened an issue for the scalafmt error:
Added
@bazel_tools//tools/jdk:toolchain_type
toolchain for scala_junit_test: https://github.com/bazelbuild/bazel/issues/18970Changed deprecated transitive_runtime_deps to transitive_runtime_jars in jmh.bzl: https://bazel.build/versions/6.4.0/rules/lib/JavaInfo#transitive_runtime_deps
With these changes rules_scala (for the cases I checked) started working with Bazel 7.0 rc2.