Description of problem: In the py3_build macro there is a "sleep 1" statement on EL7 and fedora. This was added in the following commit: https://src.fedoraproject.org/cgit/rpms/python-rpm-macros.git/commit/macros.python3?id=af37c2283549ca22bad8ad6abf569eab15eed5b8 After contacting the author of the commit, they have indicated this was to resolve a race condition between py2 and py3 builds. However, they note that there is no related issue because it was before pagure. Other distros (openSUSE) don't have an equivalent sleep statement. So perhaps the issue is now no longer present. It would be great if the sleep statement could be removed and build results checked to see if this affects anything. Thanks, Version-Release number of selected component (if applicable): python3-rpm-macros-3-37.fc29.noarch python3-rpm-macros on el7
As far as I can recall, there's a race condition involving file timestamps when the py2 and py3 builds are done in the same second. In the install step, files with the same timestamp aren't overwritten, so if the py2 and py3 versions produce the same file (commonly, a command for /usr/bin), and %py2_install;%py3_install is run to install them, the package can, in rare cases, end up with the py2 version not being overwritten by the py3 one. Here's some discussion on it from Debian land: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548392 > It would be great if the sleep statement could be removed and build results checked to see if this affects anything. It's a race condition, so it's tricky to check :( Also the resulting bug is hard to debug, and likely to hit packagers who aren't Python experts. I'd be careful. Maybe we can remove the sleep for python3 but, to be safe, add it to the beginning of py2_build macros? Those are going away. Let's not touch EL.
I think that adding this to the py2_build seems reasonable, but doesn't that rely on the rpm spec listing: py3_build py2_build In that order? If the spec had py2_build py3_build This would just occur again. So I think it may need to remain then if this is a problem ... Thanks for your great explanation about the problem, I really appreciate it.
Ah, sorry, I wasn't clear there. The py2 macros currently also have the sleep at the end. I meant to suggest adding *another* one to the beginning for py2, and removing the one for py3. That way the workaround still works in both orders. And py2-only builds would be slower -- but those are just 19% of Python packages (with that number going down), and they generally aren't rebuilt very often.
That sounds like a really good solution, thanks for clearing that up. I'll leave it up to you how you want to handle this bug (close and open issue to pagure, close when py2 macros are changed etc).
https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/14
Petr, nice solution, merged and built in rawhide. This is an improvement, not a bugfix per se, so I feel no urge to push it to F29 after it has been already released (potentially disturbing packages that built but no longer builds, if we introduce a bug in the code (however unlikely)). Hence closing as RAWHIDE. If you really want this in F29, please reopen.
Hi, this changes slightly the behavior. Before this patch you could do something like: LDFLAGS="custom_ldflags" %py2_build LDFLAGS="custom_ldflags" %py3_build After this patch you cannot do it (for python2) anymore since LDFLAGS is only passed to sleep instead of "python2 setup.py". If you think the regression can be a problem, I suggest to revert this.
Out of curiosity, can you provide an example of where this is currently used in a specfile? This sounds really specific as a solution to a problem, so I think perhaps a localised work around for the situation is better than reverting this change.
As an immediate workaround, export the variables: export LDFLAGS="custom_ldflags" %py2_build %py3_build
As a workaround on our side, we should be able tu use: CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" %{__python2} $(sleep 1) %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '29'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 29 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.