bazel: Crash when building `objc_library`
Description of the problem / feature request:
2021/08/17 20:46:00 Using unreleased version at commit cfc2d1d98f827787b80d9c211fc17f97b03c558b
Starting local Bazel server and connecting to it...
Analyzing: target //some:objc_target (40 packages loaded, 537 targets configured)
currently loading: @bazel_tools//src/tools/launcher
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.RuntimeException: Unrecoverable error while evaluating node 'ConfiguredTargetKey{label=//some:objc_target, config=BuildConfigurationValue.Key[759ce837fa28c3e3aaa73b2dc2f899ac4be3297e9cf4724d9361269d6cba6b4b]}' (requested by nodes )
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:644)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:382)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: net.starlark.java.eval.Starlark$UncheckedEvalException: NullPointerException thrown during Starlark evaluation (//some:objc_target)
at <starlark>.create_compilation_attributes(<builtin>:0)
at <starlark>._build_common_variables(/virtual_builtins_bzl/common/objc/compilation_support.bzl:79)
at <starlark>._objc_library_impl(/virtual_builtins_bzl/common/objc/objc_library.bzl:114)
Caused by: java.lang.NullPointerException
at java.base/java.lang.String.replace(Unknown Source)
at com.google.devtools.build.lib.rules.objc.ObjcStarlarkInternal.expandFlag(ObjcStarlarkInternal.java:142)
at com.google.devtools.build.lib.rules.objc.ObjcStarlarkInternal.expandToolchainAndRuleContextVariables(ObjcStarlarkInternal.java:116)
at com.google.devtools.build.lib.rules.objc.ObjcStarlarkInternal.createCompilationAttributes(ObjcStarlarkInternal.java:82)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at net.starlark.java.eval.MethodDescriptor.call(MethodDescriptor.java:162)
at net.starlark.java.eval.BuiltinFunction.fastcall(BuiltinFunction.java:77)
at net.starlark.java.eval.Starlark.fastcall(Starlark.java:619)
at net.starlark.java.eval.Eval.evalCall(Eval.java:672)
at net.starlark.java.eval.Eval.eval(Eval.java:489)
at net.starlark.java.eval.Eval.execAssignment(Eval.java:109)
at net.starlark.java.eval.Eval.exec(Eval.java:268)
at net.starlark.java.eval.Eval.execStatements(Eval.java:82)
at net.starlark.java.eval.Eval.execFunctionBody(Eval.java:66)
at net.starlark.java.eval.StarlarkFunction.fastcall(StarlarkFunction.java:191)
at net.starlark.java.eval.Starlark.fastcall(Starlark.java:619)
at net.starlark.java.eval.Eval.evalCall(Eval.java:672)
at net.starlark.java.eval.Eval.eval(Eval.java:489)
at net.starlark.java.eval.Eval.execAssignment(Eval.java:109)
at net.starlark.java.eval.Eval.exec(Eval.java:268)
at net.starlark.java.eval.Eval.execStatements(Eval.java:82)
at net.starlark.java.eval.Eval.execFunctionBody(Eval.java:66)
at net.starlark.java.eval.StarlarkFunction.fastcall(StarlarkFunction.java:191)
at net.starlark.java.eval.Starlark.fastcall(Starlark.java:619)
at com.google.devtools.build.lib.analysis.starlark.StarlarkRuleConfiguredTargetUtil.buildRule(StarlarkRuleConfiguredTargetUtil.java:98)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:368)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:188)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:1040)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:981)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:368)
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:560)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:382)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I’ll submit an example later.
What operating system are you running Bazel on?
macOS
What’s the output of bazel info release
?
I used last_green
Bazel.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (14 by maintainers)
Commits related to this issue
- Expand locations in the copts flags. Fixes https://github.com/bazelbuild/bazel/issues/13862 — committed to amberdixon/bazel by amberdixon 3 years ago
- Do location expansion in copts of objc_library Fixes #13862 RELNOTES:none PiperOrigin-RevId: 409139722 — committed to bazelbuild/bazel by oquenchil 3 years ago
- Automated rollback of commit 34c71465f84fa780217926db2e8e5ca3d6d4568c. *** Reason for rollback *** broke stuff *** Original change description *** Do location expansion in copts of objc_library F... — committed to bazelbuild/bazel by googlewalt 3 years ago
- Automated rollback of commit 34c71465f84fa780217926db2e8e5ca3d6d4568c. *** Reason for rollback *** broke stuff *** Original change description *** Do location expansion in copts of objc_library F... — committed to bazelbuild/bazel by googlewalt 3 years ago
- Do location expansion in copts of objc_library Roll forward with placing every TransitiveInfoCollection in a set so that duplicate entries are removed. Test has been modified to exercise the duplicat... — committed to bazelbuild/bazel by oquenchil 3 years ago
Cherrypicked. (Tried out GitHub desktop, hope it didn’t backfire o,o)
@oquenchil also has a fix in flight already. Should be submitted tomorrow