Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Bardur Arantsson
    @BardurArantsson

    My dependencies.yml contains this:

      org.scalatest:
        scalatest_2.12:
          version: "3.0.5"
          lang: scala/unmangled
    
      org.scalactic:
        scalactic_2.12:
          lang: scala/unmangled

    (I'm using bazel_deps.)

    and in the BUILD file I have

    scala_import(
        name = "scalatest",
        jars = [
            "//3rdparty/jvm/org/scalatest:scalatest_2_12",
            "//3rdparty/jvm/org/scalactic:scalactic_2_12",
        ],
    )

    and my project (defined in the same BUILD file) then lists :scalatest as a dep.

    I gather that this is some sort of problem with Scala Macros, but I'm a total Bazel noob and could definitely use some hints on why this doesn't work :)

    (Based on some Googling, I've tried to supply --nouse_ijars, but that doesn't seem to have any effect. I suppose that's perhaps just for macros defined inside the repo itself and no external macros?)

    Oh, yes, and I've also tried with regular 'scala' dependencies rather than scala/unmangled, but I'm guessting that that shouldn't really matter.

    Ghost
    @ghost~54c6a0bddb8155e6700f1b4a
    You shouldn’t need the scala import. Those 3rd party targets are already scala imports I think
    I suspect there’s an export maybe needed. Can you put some repo case in a github repo so I can look ?
    Bardur Arantsson
    @BardurArantsson

    It's unfortunately the code is proprietary, and it would quite a lot of work to disentangle the build bits from the code :(

    Would just having the full contents of dependencies.yml + BUILD help diagnosing it? (Those aren't proprietary)

    I should say, btw, that the code I'm compiling is using scala_library not scala_test (it's basically a test-kit type thing where I expect other libraries to depend on it for their own tests).
    Bardur Arantsson
    @BardurArantsson
    Nvm, actually I'm dumb... It shouldn't actually be too hard to just strip away all the code. BRB.
    Ghost
    @ghost~54c6a0bddb8155e6700f1b4a
    Ok great.
    Bardur Arantsson
    @BardurArantsson
    Ghost
    @ghost~54c6a0bddb8155e6700f1b4a
    @BardurArantsson your compiling against Scala 2.11
    happily a relatively easy fix there
    ignoring the updates from running the bazel-deps tool, that's the diff I have
    most of it is just cleaning some stuff up to maybe bit a little simpler for you, so thats largely ignorable
    scala_repositories((
      "2.12.10",
      {
          "scala_compiler": "cedc3b9c39d215a9a3ffc0cc75a1d784b51e9edc7f13051a1b4ad5ae22cfbc0c",
          "scala_library": "0a57044d10895f8d3dd66ad4286891f607169d948845ac51e17b4c1cf0ab569d",
          "scala_reflect": "56b609e1bab9144fb51525bfa01ccd72028154fc40a58685a1e9adcbe7835730",
      },
    ))
    Thats the key bit you need to ddo
    Bardur Arantsson
    @BardurArantsson
    D'oh... Of course it was something simple... just been staring at it for so long...
    Thank you so much for the help!
    Just a quick question: What is the "export" bit doing? Does it just mean that scalactic will be "bundled" into the "//3rdparty/jvm/org/scalatest:scalatest" target?
    Ghost
    @ghost~54c6a0bddb8155e6700f1b4a
    no problem
    Alex Wied
    @radix-alex_gitlab
    Hi. I have two targets within a package, foo-lib and foo-bin. I see that the rules_scala rules produce separate JARs in the bazel-bin directory. I would like to produce a single JAR which contains all dependencies. How should I proceed? I am using bazel version 1.2.1.
    Ghost
    @ghost~54c6a0bddb8155e6700f1b4a
    @radix-alex_gitlab You want all the transitive dependencies is it?
    Alex Wied
    @radix-alex_gitlab
    Indeed.
    Ghost
    @ghost~54c6a0bddb8155e6700f1b4a
    bazel build my package:foo-bin_deploy.jar
    the binary targets have an extra output (java has the same thing), that is a fat jar which would contain the full set of transitive deps
    Alex Wied
    @radix-alex_gitlab
    That seems to be what I'm looking for. Thanks!
    Ittai Zeidman
    @ittaiz

    Hi,
    Next week I'm merging a huge PR which effectively rewrites rule.
    It has ben under review for 2 months and we've ran it through severa very large codebases (Wix's ~10MLOC passes with it) but I'd still suggest other companies to take it out for a spin and report on the PR bazelbuild/rules_scala#865.

    On a related note I'll say that I'm not really looking here and I've moved to bazelbuild slack's org (#scala) so you're invited there as well.
    Happy holidays

    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