Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extractcode fails on Fedora 24 #13

Open
akaihola opened this issue Jan 10, 2017 · 6 comments
Open

extractcode fails on Fedora 24 #13

akaihola opened this issue Jan 10, 2017 · 6 comments

Comments

@akaihola
Copy link

On Fedora 24, I get this:

$ extractcode test/requests-2.11.1.tar.gz                        
Extracting archives...
  [------------------------------------]
Traceback (most recent call last):
  File "scancode-toolkit/bin/extractcode", line 9, in <module>
    load_entry_point('scancode-toolkit', 'console_scripts', 'extractcode')()
  File "scancode-toolkit/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "scancode-toolkit/src/scancode/utils.py", line 64, in main
    standalone_mode=standalone_mode, **extra)
  File "scancode-toolkit/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "scancode-toolkit/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "scancode-toolkit/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "scancode-toolkit/src/scancode/extract_cli.py", line 156, in extractcode
    for xev in extraction_events:
  File "scancode-toolkit/lib/python2.7/site-packages/click/_termui_impl.py", line 240, in next
    rv = next(self.iter)
  File "scancode-toolkit/src/scancode/api.py", line 43, in extract_archives
    from extractcode.extract import extract
  File "scancode-toolkit/src/extractcode/extract.py", line 37, in <module>
    from extractcode import archive
  File "scancode-toolkit/src/extractcode/archive.py", line 47, in <module>
    from extractcode import libarchive2
  File "scancode-toolkit/src/extractcode/libarchive2.py", line 91, in <module>
    libarchive = load_lib()
  File "scancode-toolkit/src/extractcode/libarchive2.py", line 79, in load_lib
    lib = ctypes.CDLL(libarchive)
  File "/usr/lib64/python2.7/ctypes/__init__.py", line 357, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libbz2.so.1.0: cannot open shared object file: No such file or directory

It starts working correctly if I run this:

sudo ln -s /usr/lib64/libbz2.so.1 /usr/lib64/libbz2.so.1.0
@pombredanne
Copy link
Member

@akaihola Thanks for the report. I will spin a Fedora 24 VM to reproduce the failure. The thing is that the prebuilt native libraries (here libarchive) are built on purpose on (very) old Linux distros for maximum compatibility. I think I should consider doing either a static build for the few deps of libarchive or vendor the deps built on the same machine. I reckon you were running on a 64 bits arch, right?

@pombredanne
Copy link
Member

It looks like it may be a pervasive issue on RedHat-style distros: https://bugzilla.redhat.com/show_bug.cgi?id=461863 and https://www.google.com/search?q="libbz2.so.1.0"+in+Fedora ....

@pombredanne
Copy link
Member

And more specifically on Fedora: http://forums.fedoraforum.org/showthread.php?t=258694 which seems to stem from the fact that the ScanCode binaries were produced on a debian or ubuntu distro.

@akaihola
Copy link
Author

@pombredanne, yes, I'm running the 64-bit variant of Fedora 24.

nishakm referenced this issue in nishakm/scancode-toolkit Dec 14, 2017
Since Scancode binaries are built on Debian based machines, and the
prebuilt dependencies are named differently on RedHat based machines
py.test will not be able to find the libbz2.so library on those
machines.
See https://github.com/nexB/scancode-toolkit/issues/443

Added a note about how to work around this issue by symbolically
linking the existing libbz2.so on the filesystem to the expected
name.

This should be removed once
nexB#469 is solved

Signed-off-by: Nisha K <nishak@vmware.com>
JonoYang referenced this issue in nexB/scancode-toolkit Feb 8, 2018
Since Scancode binaries are built on Debian based machines, and the
prebuilt dependencies are named differently on RedHat based machines
py.test will not be able to find the libbz2.so library on those
machines.
See https://github.com/nexB/scancode-toolkit/issues/443

Added a note about how to work around this issue by symbolically
linking the existing libbz2.so on the filesystem to the expected
name.

This should be removed once
#469 is solved

Signed-off-by: Nisha K <nishak@vmware.com>
yash-nisar referenced this issue in yash-nisar/scancode-toolkit Feb 8, 2018
Since Scancode binaries are built on Debian based machines, and the
prebuilt dependencies are named differently on RedHat based machines
py.test will not be able to find the libbz2.so library on those
machines.
See https://github.com/nexB/scancode-toolkit/issues/443

Added a note about how to work around this issue by symbolically
linking the existing libbz2.so on the filesystem to the expected
name.

This should be removed once
nexB#469 is solved

Signed-off-by: Nisha K <nishak@vmware.com>
@armijnhemel
Copy link

Would be nicer if instructions on how to replace the prebuilt binaries were added :-)

@pombredanne
Copy link
Member

@armijnhemel agreed. I am working on something there.

@pombredanne pombredanne transferred this issue from nexB/scancode-toolkit Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@akaihola @pombredanne @armijnhemel and others