-
Notifications
You must be signed in to change notification settings - Fork 277
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
[WIP] Phase format #874
[WIP] Phase format #874
Conversation
616347f
to
1064b4c
Compare
Force pushed to fix format. |
We are happy to figure out attribution from |
Hey @borkaehw, I have a branch off of this and I'm trying to implement a bloop integration. I did some work off of higherkindness/rules_scala and was referenced to here. So now I'm trying to port over my code. I read the documentation on adding a phase here: https://github.com/bazelbuild/rules_scala/pull/865/files#diff-3152e63cc3552788493d47c5dde927a2 and I've looked through this PR and mostly referenced the work done for scalafmt to write a bloop phase. First I wanted to first check if I'm doing the right approach here: https://github.com/lucidsoftware/rules_scala_bazelbuild/compare/phase-format...psilospore:bloop-phase?expand=1#diff-60c470b96b12437fced2f68a105809dd Secondly, I am having a bit of trouble with indirect dependencies. At runtime I've been getting some class not found exceptions. I added dependencies like this:
Then used it like this
But then when I use something in blooplauncher it gives me this:
It seems like I'm doing something wrong and I'm pretty new to bazel so I suspect I am. |
Are you certain BasePosixProcess comes from blooplauncher jar?
Do you know that in bazel when using scala_maven_import_external you need
to specify the transitive dependencies (or use bazel-deps to specify it for
you)?
On Fri, 27 Dec 2019 at 2:23 Syed Akber Jafri ***@***.***> wrote:
Hey @borkaehw <https://github.com/borkaehw>,
I have a branch off of this and I'm trying to implement a bloop
integration. I did some work off of higherkindness/rules_scala
<https://github.com/psilospore/rules_scala_bloopy> and was referenced to
here. So now I'm trying to port over my code.
I read the documentation on adding a phase here:
https://github.com/bazelbuild/rules_scala/pull/865/files#diff-3152e63cc3552788493d47c5dde927a2
and I've looked through this PR and mostly referenced the work done for
scalafmt to write a bloop phase.
First I wanted to first check if I'm doing the right approach here:
https://github.com/lucidsoftware/rules_scala_bazelbuild/compare/phase-format...psilospore:bloop-phase?expand=1#diff-60c470b96b12437fced2f68a105809dd
Secondly, I am having a bit of trouble with indirect dependencies. At
runtime I've been getting some class not found exceptions.
I added dependencies like this:
_scala_maven_import_external(
name = "bloop-launcher",
artifact = "ch.epfl.scala:bloop-launcher_2.12:1.2.5",
licenses = ["notice"],
server_urls = maven_servers,
)
native.bind(
name = "io_bazel_rules_scala/bloop/blooplauncher",
actual = ***@***.***",
)
Then used it like this
scala_binary(
name = "bloop",
srcs = glob(["bloop/BloopRunner.scala"]),
main_class = "io.bazel.rules_scala.bloop.BloopRunner",
visibility = ["//visibility:public"],
deps = [
"//src/java/io/bazel/rulesscala/worker",
***@***.***//:net_sourceforge_argparse4j_argparse4j", #TODO move
"//external:io_bazel_rules_scala/bloop/bsp4j",
"//external:io_bazel_rules_scala/bloop/bloopconfig",
"//external:io_bazel_rules_scala/bloop/blooplauncher",
But then when I use something in blooplauncher it gives me this:
Exception in thread "main" java.lang.NoClassDefFoundError: com/zaxxer/nuprocess/internal/BasePosixProcess
It seems like I'm doing something wrong and I'm pretty new to bazel so I
suspect I am.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#874?email_source=notifications&email_token=AAKQQF7BGMGYCY3UHMJSS3TQ2VDILA5CNFSM4JJ7S7DKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHWJ3YQ#issuecomment-569155042>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKQQF4KL3EL2SQ6TOZZ3IDQ2VDILANCNFSM4JJ7S7DA>
.
--
*Ittai Zeidman*
40 Hanamal street, Tel Aviv, Israel
<http://www.wix.com>
|
Thanks @ittaiz I was able to figure out how to use bazel-deps to have my bloop runner working.
Seems like it does here's the a generated file from bazel-deps
|
I want to make sure I'm understanding this right. Right now I'm trying to follow the scalafmt example where I just add an additional final phase:
Where I will generate bloop configs and test if I'm able to make a compile BSP request successfully to bloop. Once that works I'm thinking I would do a replace on the compile phase.
Doing that means I would need to return the same struct as compile which seems to be in this shape:
Then I can do something like this except with bloop:
Does that sound like I'm headed towards the right direction? |
@psilospore Hi there, sorry for late response since I just got back from a long vacation.
Just keep in mind
Theoretically yes, otherwise phases after
Yes, if it's merged in. You may also keep this work in your private workspace without opening a PR. We have made a lot of changes on phase architecture. This phase format PR is very outdated. I would branch off of master and work from there. I will do the same to re-open phase format PR if we decide to move forward. |
This PR will be replaced by #912. |
Thanks for letting me know I'm headed towards the right direction! @jvican and I would probably be interested in getting this merged in eventually vs having it in another repo. I'll branch off of master. |
Description
This is an example of how to add custom phases without changing default rules behavior. This phase introduces formatting to
bazelbuild/rules_scala
.Copied most of the code from https://github.com/higherkindness/rules_scala
Motivation
Formatting is a nice-to-have feature.