Linuxbrew-core: Link error after upgrading to [email protected]_1

Created on 20 Apr 2020  Â·  24Comments  Â·  Source: Homebrew/linuxbrew-core

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • [x] ran brew update and can still reproduce the problem?
  • [x] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [x] ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • [x] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

Run tox or thefuck.

What happened (include command output)

I tried to run tox after upgrading and it seems that the symlinks are broken to both tox and thefuck.


Command output

tox
/home/linuxbrew/.linuxbrew/Cellar/tox/3.14.6/libexec/bin/python3.8: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory


What you expected to happen

tox should work

Step-by-step reproduction instructions (by running brew install commands)

brew install tox
brew upgrade
tox

bug outdated stale

All 24 comments

same issue with pylint (and likely many other packages):

09:18 $ pylint --version 
/home/linuxbrew/.linuxbrew/Cellar/pylint/2.4.4_2/libexec/bin/python3.8: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory

I confirm that we have this issue.

brew linkage pylint
System libraries:
  /lib/x86_64-linux-gnu/libc.so.6
  /lib/x86_64-linux-gnu/libpthread.so.0
Missing libraries:
  libpython3.8.so.1.0

/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/libpython3.8.so.1.0` exists ...

Rebuilding pylint from source fixes this:

brew linkage pylint
System libraries:
  /lib/x86_64-linux-gnu/libc.so.6
  /lib/x86_64-linux-gnu/libpthread.so.0
Homebrew libraries:
  /home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.2_1/lib/libpython3.8.so.1.0 ([email protected])

pkg-config looks good:

cat /home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.2_1/lib/pkgconfig/python-3.8.pc
# See: man pkg-config
prefix=/home/linuxbrew/.linuxbrew/opt/[email protected]
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Python
Description: Build a C extension for Python
Requires:
Version: 3.8
Libs.private: -lcrypt -lpthread -ldl  -lutil -lm
Libs:
Cflags: -I${includedir}/python3.8

The main issue is that these libraries are linked against the plain Cellar path, which might change on a revision bump. The linkage should be done against the opt path.

I can confirm that building from source fixes the issue.

(Apologies if this is the wrong place, first-time brew user trying to do the right thing)

Hey folks - I'm seeing the same issue (I think) with the awscli@2 formula. Freshly installed this morning (awscli 2.0.8)

$ ldd /home/linuxbrew/.linuxbrew/Cellar/awscli/2.0.8/libexec/bin/python3.8
        linux-vdso.so.1 (0x00007fffd6319000)
        libpython3.8.so.1.0 => not found
        libpthread.so.0 => /home/linuxbrew/.linuxbrew/lib/libpthread.so.0 (0x00007f6d969e0000)
        libc.so.6 => /home/linuxbrew/.linuxbrew/lib/libc.so.6 (0x00007f6d96641000)
        /home/linuxbrew/.linuxbrew/lib/ld.so (0x00007f6d96c00000)

This means when I run the aws command...

â•°$ aws
/home/linuxbrew/.linuxbrew/Cellar/awscli/2.0.8/libexec/bin/python3.8: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory

When I set the the LD_LIBRARY_PATH variable manually, works fine.

â•°$ LD_LIBRARY_PATH=/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.2_1/lib/ aws
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: the following arguments are required: command

Not sure if this is the same problem. If it's not, let me know and I can re-raise somewhere more appropriate.

I think it is the same.

Try reinstalling from source using brew install -s <pkgname>.

Yes. All these errors are the same. The root cause is in the Python 3.8 formula; and we did not notice before because it's the first time we updated the revision for 3.8.

I found the error, and have made a fix: #20182
Once this is merged, we will need to rebuild all the packages linking against [email protected], so that they link against the right path.

I pushed a new python 3.8 bottle with a fix. We will rebuild all the broken bottles in #20188, you can follow the list there to see how it goes.

@iMichka I get the same error when running a brew install [email protected] --keep-tmp. The relevant error is:

LD_LIBRARY_PATH=/tmp/[email protected]/Python-3.8.2 CC='gcc-5 -pthread' LDSHARED='gcc-5 -pthread -shared -L/home/aznb/.linuxbrew/lib   ' OPT='-DNDEBUG -g  -O3 -Wall'   _TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py  build
running build
running build_ext
ldd: /home/aznb/.linuxbrew/opt/readline/lib/libhistory.dylib: No such file or directory
sqlite: found /home/aznb/.linuxbrew/opt/sqlite/include/sqlite3.h
/home/aznb/.linuxbrew/opt/sqlite/include/sqlite3.h: version 3.31.1
building '_struct' extension
building 'array' extension
building '_contextvars' extension
building 'math' extension
building '_datetime' extension
........
/bin/sh: line 9: 35690 Illegal instruction     (core dumped) LD_LIBRARY_PATH=/tmp/[email protected]/Python-3.8.2 CC='gcc-5 -pthread' LDSHARED='gcc-5 -pthread -shared -L/home/aznb/.linuxbrew/lib   ' OPT='-DNDEBUG -g  -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py $quiet build

ldd the compiled "python" binary in the tmp dir:

        linux-vdso.so.1 (0x00007ffc4a364000)
        libpython3.8.so.1.0 => not found
        libcrypt.so.1 => /home/aznb/.linuxbrew/lib/libcrypt.so.1 (0x00002b9f4559e000)
        libpthread.so.0 => /home/aznb/.linuxbrew/lib/libpthread.so.0 (0x00002b9f455d6000)
        libdl.so.2 => /home/aznb/.linuxbrew/lib/libdl.so.2 (0x00002b9f455f6000)
        libutil.so.1 => /home/aznb/.linuxbrew/lib/libutil.so.1 (0x00002b9f455fb000)
        libm.so.6 => /home/aznb/.linuxbrew/lib/libm.so.6 (0x00002b9f45600000)
        libc.so.6 => /home/aznb/.linuxbrew/lib/libc.so.6 (0x00002b9f456ff000)
        /home/aznb/.linuxbrew/lib/ld.so (0x00002b9f45573000)

Hi. Can you confirm that you are working with version 3.8.2_4 (revision 4). All the others are known to be broken.

To me it looks like your python 3.8 compilation failed with /bin/sh: line 9: 35690 Illegal instruction (core dumped), so I would not expect something working out of that anyway.

Regarding the dylib line, it has been there in python 3.7 since forever, and 3.8 since it is out, and has never caused any harm. But yes we could disable that for Linux.

I rebuilt 144 packages with the latest version of Python 3.8 and encountered no issue on our CI.

Could you post a full log?

Yes, it's revision 4. My brew --version is Homebrew 2.2.13-122-g20f7f26 Homebrew/linuxbrew-core (git revision aee486; last commit 2020-04-21).

I just found that the python formula version 3.7.7 revision 1 also has the Illegal instruction (core dumped) error on the same build command ./python -E ./setup.py build in the tmp dir. But my last build of python 3.7.6_1 worked. Here are the log files:
[email protected]

@iMichka Is this issue solved completely? I see that in the past days the same error message was solved for awscli, but it's still there for awslogs e.g. https://travis-ci.com/github/rokmoln/support-firecloud/jobs/343770221

I see in https://github.com/Homebrew/linuxbrew-core/issues/20188 that some formulas have been addressed manually (like awscli), but then the automation that should have fixed the other formulae failed https://github.com/Homebrew/linuxbrew-core/pull/20192#issuecomment-617334444

Apologies if the above investigation is non-sense.

I can confirm that there is still an issue. It might be slightly different. I'll investigate:

ldd /home/linuxbrew/.linuxbrew/Cellar/awslogs/0.11.0_4/libexec/bin/python
    linux-vdso.so.1 =>  (0x00007ffef6eaf000)
    libpython3.8.so.1.0 => not found
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9465997000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f94655cd000)
    /home/linuxbrew/.linuxbrew/lib/ld.so => /lib64/ld-linux-x86-64.so.2 (0x00007f9465bb4000)
patchelf --print-rpath $(brew --prefix awslogs)/libexec/bin/python
/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.2_4/lib:/home/linuxbrew/.linuxbrew/lib:/home/linuxbrew/.linuxbrew/opt/xz/lib:/home/linuxbrew/.linuxbrew/opt/gdbm/lib:/home/linuxbrew/.linuxbrew/opt/[email protected]/lib:/home/linuxbrew/.linuxbrew/opt/ncurses/lib:/home/linuxbrew/.linuxbrew/opt/readline/lib:/home/linuxbrew/.linuxbrew/opt/zlib/lib:/home/linuxbrew/.linuxbrew/opt/sqlite/lib:/home/linuxbrew/.linuxbrew/opt/bzip2/lib:/home/linuxbrew/.linuxbrew/opt/libffi/lib

This should keep the paths fixed but is not working on linux:
https://github.com/Homebrew/brew/blob/master/Library/Homebrew/language/python.rb#L230-L241

root@a308d8e4e846:/home/linuxbrew/.linuxbrew/opt/awslogs/libexec/bin# file python3.8
python3.8: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /home/linuxbrew/.linuxbrew/lib/ld.so, for GNU/Linux 2.6.32, BuildID[sha1]=fc5e55e2dbceb43200fa062731a5f70cf9c1112e, not stripped

memo:

update 2020/06/10
[email protected] and docutils ver 0.16_2 same issue

brew linkage docutils
System libraries:
  /lib/x86_64-linux-gnu/libc.so.6
  /lib/x86_64-linux-gnu/libpthread.so.0
Missing libraries:
  libpython3.8.so.1.0

temporary workaround: docutils 0.16_1 pinned and use it. (before migrate 3.8)

I am waiting for this issue to be resolved.

A short term solution is to bump the revision of that formula; and build a new bottle. Can you open a pull request for that?

I still need to investigate what is broken in Python right now, but had no time to investigate.

Looks like the changes in https://github.com/Homebrew/brew/commit/2594e7093e is the culprit. I am investigating this with @Bo98 .

Actually this part of the code is working fine.

The difference in linkage for the python3.8 files in the docutils formula:

 otool -L /usr/local/Cellar/docutils/0.16_1/libexec/bin/python3.8
/usr/local/Cellar/docutils/0.16_1/libexec/bin/python3.8:
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1673.126.0)
    @executable_path/../.Python (compatibility version 3.8.0, current version 3.8.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
ldd /home/linuxbrew/.linuxbrew/opt/docutils/libexec/bin/python3.8
    linux-vdso.so.1 =>  (0x00007ffd0995e000)
    libpython3.8.so.1.0 => not found
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa191dd4000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa191a0a000)
    /home/linuxbrew/.linuxbrew/lib/ld.so => /lib64/ld-linux-x86-64.so.2 (0x00007fa191ff1000)

In the python formula:

otool -L /usr/local/Cellar/[email protected]/3.8.3_1/bin/python3.8
/usr/local/Cellar/[email protected]/3.8.3_1/bin/python3.8:
    /usr/local/Cellar/[email protected]/3.8.3_1/Frameworks/Python.framework/Versions/3.8/Python (compatibility version 3.8.0, current version 3.8.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
ldd /home/linuxbrew/.linuxbrew/opt/[email protected]/bin/python3.8
    linux-vdso.so.1 =>  (0x00007ffe9f9d1000)
    libpython3.8.so.1.0 => /home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.3/lib/libpython3.8.so.1.0 (0x00007f03df5ee000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f03df3d1000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f03df007000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f03dee03000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f03dec00000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f03de8f7000)
    /home/linuxbrew/.linuxbrew/lib/ld.so => /lib64/ld-linux-x86-64.so.2 (0x00007f03dfb34000)

What does ldd look like for a Python 3.7 dependent formula and a working Python 3.8 dependent formula (assuming there is one)?

when the version 3.8.2_4 will merge to master branch? my [email protected] is 3.8.3 version.

3.8.3 > 3.8.2_4

3.8.3 > 3.8.2_4

oh, installing from source fix my issue. thanks.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julian45 picture julian45  Â·  7Comments

davideo picture davideo  Â·  4Comments

baranyildirim picture baranyildirim  Â·  6Comments

oliver-la picture oliver-la  Â·  7Comments

thedrow picture thedrow  Â·  6Comments