Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 818043 - missing compile phase output when using distutils-r1.eclass in Prefix
Summary: missing compile phase output when using distutils-r1.eclass in Prefix
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-14 03:38 UTC by Steven Trogdon
Modified: 2022-01-24 07:07 UTC (History)
3 users (show)

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


Attachments
compiling on Prefix (ebuild_compile_prefix,2.21 KB, text/plain)
2021-10-14 03:42 UTC, Steven Trogdon
Details
compiling on Gentoo (ebuild_compile_gentoo,3.76 KB, text/plain)
2021-10-14 03:42 UTC, Steven Trogdon
Details
emerge --info on Prefix (emerge_info,5.88 KB, text/plain)
2021-10-14 03:45 UTC, Steven Trogdon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Trogdon 2021-10-14 03:38:14 UTC
The issue seems to appear whenever an ebuild requires an extension to be built. I have attached terminal output building dev-python/memory_allocator-0.1.1 from the https://github.com/cschwan/sage-on-gentoo overlay up through the compile phase. One file is for compiling on Gentoo and the other on Prefix. Typical output is

Prefix:

running build_ext
>>> Source compiled.

Gentoo:

running build_ext
building 'memory_allocator.memory_allocator' extension
creating /var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.linux-x86_64-3.9
creating /var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.linux-x86_64-3.9/memory_allocator
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -I/usr/include/python3.9 -c memory_allocator/memory_allocator.c -o /var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.linux-x86_64-3.9/memory_allocator/memory_allocator.o
building 'memory_allocator.test' extension
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -I/usr/include/python3.9 -c memory_allocator/test.c -o /var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.linux-x86_64-3.9/memory_allocator/test.o
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe /var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.linux-x86_64-3.9/memory_allocator/memory_allocator.o -L/usr/lib64 -o /var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/lib/memory_allocator/memory_allocator.cpython-39-x86_64-linux-gnu.so
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe /var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.linux-x86_64-3.9/memory_allocator/test.o -L/usr/lib64 -o /var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/lib/memory_allocator/test.cpython-39-x86_64-linux-gnu.so
>>> Source compiled.

Even though compile output is missing for extensions in Prefix the extensions are built.
Comment 1 Steven Trogdon 2021-10-14 03:42:07 UTC
Created attachment 744834 [details]
compiling on Prefix
Comment 2 Steven Trogdon 2021-10-14 03:42:48 UTC
Created attachment 744837 [details]
compiling on Gentoo
Comment 3 Steven Trogdon 2021-10-14 03:45:54 UTC
Created attachment 744840 [details]
emerge --info on Prefix
Comment 4 Steven Trogdon 2021-10-21 02:54:42 UTC
This is probably not related to the distutils-r1.eclass but to something python on Prefix.  On Prefix, relative to https://github.com/cschwan/sage-on-gentoo/blob/master/dev-python/memory_allocator/memory_allocator-0.1.1.ebuild after

ebuild memory_allocator-0.1.1.ebuild unpack

there is at the beginning of setup.py in the work folder

from setuptools import setup, find_packages
from setuptools.extension import Extension
from distutils.command.build_ext import build_ext as du_build_ext


class build_ext(du_build_ext):
    def run(self):
        from Cython.Build.Dependencies import cythonize
        self.distribution.ext_modules[:] = cythonize(
            self.distribution.ext_modules,
            language_level=3)
        du_build_ext.run(self)

which appears to be correct.

However, from the work folder

python setup.py build_ext

returns just

`running build_ext`

without any compiling info.

And then `python setup.py build_ext --force` returns again just the same `running build_ext`. On Gentoo

python setup.py build_ext

returns

running build_ext
building 'memory_allocator.memory_allocator' extension
x86_64-pc-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.9 -c memory_allocator/memory_allocator.c -o build/temp.linux-x86_64-3.9/memory_allocator/memory_allocator.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed build/temp.linux-x86_64-3.9/memory_allocator/memory_allocator.o -L/usr/lib64 -o build/lib.linux-x86_64-3.9/memory_allocator/memory_allocator.cpython-39-x86_64-linux-gnu.so
building 'memory_allocator.test' extension
x86_64-pc-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.9 -c memory_allocator/test.c -o build/temp.linux-x86_64-3.9/memory_allocator/test.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed build/temp.linux-x86_64-3.9/memory_allocator/test.o -L/usr/lib64 -o build/lib.linux-x86_64-3.9/memory_allocator/test.cpython-39-x86_64-linux-gnu.so
Comment 5 Larry the Git Cow gentoo-dev 2021-10-21 06:39:32 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ce4687a8c9a175ac2b08b42881efead4218a7f58

commit ce4687a8c9a175ac2b08b42881efead4218a7f58
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-10-21 06:39:04 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-10-21 06:39:04 +0000

    python-utils-r1: sync with gx86, bug #818043
    
    Bug: https://bugs.gentoo.org/818043
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 eclass/python-utils-r1.eclass | 117 ++++++++++++++++++++++--------------------
 1 file changed, 62 insertions(+), 55 deletions(-)
