Closed mbland closed 4 weeks ago
Fixes //third_party/utils/src/test:test_util for Scala 2.13.9 and later by providing a thin scala.tools.cmd.CommandLineParser adapter. Part of #1482.
scala.tools.cmd.CommandLineParser
Before this change, building under Scala 2.13.14 produced:
$ bazel build --repo_env=SCALA_VERSION=2.13.14 \ //third_party/utils/src/test:test_util ERROR: .../third_party/utils/src/test/BUILD:6:14: scala @@//third_party/utils/src/test:test_util failed: (Exit 1): scalac failed: error executing Scalac command (from target //third_party/utils/src/test:test_util) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/src/java/io/bazel/rulesscala/scalac/scalac @bazel-out/darwin_arm64-fastbuild/bin/third_party/utils/src/test/test_util.jar-0.params third_party/utils/src/test/io/bazel/rulesscala/utils/TestUtil.scala:10: error: object cmd is not a member of package tools import scala.tools.cmd.CommandLineParser ^ third_party/utils/src/test/io/bazel/rulesscala/utils/TestUtil.scala:119: error: not found: value CommandLineParser val options = CommandLineParser.tokenize(compileOptions) ^
Turns out CommandLineParser disappered in Scala 2.13.9, and its Parser replacement is private:
CommandLineParser
Parser
Description
Fixes //third_party/utils/src/test:test_util for Scala 2.13.9 and later by providing a thin
scala.tools.cmd.CommandLineParser
adapter. Part of #1482.Motivation
Before this change, building under Scala 2.13.14 produced:
Turns out
CommandLineParser
disappered in Scala 2.13.9, and itsParser
replacement is private: