[llvm-dev] Layering Requirements in the LLVM Coding Style Guide
Robinson, Paul via llvm-dev
llvm-dev at lists.llvm.org
Wed Jan 17 12:25:16 PST 2018
I can wait to see what you propose for actual coding-standard wording, as guidance for figuring out layering.
From: David Blaikie [mailto:dblaikie at gmail.com]
Sent: Wednesday, January 17, 2018 11:30 AM
To: Robinson, Paul
Cc: Richard Smith; Chandler Carruth; Reid Kleckner; llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] Layering Requirements in the LLVM Coding Style Guide
On Wed, Jan 17, 2018 at 11:25 AM Robinson, Paul <paul.robinson at sony.com<mailto: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. ☺
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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev