-
-
Notifications
You must be signed in to change notification settings - Fork 288
scala_export macro #1790
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
base: master
Are you sure you want to change the base?
scala_export macro #1790
Conversation
mbland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I think it looks mostly pretty good, modulo the few requests I've made so far, particularly around legacy WORKSPACE support. I also need to study it a bit to make sure I understand the whole thing, and I'll eventually pull the branch and run the tests locally.
That said, I'm going to play the BazelCon card and decline to commit to looking any more closely until about a week from now. (If changes come in, and I'm inclined, I may respond sooner. But no promises until next week.)
| cmd = "for SRC in $(SRCS); do jar tf $$SRC >> $@; done", | ||
| ) | ||
|
|
||
| sh_test( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a load("@rules_shell//shell:sh_test.bzl", "sh_test") for this.
| single_version_override( | ||
| module_name = "rules_jvm_external", | ||
| version = "6.9", | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add a bazel_dep(name = "rules_jvm_external", version = "6.9") to deps/latest/MODULE.bazel.
| def getName(): String = { | ||
| "scala_export test" | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is such a small thing, but please add newlines to the end of these test .scala files.
| version = "8.16.1", | ||
| ) | ||
|
|
||
| bazel_dep(name = "rules_jvm_external", version = "6.9") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check in a maven_install.json for this?
| version = "8.16.1", | ||
| ) | ||
|
|
||
| bazel_dep(name = "rules_jvm_external", version = "6.9") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll also need to set this up for legacy WORKSPACE builds. That means updating:
scala/deps.bzlscala/latest_deps.bzl- Probably every legacy
WORKSPACEfile in the project
Another reason the legacy WORKSPACE system must be destroyed, but I'm not ready to drop support just yet.
mbland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing: there are a number of test failures in CI.
If you haven't already, please run the test scripts locally and fix what you can, ideally getting ./test_all.sh to finish successfully once you're done. I'm happy to dig in and try to help if you get stuck. (After BazelCon.)
And FWIW, I think the Windows failure may be CRLF vs. LF related, but I haven't looked very closely yet. But check out the changes to src/java/io/bazel/rulesscala/worker/WorkerTest.java from #1724, in case it helps.
Description
This adds a drop in replacement for
java_exportthat works for scala.We've been using this internally at Confluent for some time now in our rules_jvm_external fork.
https://github.com/confluentinc/rules_jvm_external/blob/master/private/rules/scala_export.bzl
Motivation
We needed this at Confluent and figure other folks might find it useful. Originally I tried to upstream this to rules_jvm_external, but it was decided that it would be more appropriate here and would help to avoid circular dependencies between rules_scala and rules_jvm_external if rules_scala ever chose to adopt rules_jvm_external in the future.