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

_libgit2.abi3.so not created in a flatpak build for flathub #1218

Closed
philippun1 opened this issue Jun 24, 2023 · 2 comments
Closed

_libgit2.abi3.so not created in a flatpak build for flathub #1218

philippun1 opened this issue Jun 24, 2023 · 2 comments

Comments

@philippun1
Copy link

Hello,

I'm currently trying to build pygit2 as a dependency for a flatpak on flathub: flathub/flathub#4082

Everything seems to work fine, but the _libgit2.abi3.so seems not to be created. The full command for the actual pygit2 install would be pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "pygit2" --no-build-isolation. libgit2 and the other dependencies are build from source, because it is not allowed to download them during build on flathub.

Here is the full build log of the flatpak: flatpak-build-with-pygit2.log

Since the build succeeds I assume the libgit2 dependency gets detected properly, the libgit2.so* files are also created into the output directory under .../lib.

In the log you can see building 'pygit2._pygit2' extension is being built, but the building 'pygit2._libgit2' extension is missing. I built libgit2 and pygit2 locally as described here to compare and the pygit2._libgit2 extension gets built.

Is there something I am missing? Maybe a parameter for the pip3 build?

@philippun1
Copy link
Author

If I try to start the flatpak with `` this error is shown:

Traceback (most recent call last):
  File "/app/bin/turtle_cli", line 20, in <module>
    import turtlevcs
  File "/app/lib/python3.10/site-packages/turtlevcs/__init__.py", line 21, in <module>
    import pygit2
  File "/app/lib/python3.10/site-packages/pygit2/__init__.py", line 33, in <module>
    from .blame import Blame, BlameHunk
  File "/app/lib/python3.10/site-packages/pygit2/blame.py", line 27, in <module>
    from .ffi import ffi, C
  File "/app/lib/python3.10/site-packages/pygit2/ffi.py", line 27, in <module>
    from ._libgit2 import ffi, lib as C
ModuleNotFoundError: No module named 'pygit2._libgit2'

If I copy the _libgit2.abi3.so into the flatpak runtime folder it will run properly. So the file is the only missing part.

Currently I'm trying to find the difference between the created files from the regular build and the flatpak build. The Extension created in setup.py with

ext_modules = [
    Extension('pygit2._pygit2', pygit2_exts, **libgit2_kw)
]

seem to get the same parameters in both builds. I checked it with a simple print of the variables.

Where the pygit2._libgit2 extension is built I couldn't find yet. The diff of the two pygit2 modules is mostly identical, especially the relevant places with ._libgit2 or pygit2._libgit2, i.e. ffi.py.

@philippun1
Copy link
Author

I finally figured out that I can just use the prebuilt wheel, which already includes libgit2 with the abi file. So this issue is obsolete.

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

1 participant