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

Proposal for new pre-merge check: Enforce library layering constraints #405

Open
envp opened this issue Jun 27, 2022 · 0 comments
Open

Proposal for new pre-merge check: Enforce library layering constraints #405

envp opened this issue Jun 27, 2022 · 0 comments

Comments

@envp
Copy link

envp commented Jun 27, 2022

While working on a recent changeset we realized after a merge that I would end up with a linker error due to a clangBasic -> clangLex edge. It would be nice to statically enforce the library layering constraints before merge.

Current State

Library layering constraints (e.g. clangBasic cannot depend on clangLex) are enforce by the linker after merge.

Desired State

Constraints such as these can be derived from the compile_commands.json and the headers included. Since most headers have standard prefixes llvm/XYZ/..., clang/ABC/..., these can be combined with the linker flags to check if layering constraints are violated or not.

Benefits

  1. Enforce explicitly linking against a projectComponent if #include "project/Component/Thing.h" was found.
  2. Use the layering constraints to actively guide design.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant