In the same vein as https://reviews.llvm.org/D141553
Enable the feature globally to ensure layering and catch circular dependencies
(https://llvm.org/docs/CodingStandards.html#library-layering).
Details
- Reviewers
MaskRay GMNGeoffrey rupprecht aeubanks - Group Reviewers
Restricted Project - Commits
- rG8de802e221b3: [bazel] Add layering-check
rG5916decfc2ba: [bazel] Add layering-check
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
layering_check has already been turned on at the package level for the packages that are layering clean (e.g. https://github.com/llvm/llvm-project/blob/main/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel#L15). You could add more
I did it originally for libc but got bitten by not setting it in the subfolders BUILD.bazel files.
Subfolder BUILD.bazel files create a new package that also needs to receive the feature.
@aeubanks suggested to add it to the .blazerc file instead to be more thorough.
I just looked at the premerge checks and I can see how this will be hard to fix globally (if at all possible).
I'll use the package feature instead.
IMO we should try to clean those up, and then once we do so, remove the package-level annotations and have the feature globally enabled -- but as build --features=layering_check, not build:ci --features=layering_check.
If there are any that are really problematic, we can add a feature to disable layering check for that rule (or package)
I've fixed all layering checks in https://github.com/llvm/llvm-project/commit/1842b5885baa1e002b3fa8b6ac1bae9cf4d39610
I'm reviving this patch to add build --features=layering_check as you suggests.
utils/bazel/.bazelrc | ||
---|---|---|
25 | Add |
Looks like there's still an issue with mpfr. One advantage to adding at the package level is that it will also apply for downstream projects using LLVM. So if someone is building via their own project and editing an LLVM submodule or something then they would still have layering enforced. Just a thought
One advantage to adding at the package level is that it will also apply for downstream projects using LLVM. So if someone is building via their own project and editing an LLVM submodule or something then they would still have layering enforced. Just a thought
I've added bazel-group as a reviewer to get input from other people.
It runs just fine locally with bazelisk-linux-amd64 test --config=ci --sandbox_base=/dev/shm @llvm-project//... and bazelisk-linux-amd64 query //... + @llvm-project//... | xargs bazelisk-linux-amd64 test --config=ci, could it be a caching issue?
- Disable layering check when using mpfr_system
- Remove layering_check on MPRFUtils instead
Add