Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to break the cycle?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Mon Jul 15, 2024 9:29 am    Post subject: Reply with quote

Haven't gotten to reading ebuild man carefully yet, but straight execution gives:
Code:
# EPYTHON=python3.11 ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild configure
 * Python-3.12.3.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                                     [ ok ]
 * python-gentoo-patches-3.12.3.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                      [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                                                                                                                                    [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                                                                                                                   [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                                                                                                                  [ ok ]
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1442, in _start_fork
    target(*args, **kwargs)
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1184, in _exec2
    _configure_loopback_interface()
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 812, in _configure_loopback_interface
    with RtNetlink() as rtnl:
         ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/portage/util/netlink.py", line 67, in __init__
    self.sock.bind(self.addr)
    ^^^^^^^^^^^^^^
AttributeError: 'socket' object has no attribute 'bind'
 * The ebuild phase 'unpack' has exited unexpectedly. This type of behavior
 * is known to be triggered by things such as failed variable assignments
 * (bug #190128) or bad substitution errors (bug #200313). Normally, before
 * exiting, bash should have displayed an error message above. If bash did
 * not produce an error message above, it's possible that the ebuild has
 * called `exit` when it should have called `die` instead. This behavior
 * may also be triggered by a corrupt bash binary or a hardware problem
 * such as memory or cpu malfunction. If the problem is not reproducible or
 * it appears to occur randomly, then it is likely to be triggered by a
 * hardware problem. If you suspect a hardware problem then you should try
 * some basic hardware diagnostics such as memtest. Please do not report
 * this as a bug unless it is consistently reproducible and you are sure
 * that your bash binary and hardware are functioning properly.


Unless I'm asking to use python 3.11 wrong (man ebuild doesn't mention it at all), it still uses python 3.12 and fails on the same spot
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Mon Jul 15, 2024 10:19 am    Post subject: Reply with quote

Maybe you need to export EPYTHON=....
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Mon Jul 15, 2024 9:09 pm    Post subject: Reply with quote

Tried that as well - exactly the same result.
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Tue Jul 16, 2024 5:59 am    Post subject: Reply with quote

It looks like you have successfully finished fetch phase, but then failed at unpack phase. Maybe you can do that step manually?

Code:
>>> Unpacking source...
>>> Unpacking Python-3.12.3.tar.xz to /var/tmp/portage/dev-lang/python-3.12.3-r1/work
>>> Unpacking python-gentoo-patches-3.12.3.tar.xz to /var/tmp/portage/dev-lang/python-3.12.3-r1/work
>>> Source unpacked in /var/tmp/portage/dev-lang/python-3.12.3-r1/work


That's what happens after fetching and verifying checksums.

Then there's the prepare phase:

Code:
>>> Preparing source in /var/tmp/portage/dev-lang/python-3.12.3-r1/work/Python-3.12.3 ...
 * Applying patches from /var/tmp/portage/dev-lang/python-3.12.3-r1/work/python-gentoo-patches-3.12.3 ...
 *   0001-Blacklist-test_pickletools-from-__all__-test-as-it-i.patch ...                                                                                                             [ ok ]
 *   0002-Skip-RDS-socket-tests-that-hang-frequently.patch ...                                                                                                                       [ ok ]
 *   0003-ssl-Hard-disable-SSLv3-to-avoid-automagic-deps.patch ...                                                                                                                   [ ok ]
 *   0004-Skip-sched-priority-tests.patch ...                                                                                                                                        [ ok ]
 *   0005-Workaround-clang-musl-build-failure.patch ...                                                                                                                              [ ok ]
 *   0006-Skip-tests-which-interact-with-invalid-UTF-8-files.patch ...                                                                                                               [ ok ]
 *   0007-Prevent-tests-from-detecting-our-fake-tzdata-package.patch ...                                                                                                             [ ok ]
 *   0008-test_lzma-Skip-tests-requiring-extra-filters.patch ...                                                                                                                     [ ok ]
 * Running eautoreconf in '/var/tmp/portage/dev-lang/python-3.12.3-r1/work/Python-3.12.3' ...
 * Running 'aclocal --system-acdir=/var/tmp/portage/dev-lang/python-3.12.3-r1/temp/aclocal' ...                                                                                      [ ok ]
 * Running 'autoconf --force' ...                                                                                                                                                    [ ok ]
 * Running 'autoheader' ...                                                                                                                                                          [ ok ]
 * Running elibtoolize in: Python-3.12.3/
>>> Source prepared.


And then comes the configure phase that we are interested in.
Make sure you do everything as portage user. Doing things as root screws up permissions.
Another thing to note is that I avoided messing with EPYTHON.
Here are the steps:


  1. ebuild /var/db/repos/gentoo/dev-lang/python/python-3.12.3-r1.ebuild pretend
  2. ebuild /var/db/repos/gentoo/dev-lang/python/python-3.12.3-r1.ebuild setup
  3. cd /var/tmp/portage/dev-lang/python-3.12.3-r1
  4. ln -sv /var/db/repos/gentoo/dev-lang/python/files
  5. mkdir distdir
  6. cd distdir
  7. ln -sv /var/cache/distfiles/Python-3.12.3.tar.xz
  8. ln -sv /var/cache/distfiles/python-gentoo-patches-3.12.3.tar.xz
  9. cd ../work
  10. tar -xf ../distdir/Python-3.12.3.tar.xz
  11. tar -xf ../distdir/python-gentoo-patches-3.12.3.tar.xz
  12. cd ..
  13. touch .unpacked
  14. ebuld /var/db/repos/gentoo/dev-lang/python/python-3.12.3-r1.ebuild prepare
  15. ebuild /var/db/repos/gentoo/dev-lang/python/python-3.12.3-r1.ebuild configure


If that still does not configure python, we can do the prepare step manually as well.
It just applies gentoo patches and then calls aclocal, autoconf, autoheader and elibtoolize with some arguments.
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Tue Jul 16, 2024 9:55 am    Post subject: Reply with quote

Thanks for the detailed instructions.

Made some changes though:
Executing as root as:
Code:
# su portage
su: Authentication service cannot retrieve authentication info

When it passes far enough, I'd temporary setup portage user. For now I'm just chown-ing after each step if needed.

Using /usr/portage instead of /var/db/repos/gentoo.

After step 14 got:
Code:
# ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild prepare
>>> Existing ${T}/environment for 'python-3.12.3-r1' will be sourced. Run
>>> 'clean' to start with a fresh environment.
>>> Checking Python-3.12.3.tar.xz's mtime...
>>> Checking python-gentoo-patches-3.12.3.tar.xz's mtime...
>>> WORKDIR is up-to-date, keeping...
 * checking ebuild checksums ;-) ...                                                                                                                                                                                                                                    [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                                                                                                                   [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                                                                                                                  [ ok ]
>>> It appears that 'pretend' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.pretended' to force pretend.
>>> It appears that 'setup' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.setuped' to force setup.
>>> It appears that 'unpack' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.unpacked' to force unpack.
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1442, in _start_fork
    target(*args, **kwargs)
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1184, in _exec2
    _configure_loopback_interface()
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 812, in _configure_loopback_interface
    with RtNetlink() as rtnl:
         ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/portage/util/netlink.py", line 67, in __init__
    self.sock.bind(self.addr)
    ^^^^^^^^^^^^^^
AttributeError: 'socket' object has no attribute 'bind'
 * The ebuild phase 'prepare' has exited unexpectedly. This type of
 * behavior is known to be triggered by things such as failed variable
 * assignments (bug #190128) or bad substitution errors (bug #200313).
 * Normally, before exiting, bash should have displayed an error message
 * above. If bash did not produce an error message above, it's possible
 * that the ebuild has called `exit` when it should have called `die`
 * instead. This behavior may also be triggered by a corrupt bash binary or
 * a hardware problem such as memory or cpu malfunction. If the problem is
 * not reproducible or it appears to occur randomly, then it is likely to
 * be triggered by a hardware problem. If you suspect a hardware problem
 * then you should try some basic hardware diagnostics such as memtest.
 * Please do not report this as a bug unless it is consistently
 * reproducible and you are sure that your bash binary and hardware are
 * functioning properly.
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Tue Jul 16, 2024 4:21 pm    Post subject: Reply with quote

ferdish wrote:
For now I'm just chown-ing after each step if needed.


The portage user has no password. Normally, you don't actually want to switch to that user, but this is not a normal situation.
You can use sudo -u portage ....

ferdish wrote:
Using /usr/portage instead of /var/db/repos/gentoo.


I remember when /usr/portage was the default! I'll keep using paths that work on my system. That way, I know the step actually worked.

Slowly getting there...


  1. The first 13 steps remain the same. I'll start with an assumption that you are in /var/tmp/portage/dev-lang/python-3.12.3-r1/work/Python-3.12.3
  2. for f in ../python-gentoo-patches-3.12.3/*; do patch -Np1 < ${f}; done
  3. mkdir ../../temp/aclocal
  4. echo /usr/share/aclocal > ../../temp/aclocal/dirlist
  5. aclocal --system-acdir=/var/tmp/portage/dev-lang/python-3.12.3-r1/temp/aclocal
  6. autoconf --force
  7. autoheader
  8. TMPDIR=/tmp ELT_LOGDIR=/var/tmp/portage/dev-lang/python-3.12.3-r1/temp LD=ld eltpatch --force /var/tmp/portage/dev-lang/python-3.12.3-r1/work/Python-3.12.3
  9. touch ../../.prepared


That only leaves the configure step.
The src_configure() function is messy, but I think this is what it ends up doing on your system:

Code:
cat > Modules/Setup.local <<-EOF
*disabled*
nis
_tkinter
EOF

./configure \
      --enable-shared \
      --without-static-libpython \
      --enable-ipv6 \
      --infodir='/usr/share/info' \
      --mandir='/usr/share/man' \
      --with-computed-gotos \
      --with-dbmliborder="gdbm" \
      --with-libc= \
      --enable-loadable-sqlite-extensions \
      --without-ensurepip \
      --without-lto \
      --with-system-expat \
      --with-system-libmpdec \
      --with-platlibdir=lib \
      --with-pkg-config=yes \
      --with-wheel-pkg-dir=/usr/lib/python/ensurepip \
      --with-readline
echo EPYTHON='python3.12' > Lib/epython.py


But maybe you can try running this step with the ebuild command first?


Last edited by bstaletic on Tue Jul 16, 2024 4:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Tue Jul 16, 2024 4:47 pm    Post subject: Reply with quote

Code:

# sudo -u portage ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild configure
...
checking for bind... yes
...
configure: creating Modules/Setup.local
configure: creating Makefile
maksetup: 'nis' was handled by previous rule.
configure:

If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations

>>> Source configured.


What a plot twist!

I suspect the next one is sudo -u portage ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild compile, then test -> install -> preinst -> instprep -> postinst -> qmerge -> merge, but I'll wait for a confirmation.
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Tue Jul 16, 2024 5:00 pm    Post subject: Reply with quote

ferdish wrote:
Code:

# sudo -u portage ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild configure
...
checking for bind... yes
...
configure: creating Modules/Setup.local
configure: creating Makefile
maksetup: 'nis' was handled by previous rule.
configure:

If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations

>>> Source configured.


What a plot twist!


I was wondering if this would happen...

I guess you can try running the remaining steps with ebuild.

As far as I understand, the remaining steps, in order, are:


  • compile
  • test (optional)
  • instprep
  • preinst
  • install
  • postinst
  • qmerge


There's also the merge option that just invokes everything in order.
Also... do you need config for this package? I'm honestly not sure. Read the ebuild man page carefully once again.
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Tue Jul 16, 2024 5:18 pm    Post subject: Reply with quote

Well, I was going by man ebuild:
Quote:
By default, portage will execute all the functions in order up to the one actually specified


I don't think I need a config - I never tuned anything python related.
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Tue Jul 16, 2024 5:55 pm    Post subject: Reply with quote

https://devmanual.gentoo.org/ebuild-writing/functions/index.html

So, I got the order stlightly wrong.
pkg_config does not even exist for the python package.
I believe this is the right order:


  • compile - src_compile()
  • install - src_install()
  • instprep - don't know what that would invoke
  • preinst - pkg_preinst()
  • postinst - pkg_postinst()
  • qmerge - not an ebuild function.


Considering that part of thte man page you quoted, you could skip steps. Just keep in mind that portage is still not fixed.
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Tue Jul 16, 2024 6:00 pm    Post subject: Reply with quote

Code:
# sudo -u portage ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild qmerge
>>> Existing ${T}/environment for 'python-3.12.3-r1' will be sourced. Run
>>> 'clean' to start with a fresh environment.
 * checking ebuild checksums ;-) ...                                                                                                                                                                                                                                    [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                                                                                                                   [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                                                                                                                  [ ok ]
Permission denied: access('/', W_OK)
# ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild qmerge
>>> Existing ${T}/environment for 'python-3.12.3-r1' will be sourced. Run
>>> 'clean' to start with a fresh environment.
 * checking ebuild checksums ;-) ...                                                                                                                                                                                                                                    [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                                                                                                                   [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                                                                                                                  [ ok ]
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1442, in _start_fork
    target(*args, **kwargs)
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1184, in _exec2
    _configure_loopback_interface()
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 812, in _configure_loopback_interface
    with RtNetlink() as rtnl:
         ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/portage/util/netlink.py", line 67, in __init__
    self.sock.bind(self.addr)
    ^^^^^^^^^^^^^^
AttributeError: 'socket' object has no attribute 'bind'
 * The ebuild phase 'instprep' has exited unexpectedly. This type of
 * behavior is known to be triggered by things such as failed variable
 * assignments (bug #190128) or bad substitution errors (bug #200313).
 * Normally, before exiting, bash should have displayed an error message
 * above. If bash did not produce an error message above, it's possible
 * that the ebuild has called `exit` when it should have called `die`
 * instead. This behavior may also be triggered by a corrupt bash binary or
 * a hardware problem such as memory or cpu malfunction. If the problem is
 * not reproducible or it appears to occur randomly, then it is likely to
 * be triggered by a hardware problem. If you suspect a hardware problem
 * then you should try some basic hardware diagnostics such as memtest.
 * Please do not report this as a bug unless it is consistently
 * reproducible and you are sure that your bash binary and hardware are
 * functioning properly.
!!! instprep failed
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Tue Jul 16, 2024 6:50 pm    Post subject: Reply with quote

I assume everything before qmerge went fine?

Perhaps you could make that python a binary package, then install it that way.

ebuild /path/to/ebuild package will create a binary package in your $PKGDIR.
Then you can try with telling emerge to install from the binary archive.
Alternatively, use qmerge for the same.
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Tue Jul 16, 2024 9:33 pm    Post subject: Reply with quote

Yep, everything up to qmerge went well (except one test failed - about wheel group).
Code:
# ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild package
>>> Existing ${T}/environment for 'python-3.12.3-r1' will be sourced. Run
>>> 'clean' to start with a fresh environment.
>>> Checking Python-3.12.3.tar.xz's mtime...
>>> Checking python-gentoo-patches-3.12.3.tar.xz's mtime...
>>> WORKDIR is up-to-date, keeping...
 * checking ebuild checksums ;-) ...                                                                                                                                                                                                                                    [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                                                                                                                   [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                                                                                                                  [ ok ]
>>> It appears that 'pretend' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.pretended' to force pretend.
>>> It appears that 'setup' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.setuped' to force setup.
>>> It appears that 'unpack' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.unpacked' to force unpack.
>>> It appears that 'prepare' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.prepared' to force prepare.
>>> It appears that 'configure' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.configured' to force configure.
>>> It appears that 'compile' has already executed for 'python-3.12.3-r1'; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.compiled' to force compile.
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1442, in _start_fork
    target(*args, **kwargs)
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1184, in _exec2
    _configure_loopback_interface()
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 812, in _configure_loopback_interface
    with RtNetlink() as rtnl:
         ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/portage/util/netlink.py", line 67, in __init__
    self.sock.bind(self.addr)
    ^^^^^^^^^^^^^^
AttributeError: 'socket' object has no attribute 'bind'
 * The ebuild phase 'test' has exited unexpectedly. This type of behavior
 * is known to be triggered by things such as failed variable assignments
 * (bug #190128) or bad substitution errors (bug #200313). Normally, before
 * exiting, bash should have displayed an error message above. If bash did
 * not produce an error message above, it's possible that the ebuild has
 * called `exit` when it should have called `die` instead. This behavior
 * may also be triggered by a corrupt bash binary or a hardware problem
 * such as memory or cpu malfunction. If the problem is not reproducible or
 * it appears to occur randomly, then it is likely to be triggered by a
 * hardware problem. If you suspect a hardware problem then you should try
 * some basic hardware diagnostics such as memtest. Please do not report
 * this as a bug unless it is consistently reproducible and you are sure
 * that your bash binary and hardware are functioning properly.
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Tue Jul 16, 2024 11:48 pm    Post subject: Reply with quote

Looks like I have portage-utils installed.
Everything succeeded up to:

Code:
# emerge --usepkg -a1 python

!!! Your current profile is deprecated and not supported anymore.
!!! Use eselect profile to update your profile.
!!! Please upgrade to the following profile if possible:

        default/linux/amd64/23.0/split-usr
...
Calculating dependencies                                     ... done!
Dependency resolution took 8.65 s (backtrack: 0/20).

[ebuild   R    ] dev-lang/python-3.12.3-r1

Would you like to merge these packages? [Yes/No] Yes

>>> Verifying ebuild manifests

>>> Running pre-merge checks for dev-lang/python-3.12.3-r1
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1442, in _start_fork
    target(*args, **kwargs)
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1184, in _exec2
    _configure_loopback_interface()
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 812, in _configure_loopback_interface
    with RtNetlink() as rtnl:
         ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/portage/util/netlink.py", line 67, in __init__
    self.sock.bind(self.addr)
    ^^^^^^^^^^^^^^
AttributeError: 'socket' object has no attribute 'bind'
>>> It appears that 'python-3.12.3-r1' is already pretended; skipping.
>>> Remove '/var/tmp/portage/dev-lang/python-3.12.3-r1/.pretended' to force pretend.
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1442, in _start_fork
    target(*args, **kwargs)
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1184, in _exec2
    _configure_loopback_interface()
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 812, in _configure_loopback_interface
    with RtNetlink() as rtnl:
         ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/portage/util/netlink.py", line 67, in __init__
    self.sock.bind(self.addr)
    ^^^^^^^^^^^^^^
AttributeError: 'socket' object has no attribute 'bind'

>>> Emerging (1 of 1) dev-lang/python-3.12.3-r1::gentoo
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1442, in _start_fork
    target(*args, **kwargs)
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 1184, in _exec2
    _configure_loopback_interface()
  File "/usr/lib/python3.12/site-packages/portage/process.py", line 812, in _configure_loopback_interface
    with RtNetlink() as rtnl:
         ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/portage/util/netlink.py", line 67, in __init__
    self.sock.bind(self.addr)
    ^^^^^^^^^^^^^^
AttributeError: 'socket' object has no attribute 'bind'

>>> Failed to emerge dev-lang/python-3.12.3-r1


In your description
Code:
[binary   R    ] dev-lang/python-3.12.3-r1

but for me it shows
Code:
[ebuild   R    ] dev-lang/python-3.12.3-r1


Archive /var/cache/binpkgs/dev-lang/python-3.12.3-r1.tbz2 exists. I don't have PKGDIR defined in make.conf
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Tue Jul 16, 2024 11:56 pm    Post subject: Reply with quote

ferdish wrote:
Looks like I have portage-utils installed.

In your description
Code:
[binary   R    ] dev-lang/python-3.12.3-r1

but for me it shows
Code:
[ebuild   R    ] dev-lang/python-3.12.3-r1


That difference between binary and ebuild is important. If it says ebuild, portage will try to compile, which we know does not work.
Try using --usepkgonly instead.
Also what is the output of file /var/cache/binpkgs/dev-lang/python-3.12.3-r1.tbz2?
It should be
Code:
/var/cache/binpkgs/dev-lang/python-3.12.3-r1.tbz2: Gentoo binary package (XPAK)
.
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Wed Jul 17, 2024 12:08 am    Post subject: Reply with quote

Code:
# file /var/cache/binpkgs/dev-lang/python-3.12.3-r1.tbz2
/var/cache/binpkgs/dev-lang/python-3.12.3-r1.tbz2: Gentoo binary package (XPAK)
# emerge --usepkgonly -a1 python
...
These are the packages that would be merged, in order:

Calculating dependencies                ... done!
Dependency resolution took 4.62 s (backtrack: 0/20).


emerge: there are no binary packages to satisfy "python".
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Wed Jul 17, 2024 4:13 am    Post subject: Reply with quote

Your portage tree is still in the old location. Maybe other things are pointed to the old paths as well.
Try copying the package to /usr/portage/packages/dev-lang/.
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Wed Jul 17, 2024 4:19 am    Post subject: Reply with quote

Code:
# ls -lA /usr/portage/packages/dev-lang/
total 38012
-rw-r--r-- 1 root root 38922935 Jul 16 16:36 python-3.12.3-r1.tbz2
# emerge --usepkgonly -a1 python
...
These are the packages that would be merged, in order:

Calculating dependencies                      ... done!
Dependency resolution took 4.62 s (backtrack: 0/20).


emerge: there are no binary packages to satisfy "python".


I copied, so python-3.12.3-r1.tbz2 is in both places. Tried /usr/portage/packages/dev-lang/python and defining PKGDIR in make.conf - same result
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Wed Jul 17, 2024 4:40 am    Post subject: Reply with quote

You can check where your PKGDIR is with
Code:
emerge --info | grep PKGDIR


But if you can't get that working... options are (in no particular order):


  • Try installing the binary with qmerge -KO python:3.12.
  • Replace your current _socket.cpython*.so with the one that was compiled, then use ebuild /path/to/ebuild qmerge.
  • Just manually copy the files where appropriate - image/* into / and build-info/* into... wherever your portage metadata is located.
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Wed Jul 17, 2024 4:53 am    Post subject: Reply with quote

Code:
# emerge --info | grep PKGDIR
PKGDIR="/var/cache/binpkgs"
# qmerge qmerge -KO python:3.12 # this did the trick!
...
# python -c 'print(__import__("_socket").socket.bind)'
<method 'bind' of '_socket.socket' objects>


I think the main obstacle is fixed now.
Code:
time emerge --sync && time emerge --update --deep --verbose --with-bdeps=y --newuse --pretend world

worked. Thank you for your guidance. I would've been lost on my own.

What do I do next? Should I re-emerge portage/python-exec/...? Or is my gentoo completely healed now? (I'm so happy right now)
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Wed Jul 17, 2024 5:02 am    Post subject: Reply with quote

Nice! Everything should be working, but I wouldn't leave it be just yet.

Code:
ebuild /path/to/ebuild configure


Just to make sure that cpython still can detect bind().

Then, assuming the configure step goes well, consider rebuilding python through emerge.
Shouldn't be necessary, but we have installed the package in a very unusual way and I'm thinking "what if we missed something".
Back to top
View user's profile Send private message
ferdish
n00b
n00b


Joined: 11 Jun 2024
Posts: 23

PostPosted: Wed Jul 17, 2024 5:09 am    Post subject: Reply with quote

Code:

# rm /var/tmp/portage/dev-lang/python-3.12.3-r1/.configured
# sudo -u portage ebuild /usr/portage/dev-lang/python/python-3.12.3-r1.ebuild configure
...
checking for bind... yes
...

worked just fine.

Good idea about re-emerging through emerge. In case it gets broken again it'd be just one last command to fix it.
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 357

PostPosted: Wed Jul 17, 2024 1:58 pm    Post subject: Reply with quote

One more thing. After fixing everything, do emerge -c, to clean up. Also do eclean.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum