Hi all,
I'm trying to compile some scala code that uses ScalaTest, but I'm seeing errors like the following:
error: exception during macro expansion:
java.lang.NoClassDefFoundError: scala/runtime/LazyRef
at org.scalactic.MacroOwnerRepair$Utils.repairOwners(MacroOwnerRepair.scala:66)
at org.scalactic.MacroOwnerRepair.repairOwners(MacroOwnerRepair.scala:46)
at org.scalactic.BooleanMacro.genMacro(BooleanMacro.scala:837)
at org.scalatest.AssertionsMacro$.assert(AssertionsMacro.scala:34)
at jdk.internal.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers$$anonfun$resolveJavaReflectionRuntime$2.apply(JavaReflectionRuntimes.scala:34)
at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers$$anonfun$resolveJavaReflectionRuntime$2.apply(JavaReflectionRuntimes.scala:22)
at scala.tools.nsc.typechecker.Macros$class.macroExpandWithRuntime(Macros.scala:763)
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.
(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.
scala_repositories((
"2.12.10",
{
"scala_compiler": "cedc3b9c39d215a9a3ffc0cc75a1d784b51e9edc7f13051a1b4ad5ae22cfbc0c",
"scala_library": "0a57044d10895f8d3dd66ad4286891f607169d948845ac51e17b4c1cf0ab569d",
"scala_reflect": "56b609e1bab9144fb51525bfa01ccd72028154fc40a58685a1e9adcbe7835730",
},
))
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
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#235Hey 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)?
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
.
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" ]
).
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
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?