
On 15 July 2017 at 20:54, Paul Moore <p.f.moore@gmail.com> wrote:
Based on the current discussion, however, I now have concerns that either
a) Backend developers might not understand what build_directory is requesting, or b) The PEP doesn't define the semantics of build_directory in a way that delivers the results I'm suggesting here
Having had this discussion, and re-read the current draft of the PEP, I do in fact think that (b) is the case. That worries me, because I don't think it's just me that had made that mistake. Nick has just posted a message saying
Requesting an out-of-tree wheel build is then just a way for a frontend to say to the backend "Hey, please build the wheel *as if* you'd exported an sdist and then built that, even if you can't actually export an sdist right now".
which is exactly what I'd expected. But the PEP doesn't say that. Specifically, in the PEP:
When a build_directory is provided, the backend should not create or modify any files in the source directory (the working directory where the hook is called). If the backend cannot reliably avoid modifying the directory it builds from, it should copy any files it needs to build_directory and perform the build there.
The statement "it should copy any files it needs" is correct (but more subtle than it looks - it doesn't emphasise that the backend must not copy files it *doesn't* need, i.e., the developer clutter I'm concerned about). But the statement about "If the backend cannot reliably avoid modifying the directory it builds from" is misleading - the reason has *nothing* to do with whether backends can modify the source directory, and everything to do with whether backends can reasonably guarantee that there's nothing that would cause inconsistencies.
This is a fair concern, so I've updated that section in the PR where I'm working on bringing the example into line with the current specification: https://github.com/python/peps/pull/310/commits/49968595aa97c4ba8d621204a357... That commit also includes a fix to get the example to correctly handle repeated use of a common build directory by removing any previously extracted files. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia