-
Assessment: buildit
last modified July 16, 2007 by k0s
buildit is a great piece of software. unfortunately, it has some deficiencies, at least regarding things i want to do for topp.build. maybe this is my lack of imagination concerning namespaces. but lets dig in and do a post-mortem later.
variable resolution: [ priority: blocker ]
currently context doesn't take any global variables. in addition, variables in the global section (at least) aren't resolved "in order". that is, if i do
foo = bar
fleem = ${foo}
this won't resolve:
>>> from buildit import context
>>> from StringIO import StringIO
>>> c = context.Context(StringIO("[globals]\nfoo=bar\nbaz=${foo}\n"))
No [globals] section in inifile <StringIO.StringIO instance at 0x2b58671d4320>
No [namespaces] section in inifile <StringIO.StringIO instance at 0x2b58671d4320>
>>> c.globals
{'username': 'jhammel', 'platform': 'linux-x86_64', 'buildoutdir': '/home/jhammel', 'cwd': '/home/jhammel'}
>>> c.interpolate('${baz}', None)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib64/python2.4/site-packages/buildit/context.py", line 138, in interpolate
task)
File "/usr/lib64/python2.4/site-packages/buildit/resolver.py", line 211, in resolve_value
name)
buildit.resolver.MissingDependencyError: <MissingDependencyError in section named None, option named None, value '${baz}', offender 'baz'>
Let's dissect the problem:
- Context.__init__: this sets up builtins and calls file globals = resolve_file_section(inifile, 'globals', builtins)
- resolve_file_section:
InFileWriter doesn't resolve namespaces: [ priority: important ]
You can't resolve <<foo/bar>> , for instance
callbacks for targets: [ priority: backburner ]
Currently, targets only check to see if files exist, ala make. It would be great if in addition to this, you could have python tests for tasks. For instance, is a module importable?