Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Tobias Johansson
    @tobias-johansson
    Hi, Am I right in thinking that the scala rules (e.g. scala_library) currently doesn't add transitive dependencies to compile classpath? (the way java rules does with --strict_java_deps=off) indicated here: bazelbuild/rules_scala#235
    Any workaround to this, or do I simply need to add all actual deps (as part of migrating off maven)?
    Ittai Zeidman
    @ittaiz
    @tobias-johansson I’m mostly over at the bazelbuild slack channel then here so expect long silences from me (though Ian is very responsive here).
    You’re right that rules_scala by default adds only direct dependencies but it has a strictdeps mode of warm and error which you can probably use for your needs. This is how we started out though we had a few other tools we’ve built like exodus (available on github)
    Tobias Johansson
    @tobias-johansson
    Ok thanks @ittaiz
    Ittai Zeidman
    @ittaiz
    Also there is work underway for improving strict deps so might be worth keeping tabs on the repo
    pr0ton
    @pr0ton

    Hey folks - trying to use bazel for a demo project (on my personal dev machine not behind some corporate firewall). this is the error i get ERROR: /home/ptandel/.cache/bazel/_bazel_ptandel/1dcc102f10d8db6f292e788f608253ba/external/io_bazel_rules_scala/scala/scala.bzl:561:5: //external:io_bazel_rules_scala/dependency/scala/scala_reflect depends on @io_bazel_rules_scala_scala_reflect//:io_bazel_rules_scala_scala_reflect in repository @io_bazel_rules_scala_scala_reflect which failed to fetch. no such package '@io_bazel_rules_scala_scala_reflect//': java.io.IOException: Error downloading [http://central.maven.org/maven2/org/scala-lang/scala-reflect/2.11.12/scala-reflect-2.11.12.jar] to /home/ptandel/.cache/bazel/_bazel_ptandel/1dcc102f10d8db6f292e788f608253ba/external/io_bazel_rules_scala_scala_reflect/scala-reflect-2.11.12.jar: Unknown host: central.maven.org

    IIRC central.maven.org doesn't seem to be valid but i couldn't figure out how to specify something else (short of using a HTTP(S) proxy which I'm not sure would solve my problem)?

    pr0ton
    @pr0ton
    so seems like setting rules_scala_version to the newest version did it!
    Alex Wied
    @radix-alex_gitlab

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