When emerging sci-libs/scikit-learn-1.3.2, it fails during the compile phase with the following output: […] building 'liblinear-skl' library INFO: C compiler: x86_64-pc-linux-gnu-gcc -Wsign-compare -DNDEBUG -march=native -O2 -pipe -DNDEBUG -fPIC creating /var/tmp/portage/sci-libs/scikit-learn-1.3.2/work/scikit-learn-1.3.2-python3_11/build/temp.linux-x86_64-cpython-311/sklearn/svm/src/liblinear INFO: compile options: '-c' File "/usr/lib/python-exec/python3.11/gpep517", line 4, in <module> sys.exit(main()) ^^^^^^ File "/usr/lib/python3.11/site-packages/gpep517/__main__.py", line 425, in main return func(args) ^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/gpep517/__main__.py", line 215, in build_wheel print(build_wheel_impl(args, args.wheel_dir), file=out) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/gpep517/__main__.py", line 207, in build_wheel_impl wheel_name = backend.build_wheel(str(wheel_dir), args.config_json) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 434, in build_wheel return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 419, in _build_with_temp_dir self.run_setup() File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup exec(code, locals()) File "<string>", line 633, in <module> File "<string>", line 629, in setup_package File "/usr/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command super().run_command(command) File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/usr/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 364, in run self.run_command("build") File "/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command super().run_command(command) File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run self.run_command(cmd_name) File "/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command super().run_command(command) File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build_clib.py", line 111, in run self.build_libraries(self.libraries) File "/usr/lib/python3.11/site-packages/setuptools/command/build_clib.py", line 85, in build_libraries self.compiler.compile( File "/usr/lib/python3.11/site-packages/numpy/distutils/ccompiler.py", line 91, in <lambda> m = lambda self, *args, **kw: func(self, *args, **kw) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/numpy/distutils/ccompiler.py", line 360, in CCompiler_compile if len(build) > 1 and jobs > 1: ^^^^^^^^ TypeError: '>' not supported between instances of 'str' and 'int' Reproducible: Always
Created attachment 874271 [details] output of emerge -pqv '=sci-libs/scikit-learn-1.3.2::gentoo'
Created attachment 874272 [details] output of emerge --info '=sci-libs/scikit-learn-1.3.2::gentoo'
Created attachment 874273 [details] build log
What's the dev-python/numpy version?
(In reply to Michał Górny from comment #4) > What's the dev-python/numpy version? 1.26.1 with lapack flag and python target python3_11
> * dev-python/cython : 3.0.2-r1 Could you retry with cython 3.0.4 or 3.0.5? It worked for me earlier with the same numpy version.
(In reply to Andrew Ammerlaan from comment #6) > > * dev-python/cython : 3.0.2-r1 > > Could you retry with cython 3.0.4 or 3.0.5? It worked for me earlier with > the same numpy version. Neither 3.0.4 or 3.0.5 work for me. The build fails in the same way.
My only other suspicion right now is stefantalpalaru repo -- it seems to override a lot...
(In reply to Michał Górny from comment #8) > My only other suspicion right now is stefantalpalaru repo -- it seems to > override a lot... I only have dev-qt/qtwebkit installed from there.
Looking at the code, the function get_num_build_jobs from numpy.distutils.misc_util is what generates the problematic jobs variable. When I run that code myself, it seems to do the right thing. --- # python -c 'from numpy.distutils.misc_util import get_num_build_jobs; jobs = get_num_build_jobs(); print("***\n"); print(jobs, type(jobs))' <string>:1: DeprecationWarning: `numpy.distutils` is deprecated since NumPy 1.23.0, as a result of the deprecation of `distutils` itself. It will be removed for Python >= 3.12. For older Python versions it will remain present. It is recommended to use `setuptools < 60.0` for those Python versions. For more details, see: https://numpy.org/devdocs/reference/distutils_status_migration.html *** 8 <class 'int'> ---
Note that we're setting DIST_EXTRA_CONFIG var, so perhaps it affects it.
For me (cython 3.0.2-r1, numpy-1.26.1, python-3.10.13,3.11.5), scikit-learn-1.3.2.ebuild works after commenting the strings: #DISTUTILS_EXT=1 #DISTUTILS_USE_PEP517=setuptools .
As you have probably guessed, I can't reproduce this. The primary question then is: what is special about your system? I suppose you're running an up-to-date system, with no p.masked packages left over? My first ideas would be: - PYTHONPATH including third-party modules - orphan files in /usr/lib/python3.11/site-packages - distutils/setuptools plugins (that we don't have installed), i.e. paste: $ find /usr/lib/python3.11/site-packages/ -name entry_points.txt | xargs grep '\[distutils\|\[setuptools'
(In reply to Michał Górny from comment #13) > […] I suppose you're running an up-to-date system, with no p.masked packages left over? Indeed, and I try to minimize testing/unstable packages. --- # eix --installed-masked No matches found --- > My first ideas would be: > - PYTHONPATH including third-party modules How can I check for this? In a shell, I get --- # echo $PYTHONPATH --- But I guess this variable may be set differently during package installation. > - orphan files in /usr/lib/python3.11/site-packages How can I check for this? > - distutils/setuptools plugins (that we don't have installed), i.e. paste: > > $ find /usr/lib/python3.11/site-packages/ -name entry_points.txt | xargs > grep '\[distutils\|\[setuptools' --- # find /usr/lib/python3.11/site-packages/ -name entry_points.txt | xargs grep '\[distutils\|\[setuptools' /usr/lib/python3.11/site-packages/calver-2023.5.4.dist-info/entry_points.txt:[distutils.setup_keywords] /usr/lib/python3.11/site-packages/pbr-5.11.1.dist-info/entry_points.txt:[distutils.setup_keywords] /usr/lib/python3.11/site-packages/incremental-22.10.0.dist-info/entry_points.txt:[distutils.setup_keywords] /usr/lib/python3.11/site-packages/isort-5.12.0.dist-info/entry_points.txt:[distutils.commands] /usr/lib/python3.11/site-packages/wheel-0.41.2.dist-info/entry_points.txt:[distutils.commands] /usr/lib/python3.11/site-packages/setuptools_rust-1.7.0.dist-info/entry_points.txt:[distutils.commands] /usr/lib/python3.11/site-packages/setuptools_rust-1.7.0.dist-info/entry_points.txt:[distutils.setup_keywords] /usr/lib/python3.11/site-packages/setuptools_rust-1.7.0.dist-info/entry_points.txt:[setuptools.finalize_distribution_options] /usr/lib/python3.11/site-packages/setuptools-68.2.2.dist-info/entry_points.txt:[distutils.commands] /usr/lib/python3.11/site-packages/setuptools-68.2.2.dist-info/entry_points.txt:[distutils.setup_keywords] /usr/lib/python3.11/site-packages/setuptools-68.2.2.dist-info/entry_points.txt:[setuptools.finalize_distribution_options] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[distutils.setup_keywords] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[setuptools.file_finders] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[setuptools.finalize_distribution_options] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[setuptools_scm.files_command] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[setuptools_scm.files_command_fallback] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[setuptools_scm.local_scheme] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[setuptools_scm.parse_scm] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[setuptools_scm.parse_scm_fallback] /usr/lib/python3.11/site-packages/setuptools_scm-8.0.4.dist-info/entry_points.txt:[setuptools_scm.version_scheme] /usr/lib/python3.11/site-packages/cffi-1.16.0.dist-info/entry_points.txt:[distutils.setup_keywords] /usr/lib/python3.11/site-packages/Babel-2.13.1.dist-info/entry_points.txt:[distutils.commands] /usr/lib/python3.11/site-packages/Babel-2.13.1.dist-info/entry_points.txt:[distutils.setup_keywords] ---
(In reply to Aleksander Zatserkovnyy from comment #12) > For me (cython 3.0.2-r1, numpy-1.26.1, python-3.10.13,3.11.5), > scikit-learn-1.3.2.ebuild works after commenting the strings: > #DISTUTILS_EXT=1 > #DISTUTILS_USE_PEP517=setuptools Do you otherwise get the same error as I reported?
(In reply to Erik Quaeghebeur from comment #14) > (In reply to Michał Górny from comment #13) > > […] I suppose you're running an up-to-date system, with no p.masked packages left over? > Indeed, and I try to minimize testing/unstable packages. Hmm, so it's a mixed stable/~arch system? Perhaps we're missing lower bound (>= dep) on one of the dependencies. > > - orphan files in /usr/lib/python3.11/site-packages > How can I check for this? $ find /usr/lib/python3.11/site-packages -type f -print0 | xargs -0 qfile -o You need to install portage-utils for that. You may get some '*-pytest-*.pyc' files, these are harmless. > > > - distutils/setuptools plugins (that we don't have installed), i.e. paste: > > > > $ find /usr/lib/python3.11/site-packages/ -name entry_points.txt | xargs > > grep '\[distutils\|\[setuptools' > --- > # find /usr/lib/python3.11/site-packages/ -name entry_points.txt | xargs > grep '\[distutils\|\[setuptools' > [...] I have all of them in my test env, so probably none of these are the problem.
(In reply to Michał Górny from comment #16) > > > - orphan files in /usr/lib/python3.11/site-packages > > How can I check for this? > > $ find /usr/lib/python3.11/site-packages -type f -print0 | xargs -0 qfile -o Returns nothing (no output).
(In reply to Erik Quaeghebeur from comment #15) > (In reply to Aleksander Zatserkovnyy from comment #12) > > For me (cython 3.0.2-r1, numpy-1.26.1, python-3.10.13,3.11.5), > > scikit-learn-1.3.2.ebuild works after commenting the strings: > > #DISTUTILS_EXT=1 > > #DISTUTILS_USE_PEP517=setuptools > Do you otherwise get the same error as I reported? Yes, I do. I have checked the workaround on two my hosts. The same error (TypeError: '>' ...) without the comments in the ebuild. And now I have: sci-libs/scikit-learn Latest version available: 1.3.2-r111 Latest version installed: 1.3.2-r111 Size of files: 7 472 KiB Homepage: https://scikit-learn.org/stable/ Description: Machine learning library for Python License: BSD
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99c9650e12f1b7c7f0ede3840220c2e2b5ccfa3c commit 99c9650e12f1b7c7f0ede3840220c2e2b5ccfa3c Author: Patrick McLean <chutzpah@gentoo.org> AuthorDate: 2023-11-10 02:36:17 +0000 Commit: Patrick McLean <chutzpah@gentoo.org> CommitDate: 2023-11-10 18:26:02 +0000 sci-libs/scikit-learn: Add dep on pythran-0.14.0 (bug #917013) Closes: https://bugs.gentoo.org/917013 Signed-off-by: Patrick McLean <chutzpah@gentoo.org> .../{scikit-learn-1.3.2.ebuild => scikit-learn-1.3.2-r1.ebuild} | 1 + 1 file changed, 1 insertion(+)