Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'required_providers' for an aspect does not always work together with the 'aspects' requirement on rule attributes #19609

Closed
martis42 opened this issue Sep 24, 2023 · 19 comments
Assignees
Labels
team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: bug untriaged

Comments

@martis42
Copy link

martis42 commented Sep 24, 2023

Description of the bug:

I want to create an aspect which is only meaningful for C++ targets. To ensure my aspect is only invoked on such targets, I added required_providers = [CcInfo],.

This works as expected when invoke the aspect through the CLI.
However, it fails if the aspect is invoked by a rule on a cc_binary target.
Given the aspect documentation and considering that cc_binary does provide CcInfo, this seems like a bug to me.

Which category does this issue belong to?

C++/Objective-C Rules, Core

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Given below example

  • bazel build --aspects=//:aspect.bzl%my_aspect //:lib succeeds
  • bazel build --aspects=//:aspect.bzl%my_aspect //:main succeeds
  • bazel build //:my_aspect_rule_lib succeeds and yields as expected
    DEBUG: <some_path>/aspect.bzl:4:10: <target //:lib, keys:[CcInfo, InstrumentedFilesInfo, 
    OutputGroupInfo]>
    DEBUG: <some_path>/aspect.bzl:21:14: 1
    
  • bazel build //:my_aspect_rule_main fails with
    ERROR: <some_path>/BUILD:18:15: in my_aspect_rule rule //:my_aspect_rule_main: 
    Traceback (most recent call last):
    	File "<some_path>/aspect.bzl", line 21, column 18, in _my_aspect_rule_impl
    		print(dep[FileCountInfo].count)
    Error: <target //:main> (rule 'cc_binary') doesn't contain declared provider 'FileCountInfo'
    

BUILD file

load("//:aspect.bzl", "my_aspect_rule")

cc_library(
    name = "lib",
    srcs = ["lib.h"],  # empty file, content irrelevant
)

cc_binary(
    name = "main",
    srcs = ["main.cpp"],  # simple main returning 0
)

my_aspect_rule(
    name = "my_aspect_rule_lib",
    deps = [":lib"],
)

my_aspect_rule(
    name = "my_aspect_rule_main",
    deps = [":main"],
)

aspect.bzl

FileCountInfo = provider(fields = {"count": "number of files"})

def _my_aspect_impl(target, ctx):
    print(target)

    count = 0
    for src in ctx.rule.attr.srcs:
        for f in src.files.to_list():
            count = count + 1

    return [FileCountInfo(count = count)]

my_aspect = aspect(
    implementation = _my_aspect_impl,
    required_providers = [CcInfo],
    attr_aspects = [],
)

def _my_aspect_rule_impl(ctx):
    for dep in ctx.attr.deps:
        print(dep[FileCountInfo].count)

my_aspect_rule = rule(
    implementation = _my_aspect_rule_impl,
    attrs = {"deps": attr.label_list(aspects = [my_aspect])},
)

Which operating system are you running Bazel on?

Linux Mint 21.1 Cinnamon

What is the output of bazel info release?

release 6.3.2

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

As far as I can tell this is no regression. Tested this with various Bazel versions in the range 5.1.0 to latest 7.0.0-pre.20230917.3 and all show the same behavior.

However, with Bazel 5.0.0 bazel build //:my_aspect_rule_lib fails as well (invoking the aspect via CLI remains working). This indicates between 5.0.0 and 5.1.0 something was changed/fixed, but cc_binary was forgotten.

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

There is a workaround to this.
One can add the following to the beginning of the aspect implementation to achieve the desired behavior.

if not CcInfo in target:
   return []
martis42 added a commit to martis42/depend_on_what_you_use that referenced this issue Sep 24, 2023
We have to skip targets not providing CcInfo not just because of
incompatible targets in old Bazel versions, but also due to bug:
bazelbuild/bazel#19609

