1

we are trying to create a Scala project which uses Spark also but we are facing issue Encountered error while reading extension file 'intellij_info_bundled.bzl': no such package '@intellij_aspect//': No WORKSPACE file found in C:/users//_bazel_user/i45wuf6d/external/intellij_aspect. Is it has something missing in Intellij?

Scala file

package src.main.scala

object HelloWorld extends App {
 def main(args: Array[String]) {
     println("Hello, world!")

} }

Build file

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
   )

Work Space

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()

Command and Error from console

Command: 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

INFO: Loading complete. Analyzing... ERROR: Encountered error while reading extension file 'intellij_info_bundled.bzl': no such package '@intellij_aspect//': No WORKSPACE file found in C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/external/intellij_aspect. INFO: Found 3 targets... WARNING: failed to create one or more convenience symlinks for prefix 'bazel-': cannot create symbolic link bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: Cannot create junction (name=C:\users\admin\scalaprojects\example1\bazel-out, target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: 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): ERROR: src/main/native/windows/file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): Cannot create a file when that file already exists.

cannot create symbolic link bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: Cannot create junction (name=C:\users\admin\scalaprojects\example1\bazel-out, target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: 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): ERROR: src/main/native/windows/file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): Cannot create a file when that file already exists. . INFO: Building... ERROR: command succeeded, but not all targets were analyzed. INFO: Elapsed time: 18.108s, Critical Path: 0.05s Make failed

This is a sample Helloworld program only

Sandhya
  • 51
  • 1
  • 3
  • 1
    More info is needed. Which version of IntelliJ, plugin, rules_scala, how do you consume dependencies, were you able to do a hello-world scala project? – Ittai Jul 11 '18 at 17:15
  • @Ittai intelliJ is 2017.3.5 community edition – Sandhya Jul 11 '18 at 18:01
  • 1
    The bazel IntelliJ is running fast. Please try with 2018.1.5, latest plugin and latest rules_scala – Ittai Jul 11 '18 at 18:04
  • @Ittai As per our Proj requirement we have to use this version , I have updated the code and error details also kindly assist me in finding where I am wrong – Sandhya Jul 11 '18 at 19:22
  • 1
    I'm sorry but I'm really not sure it will work. I suggest you open an issue in intellij bazel plugin (https://github.com/bazelbuild/intellij). I'm pretty certain they'll say these older versions aren't supported anymore – Ittai Jul 11 '18 at 19:25

1 Answers1

1

In general, like @Ittai, I would suggest you open an issue in the intellij plugin github repo.

Unfortunately, your version of the plugin is no longer supported. I, too, previously ran into an issue with an older version of the plugin and was recommended to upgrade to the latest version. Which resolved the specific issue I was facing.

When reporting the issue make sure to include the following bits of information:

  • intellij build number
  • plugin version number
  • rules_scala version
  • operating system (it seems your using Windows, while most users use unix based systems)
  • bazel release number
  • how you have opened the intellij project (BUILD file, WORKSPACE, .blazeproject)

Additionally, to verify this is in fact an issue with the plugin, I would also suggest you try to reproduce this issue on a Unix based system. It seems you are using Intellij compile on Windows. This may be Windows specific issue with aspects not being recognized.

When attempting to reproduce, make sure to clone your repository in a separate directory, close the intellij project, and reopen the project

petros-eskinder
  • 244
  • 1
  • 11