Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error if repository name isn't supplied (#18425)
Currently, this results in a server crash along the lines of: ``` FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.RuntimeException: Unrecoverable error while evaluating node '[/redacted]/[WORKSPACE.bazel], 1' (requested by nodes 'com.google.devtools.build.lib.skyframe.ExternalPackageFunction$$Lambda$231/0x0000000800df7998@34f133c') at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:642) at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:382) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: net.starlark.java.eval.Starlark$UncheckedEvalException: NullPointerException thrown during Starlark evaluation (WORKSPACE) at <starlark>.repository_rule(<builtin>:0) at <starlark>.<toplevel>(/redacted/WORKSPACE.bazel:3) Caused by: java.lang.NullPointerException: Cannot invoke "String.isEmpty()" because "name" is null at com.google.devtools.build.lib.cmdline.RepositoryName.create(RepositoryName.java:71) at com.google.devtools.build.lib.packages.WorkspaceFactoryHelper.addMainRepoEntry(WorkspaceFactoryHelper.java:106) at com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryModule$RepositoryRuleFunction.createRuleLegacy(StarlarkRepositoryModule.java:228) at com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryModule$RepositoryRuleFunction.call(StarlarkRepositoryModule.java:185) ``` Closes #18335. PiperOrigin-RevId: 530577557 Change-Id: Ic402e8fabac180aaa2da19cd3201b9fb2671dccb Co-authored-by: Daniel Wagner-Hall <[email protected]>
- Loading branch information