Nuitka icon indicating copy to clipboard operation
Nuitka copied to clipboard

MacOS shared object dependency scan failure with system library - updated

Open vincent-lhomme opened this issue 11 months ago • 2 comments

Hello,

Using python 3.11.6, nuitka 2.1.2, macOS 14.2.1 When building the application with nuitka, the dependency scan fails with this message: FATAL: Error, problem with dependency scan of '/Users//[…]/.cpython-311-darwin.so' with '/opt/homebrew/opt/zstd/lib/libzstd.1.dylib' please report the bug. Command: poetry run python -m nuitka --standalone --macos-create-app-bundle main.py This happens when using a python package containing compiled code linking to a system library. Here is the dependency: app.py → plugin.cpython-311-darwin.so → libzstd.1.so Note that the library is available in the system at this location: /usr/local/lib/libzstd.1.dylib Also note that other libraries are linked the same way, which don’t trigger the same issue, like liblzma.

I attached a tarball with material to reproduce: testcase_issue_nuitka.tar.gz

Thanks for your support!

vincent-lhomme avatar Mar 20 '24 08:03 vincent-lhomme

It's a shame you didn't provide the --version output although it clearly asks you to. You also have a hello world situation I would assume, can you compile anything with your Python at all?

kayhayen avatar Mar 20 '24 10:03 kayhayen

Hi Kay,

Here is the output for the version. I'm sorry about the ticket format. I have to comply to my company policy about posting externally. I had to write this exact thing.

python3 -m nuitka --version
2.1.2
Commercial: None
Python: 3.11.6 (main, Oct  2 2023, 20:46:14) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Flavor: Homebrew Python
Executable: /Users/vincent/Library/Caches/pypoetry/virtualenvs/integration-test-kGv_V3l9-py3.11/bin/python3
OS: Darwin
Arch: arm64
Version C compiler: /usr/bin/clang (clang 15.0.0).

can you compile anything with your Python at all?

Actually with the current version the compilation fails on both sides, packaging and integration. There is a workaround though:

Adding /opt/homebrew/opt/zstd/lib to the PYTHONPATH variable 'fixes' the issue. It looks like it makes python think that the module is 'EXTENSION' and not 'MAIN_MODULE'. Well it's not clear to me.

Anyway, thanks a lot for your time.

vincent-lhomme avatar Mar 20 '24 12:03 vincent-lhomme

Thanks for your report, this is fixed on the factory branch, which is a development version under rapid development. You can try it out by going here: https://nuitka.net/doc/factory.html

Feedback on whether this is working is very welcome. Please do not share plans to do it; only confirm or deny that it is working.

kayhayen avatar Jul 08 '24 08:07 kayhayen

Hi Kay, this works for me !

lhommev avatar Jul 12 '24 12:07 lhommev

This is part of the stable release 2.4 that I just made.

kayhayen avatar Jul 20 '24 12:07 kayhayen