Given incompatible targets for aspects have been fixed in recent Bazel
versions and the bug above has just been discovered, it makes no sense
to keep mentioning incompatible targets as when above bug is fixed and we
can remove this manual check for CcInfo incompatible targets are no longer
relevant either way.
@Pavank1992 Pavank1992 added the team-Rules-CPP Issues for C++ rules label Sep 25, 2023
martis42 added a commit to martis42/depend_on_what_you_use that referenced this issue Sep 25, 2023
We have to skip targets not providing CcInfo not just because of
incompatible targets in old Bazel versions, but also due to bug:
bazelbuild/bazel#19609

Given incompatible targets for aspects have been fixed in recent Bazel
versions and the bug above has just been discovered, it makes no sense
to keep mentioning incompatible targets as when above bug is fixed and we
can remove this manual check for CcInfo incompatible targets are no longer
relevant either way.
@comius comius added team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts and removed team-Rules-CPP Issues for C++ rules labels Oct 10, 2023
@comius
Copy link
Contributor

comius commented Oct 10, 2023

cc @mai93, can you triage?

@mai93
Copy link
Contributor

mai93 commented Oct 11, 2023

This happened because cc_library declares CcInfo in its provides list: https://github.com/bazelbuild/bazel/blob/master/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl#L618 while cc_binary does not: https://github.com/bazelbuild/bazel/blob/master/src/main/starlark/builtins_bzl/common/cc/cc_binary.bzl#L914

and the aspect's required_providers checks the providers list advertised by the rule via provides. However, from the discussion in #18721 it was decided that cc_binary and cc_test should not advertise CcInfo.

@stagnation
Copy link
Contributor

Interesting background, thanks! This use-case and "Add unique provider for shell rules "#18331 shows that we have a different need for providers too, a way to filter what target to analyze aspects for. Which does not make a large distinction between library targets, which you can typically depend on through the provider, and binary and test targets. And the aspect needs to analyze binaries and tests just as well.

So we would like to say "this is c, or shell or python code", and have some aspects that only operate on that language's main rule set. Most aspects just need that, which is a glorified kind filter. And then FFI uses are typically filtered away, clang-tidy does not care for rust rules that can be compiled into a c binary. But an aspect that looks for symbol collisions in a binary's transitive closure would follow the larger "can be compiled together" semantics and happily analyze rust libraries too. But in neither case would we want to analyze python rules, for instance, which does not have CcInfo.

To @martis42: I hope you agree as I wouldn't want to hijack your issue. Thanks for the DWYU code, I have seen similar internal code and thinks it is a great idea, combined with IWYU it really improves the code quality.e

@comius
Copy link
Contributor

comius commented Oct 12, 2023

cc @oquenchil

There's some disagreement if cc_binary should provide/declare CcInfo or not. I'm advocating that cc_binary should both provide and declare it. At least in the short term. That is because it can compile sources and the aspects need to extract this data the same way as on a cc_library.

The other argument is saying that we shouldn't return CcInfo from cc_binary.

In the long run, we should probably split it - provide 2 things: CcCompileInfo (for data extraction) and CcLibraryInfo (for linking the library into the cc_binary or cc_test). We're not there yet, and we need a migration for this. Probably simplest migration is to say CcInfo is used for data extraction and a new provider is used to define what cc_binary can depend on.

Those are my reasons. Let's not block the users for a long time. Let's allow the users to do what they need now and migrate and clean-up C++ rules behind the stage, ideally without users even noticing it.

@brentleyjones
Copy link
Contributor

In the long run, we should probably split it - provide 2 things: CcCompileInfo (for data extraction) and CcLibraryInfo (for linking the library into the cc_binary or cc_test).

❤️

@martis42
Copy link
Author

@mai93
Thanks for your clarification. It seems this is not a bug but right now the desired behavior. However, putting aside if cc_binary will advertise CcInfo or not, I believe the current state is bad.

