Ok thanks for the quick reply and the examples! I'll follow up with Bazel. On Fri, Feb 24, 2017 at 1:58 PM, Nicolas Noble <[email protected]> wrote:
> This is a bit more of a Bazel question than a gRPC question. I don't see > anything from from your code fragment however, and I'm not aware of > anything that could cause bazel to crash like you are reporting. This is > basically how we handle our dependencies. See gflags for instance: > > https://github.com/grpc/grpc/blob/master/WORKSPACE#L65 > https://github.com/grpc/grpc/blob/master/WORKSPACE#L36 > https://github.com/grpc/grpc/blob/master/test/cpp/util/BUILD#L43 > > On Fri, Feb 24, 2017 at 12:38 PM, <[email protected]> wrote: > >> Hi there, >> >> I've set up a local_repository in our WORKSPACE file, and would like to >> leverage bind to prevent having to change the BUILD files. >> >> From the documentation, it seems I should be able to do something like >> the following: >> >> bind( >> name = "grpc", >> actual = "@grpc//:grpc", >> ) >> >> local_repository( >> name = "grpc", >> path = "third_party/google/grpc", >> ) >> >> And the BUILD dependency should become: "//external:grpc" whereas it was >> previously "//third_party/google/grpc:gprc". >> >> However, if I try to do this, I hit the following exception: >> >> java.lang.RuntimeException: Unrecoverable error while evaluating node >> 'CONFIGURED_TARGET://lb:ip-forwarder-main eeab51cc7d46801c1a05a5f646430553 >> (936318221 375452941)' (requested by nodes >> 'CONFIGURED_TARGET://lb/testing:ip_forwarder_test >> eeab51cc7d46801c1a05a5f646430553 (1211325356 375452941)') >> at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluat >> e.run(ParallelEvaluator.java:438) >> at com.google.devtools.build.lib.concurrent.AbstractQueueVisito >> r$WrappedRunnable.run(AbstractQueueVisitor.java:501) >> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool >> Executor.java:1142) >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo >> lExecutor.java:617) >> at java.lang.Thread.run(Thread.java:745) >> Caused by: java.lang.NullPointerException >> at com.google.devtools.build.lib.packages.NonconfigurableAttrib >> uteMapper.get(NonconfigurableAttributeMapper.java:45) >> at com.google.devtools.build.lib.bazel.rules.BazelRuleClassProv >> ider$BazelPrerequisiteValidator.isTestOnlyRule(BazelRuleClas >> sProvider.java:266) >> at com.google.devtools.build.lib.bazel.rules.BazelRuleClassProv >> ider$BazelPrerequisiteValidator.validateDirectPrerequisiteFo >> rTestOnly(BazelRuleClassProvider.java:252) >> at com.google.devtools.build.lib.bazel.rules.BazelRuleClassProv >> ider$BazelPrerequisiteValidator.validate(BazelRuleClassProvider.java:196) >> at com.google.devtools.build.lib.analysis.RuleContext$Builder.v >> alidateDirectPrerequisite(RuleContext.java:1954) >> at com.google.devtools.build.lib.analysis.RuleContext$Builder.c >> reateTargetMap(RuleContext.java:1626) >> at com.google.devtools.build.lib.analysis.RuleContext$Builder.b >> uild(RuleContext.java:1465) >> at com.google.devtools.build.lib.analysis.ConfiguredTargetFacto >> ry.createRule(ConfiguredTargetFactory.java:245) >> at com.google.devtools.build.lib.analysis.ConfiguredTargetFacto >> ry.createConfiguredTarget(ConfiguredTargetFactory.java:176) >> at com.google.devtools.build.lib.skyframe.SkyframeBuildView.cre >> ateConfiguredTarget(SkyframeBuildView.java:491) >> at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunct >> ion.createConfiguredTarget(ConfiguredTargetFunction.java:1094) >> at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunct >> ion.compute(ConfiguredTargetFunction.java:251) >> at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluat >> e.run(ParallelEvaluator.java:373) >> ... 4 more >> >> >> Any idea why this is happening? What is the right way to use bind to >> refer to the local_repository? I know I can refer to the local_repository >> directly from the BUILD files using "@grpc//:grpc", but I'm trying to avoid >> having to do this. >> >> Thanks, >> Ilina >> >> -- >> You received this message because you are subscribed to the Google Groups >> "grpc.io" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/grpc-io. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/grpc-io/4ddb1266-1190-475a-9118-b5088474637c%40googlegroups.com >> <https://groups.google.com/d/msgid/grpc-io/4ddb1266-1190-475a-9118-b5088474637c%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAMsVFO0SzQL0y6XssuN3wHXDihUWZ3r4D4QwCyvJPSqZQnAbxg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
