commit | 6d8780f724b092458aca76dd4ef9c9ff44570351 | [log] [tgz] |
---|---|---|
author | Colin Cross <ccross@android.com> | Fri Jul 10 17:51:55 2015 -0700 |
committer | Colin Cross <ccross@android.com> | Mon Aug 03 16:08:16 2015 -0700 |
tree | a1b393fa030c8abf12ed63c056f21513a804028f | |
parent | 0894cbc1a9f0564e77dfbe74ed09d03bc7eaf30d [diff] |
Fix bugs related to local vs. inherited variables The Go race detector found a race condition in the parser, which highlighted a few related bugs. A variable could be defined but not referenced in a Blueprints file, then appended to in multiple subdirs= Blueprints files. The race detector caught the multiple writes to assignment.Referenced from the parsers for the subdirs Blueprints files, but multiple appends would be much more serious. To fix this, keep local and inherited variables separate in the Scope object and export that info to the parser. Disallow appending to non-local variables, which was already the intended behavior. Only update the referenced boolean for local variables. Together, this should prevent all writes to Assignment objects from parsers other than the one that created them. Also improves the error handling code and some error messages. Change-Id: Idb4f7d2e61bbe28d90b93074764e64e60d1eba8f
Blueprint is a meta-build system that reads in Blueprints files that describe modules that need to be built, and produces a Ninja manifest describing the commands that need to be run and their dependencies. Where most build systems use built-in rules or a domain-specific language to describe the logic for converting module descriptions to build rules, Blueprint delegates this to per-project build logic written in Go. For large, heterogenous projects this allows the inherent complexity of the build logic to be maintained in a high-level language, while still allowing simple changes to individual modules by modifying easy to understand Blueprints files.