Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939875 - dev-python/cython-3.0.11 fails to build because of race(?)
Summary: dev-python/cython-3.0.11 fails to build because of race(?)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
: 939890 (view as bug list)
Depends on:
Blocks: parallel-make
  Show dependency tree
 
Reported: 2024-09-19 23:03 UTC by Grzegorz Kulewski
Modified: 2024-09-20 07:52 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grzegorz Kulewski 2024-09-19 23:03:50 UTC
Hello,

Recently I started getting this when trying to compile dev-python/cython-3.0.11 on my ~20 core build server:

2024-09-19 21:23:05,173 root INFO running build_ext                                                                                                                                                                 
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Tempita/_tempita.py                                                                                                           
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Utils.py                                                                                                                      
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Compiler/FusedNode.py                                                                                                         
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Compiler/Code.py                                                                                                              
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Compiler/Visitor.py                                                                                                           
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Compiler/FlowControl.py                                                                                                       
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Plex/Scanners.py                                                                                                              
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Compiler/Scanning.py                                                                                                          
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Compiler/Parsing.py                                                                                                           
[1/1] Cythonizing /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Plex/Machines.py    
2024-09-19 21:23:13,316 root INFO building 'Cython.Plex.Scanners' extension                                                                                                                                         
2024-09-19 21:23:13,372 root INFO creating /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11-python3_12/build/temp.linux-x86_64-cpython-312/var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/C
ython/Plex                                                                                                                                                                                                          
2024-09-19 21:23:13,868 root INFO building 'Cython.Plex.Machines' extension                                                                                                                                         
2024-09-19 21:23:13,869 root INFO x86_64-pc-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -O2 -pipe -ggdb -DNDEBUG -fPIC -I/usr/include/python3.12 -c /var/tmp/portage/dev-python/cython-3.0.11/work/cy
thon-3.0.11/Cython/Plex/Machines.c -o /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11-python3_12/build/temp.linux-x86_64-cpython-312/var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython
/Plex/Machines.o                                                                                                                                                                                                    
Assembler messages:                                                                                                                                                                                                 
Fatal error: can't create /var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11-python3_12/build/temp.linux-x86_64-cpython-312/var/tmp/portage/dev-python/cython-3.0.11/work/cython-3.0.11/Cython/Plex/Machin
es.o: No such file or directory


This problem doesn't happen every time but it happens most of the time. Also it's a new problem, never appeared in older builds (more than 3-5 days ago) so it may be related to some recent updates to python ebuilds but it may be related by pure (bad) luck making some preexisting problem in cython builds easier to reproduce.

It seems to me like some race in multiprocess make between mkdir and gcc. Forcing MAKEOPTS="-j1" worked the problem around for me (at least I wasn't able to reproduce this problem with -j1 and I tried several times).

Reproducible: Sometimes
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-19 23:05:25 UTC
I've started seeing this too, as well as on other Cython packages.

Downgrading setuptools *seems* to help but I don't see which change is causing it.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-19 23:08:57 UTC
The most pessimistic range is https://github.com/pypa/setuptools/compare/v74.1.2...v75.1.0 but there's some tags in-between which we can use for a smaller range.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-19 23:15:12 UTC
(In reply to Sam James from comment #3)
> dir_util changed..
> https://github.com/pypa/setuptools/commit/
> ce01828b6894c4597609da54fd343ea1aabfec84.

https://github.com/pypa/distutils/commits/378984e02edae91d5f49425da8436f8dd9152b8a/distutils/dir_util.py
Comment 5 Larry the Git Cow gentoo-dev 2024-09-19 23:54:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9263b3159f547b099e7f6abd61f929305e0c1516

commit 9263b3159f547b099e7f6abd61f929305e0c1516
Author:     Eli Schwartz <eschwartz@gentoo.org>
AuthorDate: 2024-09-19 23:49:11 +0000
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: 2024-09-19 23:53:25 +0000

    profiles: mask =dev-python/setuptools-75*
    
    It is very broken in the face of parallel builds and breaks all software
    using it as a build system via randomly appearing race conditions. One
    day, setuptools will update without breaking everything...
    
    Bug: https://github.com/pypa/setuptools/issues/4653
    Closes: https://bugs.gentoo.org/939798
    Closes: https://bugs.gentoo.org/939875
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>

 profiles/package.mask | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-20 07:52:14 UTC
*** Bug 939890 has been marked as a duplicate of this bug. ***