【发布时间】:2018-07-11 08:06:06
【问题描述】:
我们正在尝试创建一个也使用 Spark 的 Scala 项目,但我们遇到问题在读取扩展文件“intellij_info_bundled.bzl”时遇到错误:没有这样的包“@intellij_aspect//”:在 C:/ 中找不到 WORKSPACE 文件用户//_bazel_user/i45wuf6d/external/intellij_aspect。 Intellij 中是否缺少某些内容?
Scala 文件
包 src.main.scala
object HelloWorld extends App {
def main(args: Array[String]) {
println("Hello, world!")
} }
构建文件
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library", "scala_test")
scala_library(
name = "hello-world",
srcs = glob(["src/main/scala/*.scala"]),
)
scala_test(
name = "Hello_test",
srcs = glob(["src/main/scala/*.scala"]),
size = "small", # Expect this test to run quickly
)
工作空间
workspace(name = "scala_example")
rules_scala_version="7522c866450cf7810eda443e91ff44d2a2286ba1" # update this as needed
http_archive(
name = "io_bazel_rules_scala",
url = "https://github.com/bazelbuild/rules_scala/archive/%s.zip"%rules_scala_version,
type = "zip",
strip_prefix= "rules_scala-%s" % rules_scala_version
)
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()`enter code here`
# register default scala toolchain
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
来自控制台的命令和错误
命令:C:\ProgramData\chocolatey\bin\bazel.exe build --tool_tag=ijwb:IDEA:community --keep_going --curses=no --color=yes --experimental_ui=no --progress_in_terminal_title=no --aspects=@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect --override_repository=intellij_aspect=C:\Users\ADMIN.IdeaIC2017.3\config\plugins\ijwb\aspect --output_groups=intellij-compile-java,intellij- compile-py -- //...:all
信息:加载完成。分析... 错误:读取扩展文件“intellij_info_bundled.bzl”时遇到错误:没有这样的包“@intellij_aspect//”:在 C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/external/intellij_aspect 中找不到 WORKSPACE 文件。 信息:找到 3 个目标... 警告:未能为前缀“bazel-”创建一个或多个便利符号链接: 无法创建符号链接 bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: 无法创建连接 (name=C:\users\admin\scalaprojects\example1 \bazel-out, target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): 错误: src/main/native/windows/file-jni.cc(86): nativeCreateJunction(C:\users\admin\scalaprojects\example1\bazel-out,C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out):错误:src/main/native/windows /file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): 当文件已经存在时无法创建该文件。
无法创建符号链接 bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: 无法创建连接 (name=C:\users\admin\ scalaprojects\example1\bazel-out,target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out):错误:src/main/native/windows/file-jni.cc( 86):nativeCreateJunction(C:\users\admin\scalaprojects\example1\bazel-out,C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out):错误:src/main/ native/windows/file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): 当文件已经存在时无法创建文件。 . 信息:建筑... 错误:命令成功,但并未分析所有目标。 INFO:经过时间:18.108s,关键路径:0.05s 制作失败
这只是一个示例 Helloworld 程序
【问题讨论】:
-
需要更多信息。哪个版本的 IntelliJ、插件、rules_scala,你是如何消费依赖的,你能做一个 hello-world scala 项目吗?
-
@Ittai intelliJ 是 2017.3.5 社区版
-
bazel IntelliJ 运行速度很快。请尝试使用 2018.1.5,最新的插件和最新的 rules_scala
-
@Ittai 根据我们的 Proj 要求,我们必须使用这个版本,我已经更新了代码和错误详细信息,也请帮助我找出我错的地方
-
很抱歉,但我真的不确定它是否会起作用。我建议你在 intellij bazel 插件 (github.com/bazelbuild/intellij) 中打开一个问题。我很确定他们会说不再支持这些旧版本
标签: bazel bazel-aspect