Showing content from http://mail.python.org/pipermail/python-dev/attachments/20120206/c0d37653/attachment.html below:
On Fri, Feb 3, 2012 at 5:52 PM, Éric Araujo <span dir="ltr"><<a href="mailto:merwok@netwok.org" target="_blank">merwok@netwok.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Matteo,<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now setup.py will rebuild all every time, this is because the policy of<br>
newer_group in build_extension is to consider 'newer' any missing file.<br></blockquote></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote>
Here you certainly mean older.<br></blockquote><div><br>No, and this is the problem: newer_group(depends, ext_path, 'newer'))<br><br>if (some dep is newer than the target): rebuild<br> <br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[...] Can someone suggest me the reason of this choice<br></blockquote></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote>
distutils notion of dependencies directly comes from make. A missing<br>
(not existing) target is perfectly normal: its usually a generated file<br>
that make needs to create (i.e. compile from source files). In this<br>
world, you want to (re-)compile when the target is older than the<br>
sources, or when the target is missing.<br></blockquote><div><br>Here is a simple Makefile that has the behavior I was expecting from distutils too:<br><br>$ cat Makefile <br>all: missing.dep<br> echo "Done!"<br>
<br>$ make<br>make: *** No rule to make target `missing.dep', needed by `all'. Stop.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
So here your extension module is a target that needs to be created, and<br>
when distutils does not find a file with the name you give in depends, it<br>
just thinks its another thing that will be generated.<br></blockquote><div><br>So, if I understand correctly, starting today a better name could be 'generates' instead of 'depends'?<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
This model is inherently prone to typos; Im not sure how we can improve<br>
it to let people catch possible typos.<br></blockquote><div><br></div></div>Yes, perhaps the name of the list and the explanation in the docs are both a bit confusing:<br><br><a href="http://docs.python.org/distutils/apiref.html#distutils.ccompiler.CCompiler.compile">http://docs.python.org/distutils/apiref.html#distutils.ccompiler.CCompiler.compile</a><br>
<br clear="all"><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><em>depends</em>, if given, is a list of filenames that all targets depend on. If a
source file is older than any file in depends, then the source file will be
recompiled.</blockquote><br>Can this be a better explanation? "If a
source file is older than any file in depends {+or if some depend is missing+}"<br><br>Cheers<br><br clear="all">-- <br>Matteo Bertini<br><a href="http://www.slug.it/naufraghi" target="_blank">http://www.slug.it/naufraghi</a><br>
<br><br>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4