[llvm-dev] Layering Requirements in the LLVM Coding Style Guide

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 17 11:30:14 PST 2018


On Wed, Jan 17, 2018 at 11:25 AM Robinson, Paul <paul.robinson at sony.com>
wrote:

> Looking at build-procedure files for link-order hints is technically
> "written down" but not really human-friendly and not at all what I had in
> mind. J
>
> I get that writing it down on a doc page will have the usual bit-rot
> problems, but if you want to tell developers (especially newer developers)
> "get the layering right" you really need to point to a place that says what
> the layering *is*.  Maybe you were agreeing to do that, but I'm not sure.
>

I wasn't planning on writing it down anymore than it's already necessarily
enshrined in the build system. I'm not expecting to yell at/complain to
people who violate it unknowingly (Apple/Windows developers in general
don't get layering checked today because their linkers do resolve circular
dependencies - but they get failures on Linux buildbots and fix them when
they arise) - but to point out "oh, hey, maybe you didn't notice but this
introduces a layering violation - please fix it".

I'm not sure what makes LLVMBuild.txt not human-friendly - they're very
terse text files, contain little other than a list of dependencies. They're
probably easier to read/maintain than CMakeLists.txt which have to be
updated whenever a new source file is added. These lists have to be
updated/maintained when new libraries or dependencies are introduced &
yeah, for the most part we don't have to think about them - and most
changes won't impact layering/violate layering constraints, but then rarely
we will hit these things & check or update the layering, etc.

- Dave


> --paulr
>
> I have found layering to be a particularly useful and beneficial model in
> past large software projects.
>
> Is LLVM's layering actually written down anywhere?  Last time I went
> looking, there was nothing.  If there's no spec, there's no verifiable
> conformance; you have to guess based on what other files do.
>
>
> Fair point - Google's build system is pretty specific about this & so
> we've got it codified there, and the open source build system has to know
> some of this to get the link order right - otherwise LLVM programs couldn't
> successfully link (if the libraries weren't placed in the right order on
> the link command)
>
> I think the the LLVMBuild.txt files contain the library dependency lists
> for the CMake build.
>
> - Dave
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180117/8b74d72c/attachment.html>


More information about the llvm-dev mailing list