[Scons-dev] SCons Tool Format 2 (Plan)
anatoly techtonik
techtonik at gmail.com
Mon Sep 8 04:08:08 EDT 2014
Hellou,
I am thinking about how to clean up mess with tools. There are two
things that could be done in parallel:
1. give information about what is going with --debugs=tool(s)
* avoid standard logging module, because it is hugs and
may decrease SCons startup time
* important points - tool subsystem initialization start,
default tools lookup start, default tool cheking, default
tools lookup end, explicit tool request in Environment
lookup start/check/end, registration of the Tool API
* -v --verbose option to give more details (-v is currently
for --version, and is not used often)
2. make SCons know which stuff tool provides: which
builders (Capitalized methods to the Environment),
for which extensions, which construction variables,
what else I forgot?
* this will allow to detect conflict, tools for c files,
building mini-graph of the stuff, etc.
* the tool should just expose what it provides in a
module properties
* the requirement to describe its behavior may be
strict for core tools, but not for external stuff by
default to keep the joy of hacking
* registration of the Tool API - tracing what tool
defines and what it actually declared after
generate() completed (we can do this already,
right?)
* monitoring of Tool behavior - that tool modifies
the stuff it declared, detect the stuff it touches
(writes, but reads may also be useful), race
conditions with other tools (overwriting each
other's variables?), monitoring communication
between tools through construction variables,
monitor evolution and usage of construction
variable
First approximation:
tool_provides = dict(
scons_builders = 'Program',
scons_extensions = '.c', # or should it be 'source-masks'?
...
)
Other idea is to provide tool description in more human
friendly form in parseable module block:
"""
---[description v2]---
name: nasm
type: scons
provides:
scons.builders: Program
scons.extensions: .c
"""
For the reference, current public tool API:
def generate(env):
"""Add Builders and construction variables for {{ Tool }} to an
Environment."""
def exists(env):
"" Detect Tool is present"""
Does it sound like a plan? =)
P.S. Sorry for the big text. It started with a tiny idea and then it
grow up on me during the writing, and now I barely can resist sending
it.
--
anatoly t.
More information about the Scons-dev
mailing list