Skip to content

Fix layering and turn on layering_check - #2540

Merged
GMNGeoffrey merged 5 commits into
iree-org:mainfrom
GMNGeoffrey:layering_check
Jul 16, 2020
Merged

GMNGeoffrey merged 5 commits into
iree-org:mainfrom
GMNGeoffrey:layering_check

Conversation

@GMNGeoffrey

@GMNGeoffrey GMNGeoffrey commented Jul 16, 2020 •

Copy link
Copy Markdown
Member

This is a new feature in OSS Bazel (which has been available internally
for a while) that checks layering. That is, cc_* BUILD rules should
directly depend on a rule that exports each header that is #include'ed
in the rule's sources.

This is now available since we upgraded to Bazel 3.3.1 (#2495).

Unfortunately we can't just enable this in the .bazelrc with
--features=layering_check because that would enable it for all our
dependencies as well, which we are not interested in enforcing. I'm not
aware of an equivalent to --per_file_copt for features.

Includes adding package and license declarations to some packages that
were missing them.

This is a new feature in OSS Bazel (which has been available internally
for a while) that checks layering. That is, cc_* BUILD rules should
directly depend on a rule that exports each header that is `#include`'ed
in the rule's sources.

This is now available since we upgraded to Bazel 3.3.1 (iree-org#2495).

@benvanik benvanik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ❤️ this

@GMNGeoffrey
GMNGeoffrey merged commit 083ac8e into iree-org:main Jul 16, 2020
@GMNGeoffrey
GMNGeoffrey deleted the layering_check branch July 16, 2020 03:10
@ScottTodd ScottTodd mentioned this pull request Jul 16, 2020
@GMNGeoffrey GMNGeoffrey added the infrastructure Relating to build systems, CI, or testing label Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Relating to build systems, CI, or testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants