Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Vadim Anufriev
    @va-anufriev

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

    https://github.com/bazelbuild/rules_scala#selecting-scala-version

    Ittai Zeidman
    @ittaiz
    Hi,
    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
    @parkergordonio
    This room is more active than "Bazel Users" :smile:
    Andy Hamon
    @andrewhamon
    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
    @carlosesh
    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
    @johnynek
    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
    @ittaiz
    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
    @carlosesh
    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
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.0</version>
        <configuration>
            <parallel>methods</parallel>
            <useUnlimitedThreads>true</useUnlimitedThreads>
        </configuration>
    </plugin>
    Ittai Zeidman
    @ittaiz
    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
    @carlosesh
    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
    @ittaiz
    This is exactly what I referred to in my previous message
    We don’t support that == we don’t support method parallelism
    Carlos Sanchez
    @carlosesh
    ah, makes sense, well, this was fruitful, thanks for sharing your knowledge on the topic @ittaiz
    P. Oscar Boykin
    @johnynek
    to be clear: bazel runs separate test targets in parallel already
    that is where the parallelism is "supposed" to come from.
    Ittai Zeidman
    @ittaiz
    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
    @carlosesh
    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
    @ittaiz
    Indeed
    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
    @carlosesh

    @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?

    filegroup(
      name = "build_all",
      srcs = [
        "//services/service1:build",
        "//services/service2:build",
        "//services/service3:build",
      ]
    )

    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
    @johnynek
    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
    @nettijoe96
    Hi, can someone help me using scala_import?
    P. Oscar Boykin
    @johnynek
    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
    @nettijoe96
    sounds good. I'm going to get a more specific question and get back to you
    Joe Netti
    @nettijoe96
    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
    @nettijoe96
    Screen Shot 2020-12-22 at 5.05.13 PM.png
    (this doesn't work) ^^
    Peter Hrvola
    @hrvolapeter

    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
    @hrvolapeter

    SOLVED
    I've redefined in my workspace

    declare_deps_provider(
        name = "scalapb_worker_deps_provider",
        deps_id = "scalapb_worker_deps",
        visibility = ["//visibility:public"],
        deps = [
            "@com_google_protobuf//:protobuf_java",
            "//third_party/jvm/com/thesamet/scalapb:protoc_bridge",
            "//third_party/jvm/com/thesamet/scalapb:compilerplugin",
        ],
    )

    and included it in default_deps_toolchain, then everything worked

    Sebastian Voss
    @sebastianvoss
    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
    @krisnaru
    how do query/list installed maven dependencies?
    latyas
    @ly0

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

      org.scalamacros:
        paradise:
          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
    @dlaflamme
    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
    @dlaflamme
    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.
    Rohit Ramprasad
    @rrampr
    Hello!
    We are using scalapb with bazel and not sbt. Is there a way to flip on javaConversions=true with bazel so I can get the nice sauce methods like toJavaProto and fromJavaProto. The scalapb docs only show how to enable this with sbt https://scalapb.github.io/docs/sbt-settings/
    Mark de Jong
    @Fristi

    Hi there!

    What is the recommend way of working with scala and bazel? I've tried a setup with bazelbuild/rules_scala and rules_jvm_external. With that I get compile errors saying there are missing classes on the classpath. Like described here: bazelbuild/rules_jvm_external#578

    I was expecting the rules_jvm_external would resolve the transitive dependencies, but this seems not the case.

    Mark de Jong
    @Fristi
    I also came across greyhound which is a kafka zio client but depends on a fork of rules_scala. Did not try it yet, but I wonder what's the best way forward