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

subrules incompatible with aspects #20782

Closed
matts1 opened this issue Jan 8, 2024 · 5 comments
Closed

subrules incompatible with aspects #20782

matts1 opened this issue Jan 8, 2024 · 5 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: bug

Comments

@matts1
Copy link
Contributor

matts1 commented Jan 8, 2024

Description of the bug:

When you attempt to use an aspect on a subrule, bazel complains that you failed to call super in your subrule.

Which category does this issue belong to?

Rules API

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

I've provided a minimal example at https://github.com/matts1/bazel-base/compare/subrule_demo

$ bazel build //:foo_child
<succeeds>
$ bazel build //:foo_child --aspects=//:demo.bzl%empty_aspect
INFO: Invocation ID: b872abcb-b027-4cfb-99be-ef1e2b721a25
ERROR: /usr/local/google/home/msta/bazel_base/BUILD.bazel:7:10: in //:demo.bzl%empty_aspect aspect on foo_child rule //:foo_child:
'super' was not called.
INFO: Analyzed target //:foo_child (0 packages loaded, 1 target configured).
WARNING: errors encountered while analyzing target '//:foo_child', it will not be built.
Analysis of target '//:foo_child' failed
INFO: Found 1 target...
Target //:foo_child up-to-date:
  bazel-bin/foo_child
ERROR: command succeeded, but not all targets were analyzed
INFO: Elapsed time: 0.103s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

7.0.0

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

No response

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

No response

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

No response

Have you found anything relevant by searching the web?

No response

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

No response

@matts1
Copy link
Contributor Author

matts1 commented Jan 8, 2024

I believe @comius is the correct person for this.

@sgowroji sgowroji added the team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts label Jan 8, 2024
@comius comius added the P2 We'll consider working on this in future. (Assignee optional) label Jan 8, 2024
@comius comius self-assigned this Jan 8, 2024
@comius comius removed the untriaged label Jan 8, 2024
@comius
Copy link
Contributor

comius commented Jan 12, 2024

This issue was fixed at head (it's only present in Bazel 7.0.0) release.

@Wyverald
Copy link
Member

This issue was fixed at head (it's only present in Bazel 7.0.0) release.

We should probably cherry-pick the fix into 7.1.0 then. Sounds good?

github-merge-queue bot pushed a commit that referenced this issue Feb 8, 2024
…21237)

Contains cherry-picks:

d083f3d Reify outputs of initializer within the package
723a3ac Allow reading the name of the target in the initializer
48b975a Fix dict types in initializers
c519916 Make Google proto_library and extension of Bazel
proto_library


Fixes: #20782
@brentleyjones
Copy link
Contributor

Fixed with 048f048.

@iancha1992
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: bug
Projects
None yet
Development

No branches or pull requests

7 participants