That it makes a difference if one invokes an aspect via CLI on a target or via indirection through a rule is surprising and inconsistent. If cc_binary is not supposed to advertise CcInfo, then the aspect should also skip cc_binary targets when being invoked via CLI on a cc_binary

@martis42
Copy link
Author

@stagnation
Thanks for your kind words regarding DWYU :)

You summarized the underlying problem of my issue very well. I want to create an aspect which runs on all cc_ targets without caring about them being a binary or library.

@mai93
Copy link
Contributor

mai93 commented Oct 12, 2023

That it makes a difference if one invokes an aspect via CLI on a target or via indirection through a rule is surprising and inconsistent. If cc_binary is not supposed to advertise CcInfo, then the aspect should also skip cc_binary targets when being invoked via CLI on a cc_binary

That's correct, but fixing this in command line aspects turned out to be an incompatible change so it has been guarded by incompatible_top_level_aspects_require_providers

@buildbreaker2021
Copy link
Contributor

I am still not fully convinced that we need to do this, mostly because of #18721

What are the downsides of the workaround you have mentioned?

What about using ctx.rule.kind? AFAIU you are using CcInfo to identify if the rule is cc_binary or cc_test right?

@comius
Copy link
Contributor

comius commented Oct 18, 2023

What are the downsides of the workaround you have mentioned?

The downside of workaround is that it propagates the aspect over everything, not just rules that have CcInfo. This uses additional memory and time. The numbers are usually not small in big repositories.

@martis42
Copy link
Author

What are the downsides of the workaround you have mentioned?

While the workaround implements the desired behavior, it is still unexpected that the workaround is required. The documentation does not make it clear that required_providers of an aspect is solely working for providers advertised by provides of a rule.

Besides that, there are performance penalties mentioned by @comius.

What about using ctx.rule.kind? AFAIU you are using CcInfo to identify if the rule is cc_binary or cc_test right?

While I am currently limiting the aspect in DWYU to some specific cc_* rules, this is supposed to be an intermediate step. In the end I want to generally work on all all rules providing CcInfo. As long as a rule manages C/C++ source code, provides CcInfo and has (implementation_)deps I can apply my tools logic. This could also work on any third_party rule for C++ besides the official Bazel cc_* rules.

@fmeum
Copy link
Collaborator

fmeum commented Oct 26, 2023

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Oct 26, 2023
@iancha1992
Copy link
Member

@bazel-io fork 7.0.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Oct 26, 2023
@iancha1992
Copy link
Member

iancha1992 commented Oct 26, 2023

@fmeum @mai93 @comius I've tried cherry-picking this to release-7.0.0, but looks like there's a conflict since the make_cc_binary(cc_binary_attrs, **kwargs) function is missing from src/main/starlark/builtins_bzl/common/cc/cc_binary.bzl in the first place from the branch.

cc: @bazelbuild/triage

@mai93
Copy link
Contributor

mai93 commented Oct 27, 2023

I think that's because c59739e is not cherry-picked in the release-7.0.0 branch, @comius should it be cherry-picked?

iancha1992 pushed a commit to iancha1992/bazel that referenced this issue Oct 30, 2023
Fixes: bazelbuild#19609
PiperOrigin-RevId: 576924920
Change-Id: I7ab0c13539f729a80a08e264d35aed7dafe78cc0
@iancha1992
Copy link
Member

iancha1992 commented Oct 30, 2023

@mai93 Thanks. Looks like I'm able to cherry-pick now.
@comius #19986 includes both c59739e and b1d3441. Let us know if c59739e shouldn't be included. Thanks

@comius
Copy link
Contributor

comius commented Oct 31, 2023

Yes, please cherry-pick c59739e. It's a rollback, I'll need to implement it in a different way.

