On 05/12/2016 11:24 AM, Tomas Orsava wrote:
On 05/12/2016 05:16 PM, Miro HronĨok wrote:
> On 12.5.2016 15:24, John Dennis wrote:
>> On 05/11/2016 11:54 AM, Petr Viktorin wrote:
>>> On 05/11/2016 05:16 PM, John Dennis wrote:
>>>> The workaround I came up with is to delay the execution of
>>>> %py3_build by
>>>> at least 1 second by inserting a sleep in-between the %py2_build and
>>>> %py3_build macros in the spec file, like this:
>>>>
>>>> %py2_build
>>>> sleep 1
>>>> %py3_build
>>>>
>>>> Actually I think sleeping 2 seconds might be safer given the 1 second
>>>> resolution on the timestamps.
>>>
>>> A better workaround would be 'rm /usr/bin/xyz' instead of the sleep.
>>
>> I understand where you're coming from Petr but let me offer a reason for
>> why a short sleep might be preferable.
>>
>> In the interest of robustness it's best to avoid requiring someone to
>> enumerate exceptions. File lists change as do other aspects of the
>> build. It's very easy to miss enumerating every necessary exception on
>> every update to the spec file. If a simple short sleep is sufficient to
>> avoid manual enumeration then the minor inefficiency of the sleep seems
>> a price well paid.
>>
>
> Well, on the other hand, if setuptools/distutils decides that it will
> NEVER override a file, sleep stops working, rm works.
>
> With rm, what's happening is crystal clear. With sleep, not so much.
>
> rm is more explicit, explicit is better than implicit.
>
That seems like the best argument and solution, I'll amend the Python
RPM Porting Guide [PyRPG] accordingly.
[PyRPG]
http://python-rpm-porting.readthedocs.io/
Well, it looks like the doc needs updating in 2 places then because I
initially referenced
https://fedoraproject.org/wiki/Packaging:Python. I
didn't even know of the existence of RPM Porting Guide.
Maybe it's not a good idea to have 2 different documents that have to be
kept in sync. Maybe one should be definitive and the other reference it.
--
John