[Distutils] People want CPAN
David Cournapeau
cournape at gmail.com
Thu Nov 12 00:03:54 CET 2009
On Thu, Nov 12, 2009 at 5:42 AM, Tarek Ziadé <ziade.tarek at gmail.com> wrote:
>
> I am not sure he wants FOO, I think he wants all installation paths,
> that gets built
> by the install command with the provided "FOO" root prefix.
>
> that could be in pseudo code:
>
>>>> get_install_paths('FOO')
>
> And that's the API we want to add in sysconfig, roughly.
That does not solve the problem about getting FOO in the first place
when calling get_install_path.
Having a function which gives you all the build directories as well as
the install paths would already be great, though. Right now, for
numscons, I needed to reimplement all the logic, with the different
paths in different modes (inplace vs standard, Release vs Debug on
windows, etc...). Some of them are even python version dependent IIRC.
> Do you mean, an Extension that would require several compilers ?
>
> I was thinking of a one-to-one relation between an Extension and a
> compiler type,
> even if there are are multiple source files (in different languages)
> for this extension.
This cannot work - you need different tools at different stages. I
don't think any imperative method can work here. Note also that
extension alone is not enough to trigger the right tool: it should be
overridable on a per extension-basis (actually, it should be
overridable on a per source basis if needed).
I think compiler class and the likes should simply be removed of the
picture here. You need tasks to transform a source into a target, and
tasks would use compiler configuration. There should not be any
objects/classes for compilers, it it not flexible enough. Although
the details differ in significant ways, both waf and scons use strings
for command lines (waf "compile them" for performance reason),
consisting of different parts which can be altered at will. In scons,
the task to compile C code is something like
$CC $CFLAGS $CPPDEFINES $CPPPATH -c $SOURCE $TARGET
You need to be able to control those variable content in a very fine
grained manner: prepending and appending may lead to different
compiler behavior, for example. This is especially important when
linking, where the wrong order may be the different between a working
extension and a crashing extension.
You cannot obtain this with classes and objects (especially when you
start talking about performance: thousand of source files for one
extension is not a crazy usercase).
David
More information about the Distutils-SIG
mailing list