On 27 June 2017 at 18:54, Nathaniel Smith <n...@pobox.com> wrote:
> On Tue, Jun 27, 2017 at 12:27 AM, Nick Coghlan <ncogh...@gmail.com> wrote:
>> 2. If you don't find the input preparation hook:
>>
>> - call `get_build_sdist_requires()`
>> - call `get_build_wheel_requires()`
>> - install both sets of additional dependencies
>> - call `build_sdist()`
>> - unpack the sdist into the build directory
>> - call `build_wheel()`
>
> Side note: I think this is wrong -- I think you can't call
> get_build_wheel_requires until after you've unpacked the sdist,
> because that's a whole new tree that might be arbitrarily different.
> (In practice I guess this should never happen, but we should be clear
> conceptually I think.)

No, both `get_build_wheel_requires()` and `build_wheel()` also have to
work in-place - backends aren't allowed to assume that *all* builds
will be out-of-tree, even though pip specifically is expected to work
that way. Neither of these hooks is allowed to give different results
depending on whether you're doing an in-place or out-of-tree build.

To put it another way, there are two build paths that backends are
required to support:

- in-place, direct from the original source tree
- out-of-tree, from an unpacked sdist

There's also a third, optional, build path for backends that define
`prepare_wheel_input_files`:

- out-of-tree, from a prepared wheel input directory

The result wheel should be "the same" regardless of how the build is
executed. In practice, we expect there will be some variation, just
because reproducible builds are hard. However, the output of the
different paths should be at least as similar as any two builds of the
same source tree run at different times with the same system
configuration.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to