Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel 7.0 rc2 support #1524

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Conversation

gergelyfabian
Copy link
Contributor

Added @bazel_tools//tools/jdk:toolchain_type toolchain for scala_junit_test: bazelbuild/bazel#18970

Changed 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.

Added `@bazel_tools//tools/jdk:toolchain_type` toolchain scala_junit_test:
bazelbuild/bazel#18970

Changed deprecated transitive_runtime_deps to transitive_runtime_jars in
jmh.bzl:
https://bazel.build/versions/6.4.0/rules/lib/JavaInfo#transitive_runtime_deps
Copy link
Collaborator

@liucijus liucijus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @gergelyfabian!

@gergelyfabian
Copy link
Contributor Author

gergelyfabian commented Nov 6, 2023

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.

@gergelyfabian
Copy link
Contributor Author

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]

@simuons simuons merged commit 9c0f6b9 into bazelbuild:master Nov 6, 2023
2 checks passed
@gergelyfabian
Copy link
Contributor Author

Opened an issue for the scalafmt error:

#1525

@gergelyfabian gergelyfabian deleted the bazel-7.0-support branch November 6, 2023 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants