ATTENTION! Please read and follow:
- if this is a _question_ about how to build / test / query / deploy using Bazel, ask it on StackOverflow instead: https://stackoverflow.com/questions/tagged/bazel
- if this is a _discussion starter_, send it to [email protected]
- if this is a _bug_ or _feature request_, fill the form below as best as you can.
bazel builds using gcr.io/cloud-builders/bazel failing with null pointer exception.
Step #3: Caused by: java.lang.NullPointerException
Step #3: at com.google.devtools.build.lib.rules.objc.CompilationSupport.getFeatureConfiguration(CompilationSupport.java:560)
Step #3: at com.google.devtools.build.lib.rules.objc.CompilationSupport.compile(CompilationSupport.java:319)
Step #3: at com.google.devtools.build.lib.rules.objc.CompilationSupport.ccCompileAndLink(CompilationSupport.java:396)
gcloud builds submit --config=config.yaml --no-source
where config.yaml is:
````
steps:
Running via cloud build, so Ubunto
bazel info release?That's not easy to run the way I'm running this.
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?That's not easy to get the way I'm running this.
No.
Problem started between Sept. 16th 2pm and Sept. 17th 2pm. My bazel builds of tensorflow are also failing at the same point: (tensorflow config file).
My builds of kubernetes (configured the same way, with kubernetes config file) are successful.
Can you provide us with a series of git clone steps and bazel build commands that reproduce the problem?
The problem seems to be with the bazel in the docker image gcr.io/cloud-builders/bazel. That version of bazel is release 0.17.1. (Found by adding a build step that does bazel info release.)
As it happens, 0.17.1 is what I have installed on my local machine, so I can easily provide reproduction instructions that don't use cloud build.
git clone https://github.com/bazelbuild/bazel.git
cd bazel
bazel build ... --keep_going
If it's confusing that bazel is both the build system and the thing being built, use tensorflow as your reproduction example:
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
bazel build ... --keep_going
Does this image (with 0.17.1) build tensorflow correctly?
On Wed, 19 Sep 2018 at 20:42 Kris Hildrum notifications@github.com wrote:
The problem seems to be with the bazel in the docker image
gcr.io/cloud-builders/bazel. That version of bazel is release 0.17.1.
(Found by adding a build step that does bazel info release.)As it happens, 0.17.1 is what I have installed on my local machine, so I
can easily provide reproduction instructions that don't use cloud build.git clone https://github.com/bazelbuild/bazel.git
cd bazel
bazel build ... --keep_goingIf it's confusing that bazel is both the build system and the thing being
built, use tensorflow as your reproduction example:https://github.com/tensorflow/tensorflow.git
cd tensorflow
bazel build ... --keep_going—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/bazelbuild/bazel/issues/6182#issuecomment-422894663,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABUIF4TuOsYaf5mVuThrY9ENQq46dIHmks5ucoIMgaJpZM4WwScW
.
No. Both blocks I added above give the same stack trace.
I’m sorry if I’m stating the obvious but are you saying you think any bazel
build using the latest cloud-builders image fails?
On Thu, 20 Sep 2018 at 8:21 Kris Hildrum notifications@github.com wrote:
No. Both blocks I added above give the same stack trace.
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/bazelbuild/bazel/issues/6182#issuecomment-423043538,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABUIF0bLWv4GUKgqrGfZauIebKRfPn6mks5ucyXJgaJpZM4WwScW
.
Hi Tony,
this happens on line 560 of CompilationSupport.java. The X code version is sometimes null and the code doesn't check for that. Assigning this to you, maybe you have more context of how the code should behave when the version is null.
Are you trying to build an ios_application with objc sources? That won't work in ubuntu, and I'm not familiar with any RBE environment that supports Apple builds.
I should clarify my weird use case. I'm building both these projects to generate cross-references; my build command attempts to build all targets, and there are normally many errors which I ignore (that's the reason for the --keep-going). But until recently, enough targets were built to get cross references. So the fact that //tools/objc:dummy_lib doesn't build is fine with me; the fact that its failure stops anything else from building is what is causing me a problem.
So to @ittaiz's question: if this exception only comes up on targets that are unbuildable for a particular os, I may be the only one affected.
Yes, we should definitely not crash. The null pointer exception should be caught and dealt with properly. Maybe Tony knows what the correct behavior should be in this case, if a reasonable value for the version should be used or there should be some other error handling.
Not an EngProd bug, reassigning to Apple team.
I got the similar issue, I'm pretty sure it only start to happen after I pulled latest recently. When I trigger syncing in IntelliJ:
Syncing project: Partial Sync (partial)...
Updating VCS...
Running Bazel info...
Command: /usr/local/bin/bazel info --tool_tag=ijwb:IDEA:ultimate --curses=no --color=yes --experimental_ui=no --progress_in_terminal_title=no --
Command: git diff --name-status --no-renames b629238a8af71ae5262e69e423d18cbe8f0687af
Computing VCS working set...
.bazelci/nightly.yml (added)
.bazelci/postsubmit.yml (modified)
.bazelci/presubmit.yml (modified)
.gitattributes (modified)
CHANGELOG.md (modified)
CODEOWNERS (modified)
WORKSPACE (modified)
scripts/bootstrap/compile.sh (modified)
scripts/packages/debian/BUILD (modified)
scripts/packages/debian/control (modified)
scripts/release/common.sh (modified)
site/_layouts/documentation.html (modified)
site/docs/android-instrumentation-test.md (modified)
site/docs/bazel-and-cpp.md (modified)
site/docs/bazel-container.md (added)
site/docs/bazel-overview.md (modified)
site/docs/best-practices.md (modified)
site/docs/build-ref.html (modified)
site/docs/configurable-attributes.md (modified)
site/docs/crosstool-reference.md (added)
(and 819 more)
Sync targets from Partial Sync:
//...:all
Building IDE info files...
Command: /usr/local/bin/bazel build --tool_tag=ijwb:IDEA:ultimate --keep_going --build_event_binary_file=/var/folders/hq/xc823d1x0y157v7k_swfl7wc0000gn/T/intellij-bep-7a3552f3-2082-46df-bbf9-d7d6e29c21d6 --nobuild_event_binary_file_path_conversion --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=/Users/hoaphan/Library/Application Support/IntelliJIdea2018.2/ijwb/aspect --output_groups=intellij-info-generic,intellij-info-java,intellij-info-py -- //...:all
INFO: Loading package:
INFO: Loading package: examples/android/java/bazel
INFO: Loading package: src/test/java/com/google/devtools/build/lib/blackbox/junit
INFO: Loading package: src/main/java/com/google/devtools/build/lib/remote/logging
INFO: Loading complete. Analyzing...
INFO: Loading package: @bazel_tools//platforms
INFO: Loading package: @bazel_tools//tools/bash/runfiles
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/j2objc/BUILD:26:1: no such target '//third_party/java/j2objc:proto_plugin': target 'proto_plugin' not declared in package 'third_party/java/j2objc' defined by /Users/hoaphan/dev/code/forked/bazel/third_party/java/j2objc/BUILD and referenced by '//tools/j2objc:j2objc_proto_toolchain'.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/j2objc/BUILD:26:1: no such target '//third_party/java/j2objc:proto_runtime': target 'proto_runtime' not declared in package 'third_party/java/j2objc' defined by /Users/hoaphan/dev/code/forked/bazel/third_party/java/j2objc/BUILD and referenced by '//tools/j2objc:j2objc_proto_toolchain'.
INFO: Loading package: @bazel_toolchains//configs/debian8_clang/0.2.0/bazel_0.9.0
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/test/BUILD:36:1: no such package '@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator': BUILD file not found on package path and referenced by '//tools/test:coverage_report_generator'.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/jdk/BUILD:32:17: in java_home attribute of java_runtime rule //tools/jdk:absolute_javabase: $(ABSOLUTE_JAVABASE) not defined.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/BUILD:92:18: in toolchains attribute of cc_toolchain_suite rule //tools/cpp:default-toolchain: rule '//tools/cpp:cc-compiler-local-local' does not exist.
INFO: Loading package: @mount_path_toolchain//file
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/BUILD:92:18: in toolchains attribute of cc_toolchain_suite rule //tools/cpp:default-toolchain: rule '//tools/cpp:cc-compiler-local-k8' does not exist.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/BUILD:92:18: in toolchains attribute of cc_toolchain_suite rule //tools/cpp:default-toolchain: rule '//tools/cpp:cc-compiler-local-piii' does not exist.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/BUILD:92:18: in toolchains attribute of cc_toolchain_suite rule //tools/cpp:default-toolchain: rule '//tools/cpp:cc-compiler-local-arm' does not exist.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/BUILD:92:18: in toolchains attribute of cc_toolchain_suite rule //tools/cpp:default-toolchain: rule '//tools/cpp:cc-compiler-local-aarch64' does not exist.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/BUILD:92:18: in toolchains attribute of cc_toolchain_suite rule //tools/cpp:default-toolchain: rule '//tools/cpp:cc-compiler-local-s390x' does not exist.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/BUILD:92:18: in toolchains attribute of cc_toolchain_suite rule //tools/cpp:default-toolchain: rule '//tools/cpp:cc-compiler-local-ppc' does not exist.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/BUILD:92:18: in toolchains attribute of cc_toolchain_suite rule //tools/cpp:default-toolchain: rule '//tools/cpp:cc-compiler-local-ppc64' does not exist.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/jdk/BUILD:337:1: no such package '@remotejdk10_macos//': The repository could not be resolved and referenced by '//tools/jdk:remote_jdk10'.
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/jdk/BUILD:320:1: no such package '@remotejdk_macos//': The repository could not be resolved and referenced by '//tools/jdk:remote_jdk'.
INFO: Loading package: @bazel_tools//third_party/py/six
ERROR: /Users/hoaphan/dev/code/forked/bazel/tools/cpp/runfiles/BUILD:58:1: in cc_library rule //tools/cpp/runfiles:runfiles_src_for_singlejar_only: non-test target '//tools/cpp/runfiles:runfiles_src_for_singlejar_only' depends on testonly target '//tools/cpp/runfiles:runfiles' and doesn't have testonly attribute set.
INFO: Loading package: @bazel_tools//src/tools/android/java/com/google/devtools/build/android/ziputils
ERROR: /Users/hoaphan/dev/code/forked/bazel/scripts/packages/BUILD:57:2: no such target '//src:bazel_with_jdk.exe': target 'bazel_with_jdk.exe' not declared in package 'src' defined by /Users/hoaphan/dev/code/forked/bazel/src/BUILD and referenced by '//scripts/packages:zip-bazel-exe_with_jdk'.
ERROR: /Users/hoaphan/dev/code/forked/bazel/src/tools/singlejar/BUILD:490:11: in cmd attribute of genrule rule //src/tools/singlejar:stored_jar: label '@bazel_tools//tools/jdk:current_java_runtime' in $(location) expression expands to more than one file, please use $(locations @bazel_tools//tools/jdk:current_java_runtime) instead. Files (at most 5 shown) are: [external/embedded_jdk/bin/appletviewer, external/embedded_jdk/bin/extcheck, external/embedded_jdk/bin/idlj, external/embedded_jdk/bin/jar, external/embedded_jdk/bin/jarsigner].
ERROR: /Users/hoaphan/dev/code/forked/bazel/third_party/protobuf/3.6.1/BUILD:500:1: no such target '//external:gtest': target 'gtest' not declared in package 'external' defined by /Users/hoaphan/dev/code/forked/bazel/WORKSPACE and referenced by '//third_party/protobuf/3.6.1:test_plugin'.
INFO: Loading package: @bazel_tools//src/tools/singlejar
INFO: Loading package: @local_bazel_source_list//
ERROR: /Users/hoaphan/dev/code/forked/bazel/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/BUILD:282:1: no such package 'third_party/bazel/src/main/protobuf': BUILD file not found on package path and referenced by '//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps:DumpProto'.
Internal error thrown during build. Printing stack trace: java.lang.RuntimeException: Unrecoverable error while evaluating node '//third_party/protobuf/3.6.1:protobuf_objc BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] false' (requested by nodes '[]#@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] //third_party/protobuf/3.6.1:protobuf_objc BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] false {}')
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:495)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:368)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.execLocalTasks(ForkJoinPool.java:1040)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1058)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.NullPointerException
at com.google.devtools.build.lib.rules.objc.CompilationSupport.getFeatureConfiguration(CompilationSupport.java:560)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.compile(CompilationSupport.java:319)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.ccCompileAndLink(CompilationSupport.java:396)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1040)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1089)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:984)
at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:86)
at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:44)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:319)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:205)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:635)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:777)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:323)
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:418)
... 7 more
INFO: Elapsed time: 9.449s
INFO: 0 processes.
INFO: Waiting for Build Event Protocol upload: 0s
java.lang.RuntimeException: Unrecoverable error while evaluating node '//third_party/protobuf/3.6.1:protobuf_objc BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] false' (requested by nodes '[]#@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] //third_party/protobuf/3.6.1:protobuf_objc BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] false {}')
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:495)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:368)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.execLocalTasks(ForkJoinPool.java:1040)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1058)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.NullPointerException
at com.google.devtools.build.lib.rules.objc.CompilationSupport.getFeatureConfiguration(CompilationSupport.java:560)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.compile(CompilationSupport.java:319)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.ccCompileAndLink(CompilationSupport.java:396)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1040)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1089)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:984)
at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:86)
at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:44)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:319)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:205)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:635)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:777)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:323)
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:418)
... 7 more
java.lang.RuntimeException: Unrecoverable error while evaluating node '//third_party/protobuf/3.6.1:protobuf_objc BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] false' (requested by nodes '[]#@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] //third_party/protobuf/3.6.1:protobuf_objc BuildConfigurationValue.Key[bb1dd85d73e8759d43d1afb993f51867] false {}')
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:495)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:368)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.execLocalTasks(ForkJoinPool.java:1040)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1058)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.NullPointerException
at com.google.devtools.build.lib.rules.objc.CompilationSupport.getFeatureConfiguration(CompilationSupport.java:560)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.compile(CompilationSupport.java:319)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.ccCompileAndLink(CompilationSupport.java:396)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1040)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1089)
at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:984)
at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:86)
at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:44)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:319)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:205)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:635)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:777)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:323)
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:418)
... 7 more
ide-info result: fatal_error
ide-query result: fatal_error
==== TIMING REPORT ====
Sync: 10.5s
BazelInfo: 211ms
GitDiff: 119ms
WorkingSet: 80ms
IdeQuery: 10.1s
ExecuteBlazeCommand: 10.1s
Timing summary:
BlazeInvocation: 10.3s
Other: 199ms
Sync failed
@s50600822
INFO: Loading package: @bazel_toolchains//configs/debian8_clang/0.2.0/bazel_0.9.0
This looks very outdated - can you try with updating your bazel-toolchains repository to the latest release? See https://releases.bazel.build/bazel-toolchains.html for instructions.
Thanks much @philwo that solves the issue.
Most helpful comment
@s50600822
This looks very outdated - can you try with updating your bazel-toolchains repository to the latest release? See https://releases.bazel.build/bazel-toolchains.html for instructions.