Comment 6 Fabian Groffen gentoo-dev 2021-10-21 06:40:17 UTC
can you try using above commit, it did enable some compileall phases for later python versions, which is possibly this issue
Comment 7 Steven Trogdon 2021-10-21 16:26:22 UTC
I could not directly patch but used https://gitweb.gentoo.org/repo/proj/prefix.git/plain/eclass/python-utils-r1.eclass?id=ce4687a8c9a175ac2b08b42881efead4218a7f58 from the git tree

I see no difference in output. After `ebuild memory_allocator-0.1.1.ebuild clean compile` I have

...

running build_ext
>>> Source compiled.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-23 18:29:17 UTC
What platforms have you seen this on?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-23 18:46:31 UTC
For me:

running build_ext
building 'memory_allocator.memory_allocator' extension
building 'memory_allocator.test' extension
creating /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.macosx-11.0-x86_64-3.9
creating /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.macosx-11.0-x86_64-3.9/memory_allocator
creating /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.macosx-11.0-x86_64-3.9/memory_allocator
x86_64-apple-darwin20-gcc -march=native -O2 -pipe -I/Users/sam/Gentoo/usr/include/python3.9 -c memory_allocator/memory_allocator.c -o /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.macosx-11.0-x86_64-3.9/memory_allocator/memory_allocator.o
x86_64-apple-darwin20-gcc -march=native -O2 -pipe -I/Users/sam/Gentoo/usr/include/python3.9 -c memory_allocator/test.c -o /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.macosx-11.0-x86_64-3.9/memory_allocator/test.o
x86_64-apple-darwin20-gcc -bundle -undefined dynamic_lookup -Wl,-dead_strip_dylibs -march=native -O2 -pipe /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.macosx-11.0-x86_64-3.9/memory_allocator/memory_allocator.o -L/Users/sam/Gentoo/usr/lib -o /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/lib/memory_allocator/memory_allocator.cpython-39-darwin.bundle
x86_64-apple-darwin20-gcc -bundle -undefined dynamic_lookup -Wl,-dead_strip_dylibs -march=native -O2 -pipe /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/temp.macosx-11.0-x86_64-3.9/memory_allocator/test.o -L/Users/sam/Gentoo/usr/lib -o /Users/sam/Gentoo/var/tmp/portage/dev-python/memory_allocator-0.1.1/work/memory_allocator-0.1.1-python3_9/lib/memory_allocator/test.cpython-39-darwin.bundle
>>> Source compiled.
>>> Test phase [not enabled]: dev-python/memory_allocator-0.1.1

Are you sure they're actually being built?
Comment 10 Steven Trogdon 2022-01-24 01:50:01 UTC
Yes, they are built for both python3.9 and python3.10. From the work folder

$ ls memory_allocator-0.1.1-python3_9/lib/memory_allocator/
__init__.pxd                                     memory.pxd
__init__.py                                      signals.pxd
memory_allocator.cpython-39-x86_64-linux-gnu.so  test.cpython-39-x86_64-linux-gnu.so
memory_allocator.pxd

$ ls memory_allocator-0.1.1-python3_10/lib/memory_allocator/
__init__.pxd                                      memory.pxd
__init__.py                                       signals.pxd
memory_allocator.cpython-310-x86_64-linux-gnu.so  test.cpython-310-x86_64-linux-gnu.so
memory_allocator.pxd

The host is

$ uname -a
Linux vaio-home 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz GenuineIntel GNU/Linux

with OS

$ lsb_release -a
LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.6 LTS
Release:        14.04
Codename:       trusty
Comment 11 Steven Trogdon 2022-01-24 02:12:54 UTC
I now do see slightly different output:

python3.9

running build_ext
Compiling memory_allocator/memory_allocator.pyx because it depends on /storage/strogdon/gentoo-rap/usr/lib/python3.9/site-packages/Cython/Includes/libc/string.pxd.
Compiling memory_allocator/test.pyx because it depends on /storage/strogdon/gentoo-rap/usr/lib/python3.9/site-packages/Cython/Includes/libc/stdint.pxd.
[1/2] Cythonizing memory_allocator/memory_allocator.pyx
[2/2] Cythonizing memory_allocator/test.pyx
>>> Source compiled.

python3.10

running build_ext
Compiling memory_allocator/memory_allocator.pyx because it depends on /storage/strogdon/gentoo-rap/usr/lib/python3.10/site-packages/Cython/Includes/libc/string.pxd.
Compiling memory_allocator/test.pyx because it depends on /storage/strogdon/gentoo-rap/usr/lib/python3.10/site-packages/Cython/Includes/libc/stdint.pxd.
[1/2] Cythonizing memory_allocator/memory_allocator.pyx
[2/2] Cythonizing memory_allocator/test.pyx
>>> Source compiled.
Comment 12 Steven Trogdon 2022-01-24 02:59:27 UTC
This output is now in sync with what I see on Gentoo. I have no idea what has changed?
Comment 13 Steven Trogdon 2022-01-24 03:09:08 UTC
Perhaps cython is the culprit. I now have dev-python/cython-0.29.26 installed everywhere.
Comment 14 Fabian Groffen gentoo-dev 2022-01-24 07:07:28 UTC
Perhaps the change that Sam made to python-3.9.6 for distutils?  In any case happy it seems resolved now.  Please reopen if it comes back again.