add design decision include path - #3196
RolandJentschETAS wants to merge 4 commits into
Conversation
|
Documentation preview for this pull request is available at: |
aschemmel-tech
left a comment
There was a problem hiding this comment.
Option B conflicts with DR-003-proc (as in #3194).
LittleHuba
left a comment
There was a problem hiding this comment.
I find this proposal heavily skewed towards a pitchfork layout (option B) (even clearly stating pitchfork layout in the evaluation criteria. Based on that, I find it hard to base a discussion on this, since it feels like the arguments were written based on the decision instead of the other way round.
From my comments you can probably guess that I'm clearly leaning towards option A. And this review felt like a uphill battle from the start. Looking just at the advantages/disadvantages of options A and B, the evaluation should not be leaning so heavily towards option B.
Two sources for reference why I heavily prefer option A:
- https://bazel.build/tutorials/cpp-use-cases where the pitch fork layout is clearly only stated as a legacy adoption use case. This means that Bazel is not built for this project structure and that you will feel lots of friction trying to use it.
- https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1204r0.html#src-dir has a full section just talking about why pitch fork layout is bad and should not be used
Side note: I appreciate the accepted alternative that will safe communication and baselibs from having to rewrite 90% of their code. I still do not feel comfortable agreeing with the final decision because of the consequences for the overall project.
aschemmel-tech
left a comment
There was a problem hiding this comment.
Thanks for the rework, option A selected matches with DR-003-proc
| - The public surface is discovered via the `impl/` convention and Bazel visibility | ||
| rather than a single `include/` folder, so the convention must be applied | ||
| consistently. | ||
| - Contributors must consistently use full project-prefixed include paths and must not |
There was a problem hiding this comment.
We should also encounter how we check new sources and monitor the structure
There was a problem hiding this comment.
There was some work in clang-tidy that went in this direction but was never finished:
llvm/llvm-project#63226
| Bazel `hdrs`/`srcs` split. This is the current de-facto S-CORE convention. | ||
| Headers and sources live **next to each other** in the component's package, and the | ||
| public/private boundary is drawn by Bazel: public headers go in `hdrs`, everything | ||
| non-public is isolated in an `impl/` subpackage whose `visibility` is restricted to |
There was a problem hiding this comment.
Not quite sure how prescribing this impl package makes things better/worse.
While we have this pattern in mw::com, it is honestly a lie to some extent (see https://github.com/eclipse-score/communication/blob/main/score/mw/com/types.h).
For mw::com this is something we will probably never change, but other libraries might not want that pattern.
Before we make users deduce public API from directory structures we should actually provide clear documentation with the public interface. In communication we work with breathe, Sphinx and these tags to mark public API: https://github.com/eclipse-score/communication/blob/main/score/mw/com/types.h#L37
TL;DR: I vote for removing the impl package guideline in favor of describing the public API via tagging and a generated documentation, while leaving projects to come up with a good source structure based on their architecture.
There was a problem hiding this comment.
@LittleHuba : I can change it in a way, that this is optional to isolate the private headers/sources in an impl folder ? Would that be better ? Or complete remove it ?
|
As discussed in Weekly 2026-09-21 this was onboarded to the FEP process. #3269 tracks also the implementation once the DR is agreed. @LittleHuba let me know once it is ready for the FCP and then I will do the announcement and facilitate the alignment. |
add design decision include path