Closed kolotyluk closed 1 year ago
@kolotyluk, in your WORKSPACE
, make sure you load scala_config
before it is actually used
Now I see the problem... I simply did a copy/paste without really paying attention. The actual documentation reads
# Stores Scala version and other configuration
# 2.12 is a default version, other versions can be use by passing them explicitly:
# scala_config(scala_version = "2.11.12")
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
scala_config()
When it would be better to read
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
# Stores Scala version and other configuration
# 2.12 is a default version, other versions can be use by passing them explicitly:
# scala_config(scala_version = "2.11.12")
scala_config()
Changing my WORKSPACE.bazel
to
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
# Stores Scala version and other configuration
# 2.12 is a default version, other versions can be use by passing them explicitly:
scala_config(scala_version = "3.2.2") # https://www.scala-lang.org/download/all.html
resolves that problem... but leads to different problems
hello-world % bazel build hello-world-scala
ERROR: Traceback (most recent call last):
File "/Users/eric.kolotyluk/git/autonomous-iam/poc/concurrency-laboratory/WORKSPACES/hello-world/WORKSPACE.bazel", line 37, column 40, in <toplevel>
rules_scala_toolchain_deps_repositories(fetch_sources = True)
File "/private/var/tmp/_bazel_eric.kolotyluk/7fcca268af0986a7b0005b8a8b78f542/external/io_bazel_rules_scala/scala/private/macros/scala_repositories.bzl", line 66, column 17, in rules_scala_toolchain_deps_repositories
repositories(
File "/private/var/tmp/_bazel_eric.kolotyluk/7fcca268af0986a7b0005b8a8b78f542/external/io_bazel_rules_scala/third_party/repositories/repositories.bzl", line 54, column 72, in repositories
repository_scala_version = scala_version_by_major_scala_version[SCALA_MAJOR_VERSION]
Error: key "3.2" not found in dictionary
ERROR: Error computing the main repository mapping: Encountered error while reading extension file 'proto/repositories.bzl': no such package '@rules_proto//proto': error loading package 'external': Could not load //external package
Loading:
Maybe Scala 3.x is not supported yet? I will report this in a separate issue.
Maybe Scala 3.x is not supported yet? I will report this in a separate issue.
3.2 should be supported on master. Please note that Scala artifacts for version (3.2.2) are not defined in Rules Scala, they need to be provided by your WORKSPACE. You can use external loader like rules_jvm_external
When it would be better to read
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config") # Stores Scala version and other configuration # 2.12 is a default version, other versions can be use by passing them explicitly: # scala_config(scala_version = "2.11.12") scala_config()
A PR to improve the README would be appreciated!
I am still struggling with getting my documentation PR to work...
Doing the CLA from Firefox does not work, but hopefully now my CLA is correct...
When I follow the README at https://github.com/bazelbuild/rules_scala I get the following results
Which suggests to me, it's related to my
WORKSPACE.bazel
fileAm I doing something wrong here?
If I am doing something wrong here, I will post on Stack Overflow, but if there is something lacking in the documentation, we can settle it here.