Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    so seems like setting rules_scala_version to the newest version did it!
    Alex Wied

    Hi. I am using IntelliJ, Scala, and the Bazel plugin. I am noticing that some dependencies are not resolved, leading to red font in the code window. The project builds fine from the command line however.

    In particular, I've noticed that the .ijwb/.idea/libraries/ directory is missing an entry for com_typesafe_config_2_12_foo.xml.

    In fact, my application runs fine from within IntelliJ also. IntelliJ/the Bazel plugin is not picking up the external com.typesafe.config dependency. It doesn't make sense to me because it's explicitly depended upon in my BUILD file (e.g. deps = [ "//3rdparty/jvm/com/typesafe:config" ]).
    Vadim Anufriev

    Sorry about newbie question.
    Where I can find sha256 for selecting scala version in WORKSPACE file?


    Ittai Zeidman
    There is a rules_scala governance doc in a world commentable google doc.
    It is very much baked (and is based on previous work mostly done by the amazing @Oscar) and the main motivation of opening it up again is to see if I haven’t missed anything.
    Re the main heated discussion of correctness and such- I’ve massaged the terminology based on suggestions here to be the most open while keeping the values I think are core.
    In ~2 weeks I plan to send and merge a PR with this doc.
    Additionally I'd like to remind you that the main discussion of these rules is happening on slack https://bazelbuild.slack.com/archives/CDCKJ2KFZ/p1599132817003300
    Parker Gordon
    This room is more active than "Bazel Users" :smile:
    Andy Hamon
    Hey folks -- this might be more of a general bazel question, but how do I make sure that a given scala_proto_library call uses a custom toolchain? The docs just say "To configure ScalaPB options, configure a different scala_proto_toolchain and declare it in a BUILD file". Any build file? Every build file that needs it?
    Carlos Sanchez
    hello everyone! I'm new to bazel, used to work with maven, I have a question, I want to use the maven surefire plugin, however I need to specify a number of thins I used to do in the POM XML, however, as I'm migrating to bazel, I find it quite challenging (I don't know how to do it). So the question is, how to use a plugin (such as maven surefire plugin) with bazel? Considering we don't have a pom xml anymore
    P. Oscar Boykin
    I've never used that plugin before, and I can't tell what it does with a few minutes of reading (the doc pages seem to assume you know all about it)
    but, you can't use maven plugins with bazel... it seems like it is possibly related to code coverage, bazel does have support for that.
    Ittai Zeidman
    Depends on what you’re trying to do. If it’s the core offering of running all junit tests which have some prefix suffix then we support that in rules_scala (I plan to move this to a separate ruleset but in any case it will still be possible)
    If you can be more explicit in your needs we might have better answers
    Carlos Sanchez
    yes, what I want to achieve is to run tests in parallel, this can be achieved by using the maven surefire plugin and specifying the following configuration on the pom xml
    Ittai Zeidman
    Right now we don’t support that. Not sure we should support it because I think it’s against the bazel idioms but I need to think about it some more.
    In bazel the parallelism unit is targets.
    In any case you’re welcome to open an issue to suggest more fine grain parallelism and we can discuss it further
    Carlos Sanchez
    For sure, I'd be glad to open an issue related to this topic. Now, another question, is there a way to change the parallelism to work on methods? Maybe my question doesn't make sense, I apologize in advance haha
    Ittai Zeidman
    This is exactly what I referred to in my previous message
    We don’t support that == we don’t support method parallelism
    Carlos Sanchez
    ah, makes sense, well, this was fruitful, thanks for sharing your knowledge on the topic @ittaiz
    P. Oscar Boykin
    to be clear: bazel runs separate test targets in parallel already
    that is where the parallelism is "supposed" to come from.
    Ittai Zeidman
    Happy to.
    To be clear- if you want to parallel inside test targets we can brainstorm it. Need to understand the implications. But I agree with Oscar- aim for fine grain targets or you’ll have many problems with bazel
    For context Oscar is the previous maintainer of rules scala and I am the current maintainer of it
    Carlos Sanchez
    Ok, I will create the issue still, but for now I will create separate targets which will achieve parallelism, in order to do this I will refactor some classes and be more specific about the features to be tested in each target
    Ittai Zeidman
    Btw. Don’t know the stage you’re in but if you’re in an initial I recommend you take a look at exodus which is a project aimed at migrating maven projects to fine grain bazel targets. We (Wix) used it to migrate ~10MLOC
    Carlos Sanchez

    @ittaiz @johnynek I have one more question, in order for the targets to be executed in parallel, do I need to have a main build file which calls them?

      name = "build_all",
      srcs = [

    Will doing it like this make the execution sequential instead of parallel?

    Again, perhaps you already answered this (most likely you have in previous answers), I just want to get familiar with this, sorry for all this questions

    Btw. Don’t know the stage you’re in but if you’re in an initial I recommend you take a look at exodus which is a project aimed at migrating maven projects to fine grain bazel targets. We (Wix) used it to migrate ~10MLOC

    Amazing! Well, most of the things have been migrated, however, there are still some that haven't been, so this will come handy, I started looking into it yesterday :)

    P. Oscar Boykin
    no, you don't want to do that... you want to look at bazel test suites
    each test target should be a scala_test... those are atomic.... those will be run by a single process by bazel.
    you control your test parallelism by splitting those targets.
    note: fine grain test targets also results in better test caching in your CI. If you have big mega targets in bazel, you don't get much mileage out of using bazel honesty
    Joe Netti
    Hi, can someone help me using scala_import?
    P. Oscar Boykin
    what is your question?
    PS: it is generally best to just ask because now I'm stepping away a bit and you will have to wait for another RTT for the next response
    Joe Netti
    sounds good. I'm going to get a more specific question and get back to you
    Joe Netti
    Hi, I'm trying to use play framework with bazel. However, scala_binary requires a main class and there is no main for play framework. I see this repo but I can't seem to duplicate it. What do I set main_class to?
    Joe Netti
    Screen Shot 2020-12-22 at 5.05.13 PM.png
    (this doesn't work) ^^
    Peter Hrvola

    Hello, I'm getting a bit weird error when defining custom dependencies with scala_proto. I've followed the docs at https://github.com/bazelbuild/rules_scala/blob/master/docs/scala_proto_library.md I've added the scalapb_toolchain and default_deps_toolchain but I'm getting error

    File "/private/var/tmp/_bazel_hrvolap/cbad7e6dac15bf07632f0b5b890ca227/external/io_bazel_rules_scala/scala/private/toolchain_deps/toolchain_deps.bzl", line 13, column 9, in _lookup_provider_by_id
            fail(_required_deps_id_message(ctx.attr.name, toolchain_type_label, deps_id))
    Error in fail: scalapb_worker_deps requires mapping of scalapb_worker_deps provider id on the toolchain @io_bazel_rules_scala//scala_proto:deps_toolchain_type

    which seems like needs to be added to toolchain, but when I added it as a dep_provider to the default_deps_toolchain I get dependency cycle.

    Also the whole story why I want custom dependencies because grpc client dependency is overlapping with dependencies for bigtable and version are not compatible

    Peter Hrvola

    I've redefined in my workspace

        name = "scalapb_worker_deps_provider",
        deps_id = "scalapb_worker_deps",
        visibility = ["//visibility:public"],
        deps = [

    and included it in default_deps_toolchain, then everything worked

    Sebastian Voss
    Hi, I'm running into a java.lang.StackOverflowError on bazel build -s //.... I already tried to increase the stack size with bazel --host_jvm_args=-Xss32m build -s //... but it does not show any effect. Is this the right way to increase it?
    Krish Narukulla
    how do query/list installed maven dependencies?

    Hi, guys, greetings. I have trouble in generating dependencies by bazel-deps,
    here is my config in dependencies.yaml

          lang: scala
          version: "2.1.0"

    it gave me

    [ForkJoinPool-1-worker-15] ERROR bazel_deps.CoursierResolver - not found: https://repo.maven.apache.org/maven2/org/scalamacros/paradise_2.12/2.1.0/paradise_2.12-2.1.0.pom

    but actually I want https://repo.maven.apache.org/maven2/org/scalamacros/paradise_2.12.0/2.1.0/paradise_2.12.0-2.1.0.pom
    is it anything wrong in my dependencies.yaml? Thank you guys so much :-)

    And the X question is I want org.scalamacros.paradise in plugins when I define scala_library, and I need to add this into my dependencies.
    Daniel LaFlamme
    is there any way to override URLs specified here without changing the code? https://github.com/bazelbuild/rules_scala/blob/master/scala/scala_cross_version.bzl#L18
    meaning, override when using rules_scala in bazel WORKSPACE file
    Daniel LaFlamme
    for others, the answer appears to be "NO". Potential solutions are using the functionality here: bazelbuild/bazel#12170, or doing something similar with an HTTP/HTTPs proxy.