brettviren / worch

Let the orchestration waf through the suite.
5 stars 3 forks source link

Refactor feature requirements. #17

Closed brettviren closed 11 years ago

brettviren commented 11 years ago

Goals

brettviren commented 11 years ago

This refactoring mostly went as planned and a lot of things were "touched". The code still deserves a bit more cosmetic refactoring but it's functionality is now much improved.

One deviation from the plan is that I now fully create a package's configuration dictionary, including the contributions from the "feature requirements", before any waf task_gens are created. Mixing in waf too early was the source of a lot of problems and confusions particularly w.r.t. dependencies. Making this separation more clear in the code might be the goal of a future reorganization but for now I think it's okay.

Some small changes at the configuration file level were made. A few key names change (eg, prepare_script changes to prepare_cmd). The "simple", "simple-with-patch" and "art" examples should all be brought up to date and working.

The "features" themselves are no longer written as waf methods but as waf-unaware functions with a decorator to allow for their registration and to pass in their requirements dictionary. They are called with a new version of the "pfi" object (now named "info") and it's through this object that any task construction is done or dependencies are registered or inserted.

When writing each feature's requirements dictionary, one should put the value None unless the feature code knows for sure what a default is. Eg, feature_autoconf "knows" it's prepare_cmd should be the "configure" script but shouldn't make assumptions about the source_unpacked. Also, any key in a feature's `requirementsdictionary must exist in the big list in thefeatures/requirements.pymodule. Likewise, default values in there should beNone`` unless a clear, global default can be decided.

Additional changes is to consolidate the git/hg/svn download features into a single "vcs" one. Likewise, autoconf and cmake features derive from a common "prepare" feature. The common make/make install chunk is now in a "makemake" feature.