Skip to main content

bxl.AnalysisResult type

The result of running an analysis in bxl.

bxl.AnalysisResult.as_dependency

def bxl.AnalysisResult.as_dependency() -> dependency

Converts the analysis result into a dependency. Currently, you can only get a dependency without any transitions. This means that you cannot create an exec dep or toolchain from an analysis result. We may support other dependency transition types in the future. This is useful for passing in the results of ctx.analysis() into anon targets.

Sample usage:

def _impl_dependency(ctx):
node = ctx.configured_targets("root//bin:the_binary")
dependency = ctx.analysis(node).as_dependency()

bxl.AnalysisResult.providers

def bxl.AnalysisResult.providers()

Access the providers of the rule. Returns a provider_collection the same as accessing providers of dependencies within a rule implementation.

Sample usage:

def _impl_providers(ctx):
node = ctx.configured_targets("root//bin:the_binary")
providers = ctx.analysis(node).providers()
ctx.output.print(providers[FooInfo])
providers = ctx.analysis("//:bin").providers()
ctx.output.print(providers[FooInfo])