iancha1992 added a commit that referenced this issue Oct 31, 2023
…her with the 'aspects' requirement on rule attributes (#19986)

Fixes: #19609

Commit
b1d3441

PiperOrigin-RevId: 576924920
Change-Id: I7ab0c13539f729a80a08e264d35aed7dafe78cc0

---------

Co-authored-by: Googler <ilist@google.com>
Co-authored-by: Googler <messa@google.com>
@mai93 mai93 self-assigned this Nov 2, 2023
@iancha1992
Copy link
Member

A fix for this issue has been included in Bazel 7.0.0 RC5. Please test out the release candidate and report any issues as soon as possible. Thanks!

@martis42
Copy link
Author

martis42 commented Dec 2, 2023

@iancha1992 Thanks for the ping. Can confirm that my issue is resolved with Bazel 7.0.0 RC5

copybara-service bot pushed a commit that referenced this issue Sep 24, 2024
This is required for aspects to propagate along python libraries (and binaries) with `required_providers` set.
Otherwise the aspect terminates on the top-level target. This follows from/was inspired by #19609 where the `CcInfo` was added to `cc_binary` targets.

The `cc_library` does provide `CcInfo` so an aspect can successfully propagate the `cc_library` tree.
Also related: #17214

<details>
<summary>Reproduction example to show the problem with py targets</summary>

```
#!/bin/sh

set -eu

dir=${1:-$(mktemp -d)}

# "$dir"/BUILD.bazel {{{
cat > "$dir"/BUILD.bazel <<'EOF'
# stack a high dependency tree
py_binary(
    name = "base_py",
    srcs = ["base.py"],
    main = "base.py",
)

py_library(
    name = "stack_0_py",
    srcs = ["extra.py"],
    deps = ["//:base_py"],
)

[
    py_library(
        name = "stack_{}_py".format(index),
        srcs = ["extra.py"],
        deps = [":stack_{}_py".format(index - 1)],
    )
    for index in range(1, 2)
]
cc_library(
    name = "base_cc",
    srcs = ["base.c"],
)

cc_library(
    name = "stack_0_cc",
    srcs = ["extra.c"],
    deps = ["//:base_cc"],
)

[
    cc_library(
        name = "stack_{}_cc".format(index),
        srcs = ["extra.c"],
        deps = [":stack_{}_cc".format(index - 1)],
    )
    for index in range(1, 2)
]
EOF
# }}}

# "$dir"/file_count.bzl {{{
cat > "$dir"/file_count.bzl <<'EOF'
FileCountInfo = provider(
    'count',
    fields = {
        'count' : 'number of files'
    }
)

def _file_count_aspect_impl(_, ctx):
    name = ctx.rule.attr.name
    count = 0
    # Make sure the rule has a srcs attribute.
    if hasattr(ctx.rule.attr, 'srcs'):
        # Iterate through the sources counting files
        for src in ctx.rule.attr.srcs:
            for _ in src.files.to_list():
                count = count + 1
    # Get the counts from our dependencies.
    for dep in ctx.rule.attr.deps:
        if FileCountInfo in dep:
            count = count + dep[FileCountInfo].count

    print(name, count)
    return [FileCountInfo(count = count)]

ok = aspect(
    implementation = _file_count_aspect_impl,
    attr_aspects = ['deps'],
)

required = aspect(
    implementation = _file_count_aspect_impl,
    required_providers = [
        [PyInfo],
        [CcInfo],
    ],
    attr_aspects = ['deps'],
)
EOF
# }}}

touch "$dir"/WORKSPACE
touch "$dir"/base.py
touch "$dir"/extra.py
touch "$dir"/base.c
touch "$dir"/extra.c

echo Reproducing in "$dir"
cd "$dir" || exit 1

bazelisk --version

echo "[Python] First print the succesfull traversal with transient target, and accumulating count"
(
    set -x
    bazelisk build \
        --ui_event_filters=-info --noshow_progress --noshow_loading_progress \
        --show_result=0 \
        --aspects=//:file_count.bzl%ok //:stack_1_py
    set +x
)
echo "[Python] Now add 'required_providers', and the transitive dependencies disappear."
(
    set -x
    bazelisk build \
        --ui_event_filters=-info --noshow_progress --noshow_loading_progress \
        --show_result=0 \
        --aspects=//:file_count.bzl%required //:stack_1_py
    set +x
)

echo "[CC] Both works for cc_library"
(
    set -x
    bazelisk build \
        --ui_event_filters=-info --noshow_progress --noshow_loading_progress \
        --show_result=0 \
        --aspects=//:file_count.bzl%ok //:stack_1_cc
    bazelisk build \
        --ui_event_filters=-info --noshow_progress --noshow_loading_progress \
        --show_result=0 \
        --aspects=//:file_count.bzl%required //:stack_1_cc
    set +x
)
```

Output:
```
$ env USE_BAZEL_VERSION=7.0.0rc5 sh reproduction-aspect-required-provider.
sh aspect-required-provider/
Reproducing in aspect-required-provider/
bazel 7.0.0rc5
[Python] First print the succesfull traversal with transient target, and accumulating count
+ bazelisk build --ui_event_filters=-info --noshow_progress --noshow_loading_progress --aspects=//:file_count.bzl%ok //:stack_1_py
Starting local Bazel server and connecting to it...
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: base_py 1
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_0_py 2
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_1_py 3
+ set +x
[Python] Now add 'required_providers', and the transitive dependencies disappear.
+ bazelisk build --ui_event_filters=-info --noshow_progress --noshow_loading_progress --aspects=//:file_count.bzl%required //:stack_1_py
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_1_py 1
+ set +x
[CC] Both works for cc_library
+ bazelisk build --ui_event_filters=-info --noshow_progress --noshow_loading_progress --aspects=//:file_count.bzl%ok //:stack_1_cc
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: base_cc 1
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_0_cc 2
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_1_cc 3
+ bazelisk build --ui_event_filters=-info --noshow_progress --noshow_loading_progress --aspects=//:file_count.bzl%required //:stack_1_cc
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: base_cc 1
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_0_cc 2
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_1_cc 3
```
</details>

Closes #20436.

PiperOrigin-RevId: 677997144
Change-Id: Id2f75db10447b334a9d5ec9872e15f490ae44927
iancha1992 pushed a commit that referenced this issue Sep 24, 2024
This is required for aspects to propagate along python libraries (and binaries) with `required_providers` set.
Otherwise the aspect terminates on the top-level target. This follows from/was inspired by #19609 where the `CcInfo` was added to `cc_binary` targets.

The `cc_library` does provide `CcInfo` so an aspect can successfully propagate the `cc_library` tree.
Also related: #17214

<details>
<summary>Reproduction example to show the problem with py targets</summary>

```
#!/bin/sh

set -eu

dir=${1:-$(mktemp -d)}

# "$dir"/BUILD.bazel {{{
cat > "$dir"/BUILD.bazel <<'EOF'
# stack a high dependency tree
py_binary(
    name = "base_py",
    srcs = ["base.py"],
    main = "base.py",
)

py_library(
    name = "stack_0_py",
    srcs = ["extra.py"],
    deps = ["//:base_py"],
)

[
    py_library(
        name = "stack_{}_py".format(index),
        srcs = ["extra.py"],
        deps = [":stack_{}_py".format(index - 1)],
    )
    for index in range(1, 2)
]
cc_library(
    name = "base_cc",
    srcs = ["base.c"],
)

cc_library(
    name = "stack_0_cc",
    srcs = ["extra.c"],
    deps = ["//:base_cc"],
)

[
    cc_library(
        name = "stack_{}_cc".format(index),
        srcs = ["extra.c"],
        deps = [":stack_{}_cc".format(index - 1)],
    )
    for index in range(1, 2)
]
EOF
# }}}

# "$dir"/file_count.bzl {{{
cat > "$dir"/file_count.bzl <<'EOF'
FileCountInfo = provider(
    'count',
    fields = {
        'count' : 'number of files'
    }
)

def _file_count_aspect_impl(_, ctx):
    name = ctx.rule.attr.name
    count = 0
    # Make sure the rule has a srcs attribute.
    if hasattr(ctx.rule.attr, 'srcs'):
        # Iterate through the sources counting files
        for src in ctx.rule.attr.srcs:
            for _ in src.files.to_list():
                count = count + 1
    # Get the counts from our dependencies.
    for dep in ctx.rule.attr.deps:
        if FileCountInfo in dep:
            count = count + dep[FileCountInfo].count

    print(name, count)
    return [FileCountInfo(count = count)]

ok = aspect(
    implementation = _file_count_aspect_impl,
    attr_aspects = ['deps'],
)

required = aspect(
    implementation = _file_count_aspect_impl,
    required_providers = [
        [PyInfo],
        [CcInfo],
    ],
    attr_aspects = ['deps'],
)
EOF
# }}}

touch "$dir"/WORKSPACE
touch "$dir"/base.py
touch "$dir"/extra.py
touch "$dir"/base.c
touch "$dir"/extra.c

echo Reproducing in "$dir"
cd "$dir" || exit 1

bazelisk --version

echo "[Python] First print the succesfull traversal with transient target, and accumulating count"
(
    set -x
    bazelisk build \
        --ui_event_filters=-info --noshow_progress --noshow_loading_progress \
        --show_result=0 \
        --aspects=//:file_count.bzl%ok //:stack_1_py
    set +x
)
echo "[Python] Now add 'required_providers', and the transitive dependencies disappear."
(
    set -x
    bazelisk build \
        --ui_event_filters=-info --noshow_progress --noshow_loading_progress \
        --show_result=0 \
        --aspects=//:file_count.bzl%required //:stack_1_py
    set +x
)

echo "[CC] Both works for cc_library"
(
    set -x
    bazelisk build \
        --ui_event_filters=-info --noshow_progress --noshow_loading_progress \
        --show_result=0 \
        --aspects=//:file_count.bzl%ok //:stack_1_cc
    bazelisk build \
        --ui_event_filters=-info --noshow_progress --noshow_loading_progress \
        --show_result=0 \
        --aspects=//:file_count.bzl%required //:stack_1_cc
    set +x
)
```

Output:
```
$ env USE_BAZEL_VERSION=7.0.0rc5 sh reproduction-aspect-required-provider.
sh aspect-required-provider/
Reproducing in aspect-required-provider/
bazel 7.0.0rc5
[Python] First print the succesfull traversal with transient target, and accumulating count
+ bazelisk build --ui_event_filters=-info --noshow_progress --noshow_loading_progress --aspects=//:file_count.bzl%ok //:stack_1_py
Starting local Bazel server and connecting to it...
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: base_py 1
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_0_py 2
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_1_py 3
+ set +x
[Python] Now add 'required_providers', and the transitive dependencies disappear.
+ bazelisk build --ui_event_filters=-info --noshow_progress --noshow_loading_progress --aspects=//:file_count.bzl%required //:stack_1_py
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_1_py 1
+ set +x
[CC] Both works for cc_library
+ bazelisk build --ui_event_filters=-info --noshow_progress --noshow_loading_progress --aspects=//:file_count.bzl%ok //:stack_1_cc
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: base_cc 1
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_0_cc 2
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_1_cc 3
+ bazelisk build --ui_event_filters=-info --noshow_progress --noshow_loading_progress --aspects=//:file_count.bzl%required //:stack_1_cc
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: base_cc 1
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_0_cc 2
DEBUG: /home/nils/task/reproductions/aspect-required-provider/file_count.bzl:22:10: stack_1_cc 3
```
</details>

Closes #20436.

PiperOrigin-RevId: 677997144
Change-Id: Id2f75db10447b334a9d5ec9872e15f490ae44927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: bug untriaged
Projects
None yet
Development

No branches or pull requests