Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Trouble starting a project #191

Closed
Parth opened this issue Jun 18, 2019 · 7 comments
Closed

Trouble starting a project #191

Parth opened this issue Jun 18, 2019 · 7 comments

Comments

@Parth
Copy link

Parth commented Jun 18, 2019

Trying to get off the ground with bazel, but having trouble with a minimal example: when I bazel build :scalabook for example I get the following error:

WARNING: /private/var/tmp/_bazel_parth.mehrotra/56e65e76c6e5acbbd30fd286bccbe6a3/external/bazel_tools/tools/jdk/BUILD:116:1: in alias rule @bazel_tools//tools/jdk:java: target '@bazel_tools//tools/jdk:java' depends on deprecated target '@local_jdk//:java': Don't depend on targets in the JDK workspace; use @bazel_tools//tools/jdk:current_java_runtime instead (see https://github.com/bazelbuild/bazel/issues/5594)
WARNING: /private/var/tmp/_bazel_parth.mehrotra/56e65e76c6e5acbbd30fd286bccbe6a3/external/rules_scala_annex/src/main/scala/higherkindness/rules_scala/common/args/BUILD:4:1: in scala_library rule @rules_scala_annex//src/main/scala/higherkindness/rules_scala/common/args:args: target '@rules_scala_annex//src/main/scala/higherkindness/rules_scala/common/args:args' depends on deprecated target '@local_jdk//:java': Don't depend on targets in the JDK workspace; use @bazel_tools//tools/jdk:current_java_runtime instead (see https://github.com/bazelbuild/bazel/issues/5594)
ERROR: /private/var/tmp/_bazel_parth.mehrotra/56e65e76c6e5acbbd30fd286bccbe6a3/external/rules_scala_annex/src/main/scala/higherkindness/rules_scala/common/args/BUILD:4:1: in scala_library rule @rules_scala_annex//src/main/scala/higherkindness/rules_scala/common/args:args:
Traceback (most recent call last):
        File "/private/var/tmp/_bazel_parth.mehrotra/56e65e76c6e5acbbd30fd286bccbe6a3/external/rules_scala_annex/src/main/scala/higherkindness/rules_scala/common/args/BUILD", line 4
                scala_library(name = 'args')
        File "/private/var/tmp/_bazel_parth.mehrotra/56e65e76c6e5acbbd30fd286bccbe6a3/external/rules_scala_annex/rules/scala.bzl", line 203, in _scala_library_implementation
                _run_phases(ctx, [("resources", _phase_resourc...)])
        File "/private/var/tmp/_bazel_parth.mehrotra/56e65e76c6e5acbbd30fd286bccbe6a3/external/rules_scala_annex/rules/private/phases/api.bzl", line 28, in _run_phases
                function(ctx, g)
        File "/private/var/tmp/_bazel_parth.mehrotra/56e65e76c6e5acbbd30fd286bccbe6a3/external/rules_scala_annex/rules/private/phases/phase_javainfo.bzl", line 25, in function
                java_common.run_ijar(ctx.actions, jar = ctx.outputs.jar, <2 more arguments>)
expected value of type 'JavaToolchainSkylarkApiProvider' for parameter 'java_toolchain', for call to method run_ijar(actions, jar, target_label = None, java_toolchain) of 'java_common'
ERROR: Analysis of target '//:scalabook' failed; build aborted: Analysis of target '@rules_scala_annex//src/main/scala/higherkindness/rules_scala/common/args:args' failed; build aborted
INFO: Elapsed time: 0.076s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
@SrodriguezO
Copy link
Collaborator

Hey @Parth I'm having trouble reproducing this issue using the same version of higherkindness/rules_scala you're using in your WORKSPACE file. What version of bazel are you using?

@Parth
Copy link
Author

Parth commented Jun 18, 2019

Build label: 0.27.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Jun 17 13:03:58 2019 (1560776638)
Build timestamp: 1560776638
Build timestamp as int: 1560776638

@SrodriguezO
Copy link
Collaborator

Hmmm higherkindness/rules_scala doesn't support that version of Bazel, but I'd expect different errors if that were the cause. Let me test it real quick

@SrodriguezO
Copy link
Collaborator

SrodriguezO commented Jun 18, 2019

That was the issue.. Just reproduced it with Bazel 0.27.0; I expected a different error to be thrown, however ("The requested Bazel version '$bazel_version' is not supported")

Currently, higherkindness/rules_scala officially supports Bazel versions 0.24.1 and 0.25.2. I'll open a new issue to figure out why the build didn't fail sooner and with the correct error. Sorry about the confusion.

@Parth
Copy link
Author

Parth commented Jun 18, 2019

No worries, got similar feedback here, this is the rules set I'm interested in using so I'll grab 0.25

@SrodriguezO
Copy link
Collaborator

Sweet. Make sure you grab 0.25.2 :)

Hopefully we can get compatibility with newer versions in the near future. Let us know if you run into any other issues!

@Parth
Copy link
Author

Parth commented Jun 18, 2019

Awesome, thanks again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants