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

Not able to build pygit2 with python 3.9 using wheels #1038

Closed
pranav165 opened this issue Oct 7, 2020 · 7 comments
Closed

Not able to build pygit2 with python 3.9 using wheels #1038

pranav165 opened this issue Oct 7, 2020 · 7 comments
Labels

Comments

@pranav165
Copy link

Building wheel for pygit2 (PEP 517): started
[14:10:12] Building wheel for pygit2 (PEP 517): finished with status 'error'
[14:10:12] ERROR: Command errored out with exit status 1:
[14:10:12] command: /home/e2e/venv/bin/python3 /home/e2e/venv/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp6z6mbv9f
[14:10:12] cwd: /tmp/pip-install-8yb1uf3g/pygit2
[14:10:12] Complete output (63 lines):
[14:10:12] running bdist_wheel
[14:10:12] running build
[14:10:12] running build_py
[14:10:12] creating build
[14:10:12] creating build/lib.linux-x86_64-3.9
[14:10:12] creating build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/init.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/_build.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/_run.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/blame.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/callbacks.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/config.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/credentials.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/errors.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/ffi.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/index.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/refspec.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/remote.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/repository.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/settings.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/submodule.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] copying pygit2/utils.py -> build/lib.linux-x86_64-3.9/pygit2
[14:10:12] creating build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/attr.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/blame.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/buffer.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/callbacks.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/checkout.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/clone.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/common.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/config.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/describe.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/diff.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/errors.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/graph.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/index.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/indexer.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/merge.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/net.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/oid.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/pack.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/proxy.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/refspec.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/remote.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/repository.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/revert.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/stash.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/strarray.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/submodule.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/transport.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] copying pygit2/decl/types.h -> build/lib.linux-x86_64-3.9/pygit2/decl
[14:10:12] running build_ext
[14:10:12] generating cffi module 'build/temp.linux-x86_64-3.9/pygit2._libgit2.c'
[14:10:12] creating build/temp.linux-x86_64-3.9
[14:10:12] building 'pygit2._pygit2' extension
[14:10:12] creating build/temp.linux-x86_64-3.9/src
[14:10:12] gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include -I/home/e2e/venv/include -I/usr/local/include/python3.9 -c src/blob.c -o build/temp.linux-x86_64-3.9/src/blob.o
[14:10:12] In file included from src/blob.c:30:
[14:10:12] src/blob.h:33:10: fatal error: git2.h: No such file or directory
[14:10:12] #include <git2.h>
[14:10:12] ^~~~~~~~
[14:10:12] compilation terminated.
[14:10:12] error: command '/usr/bin/gcc' failed with exit code 1
[14:10:12] ----------------------------------------
[14:10:12] ERROR: Failed building wheel for pygit2

@kevinvalk
Copy link

Can second this issue, had this when running on GitLab CI with image: python:3 in .gitlab-ci.yml.

@buhl
Copy link
Contributor

buhl commented Oct 30, 2020

I have no problem building this package under 3.9. You need to have libgit2 installed though.

$ docker run --rm -it python:3.9 bash
root@e30a8a9c90ad:/ # mkdir /src && cd /src
root@e30a8a9c90ad:/src # apt install build-essential cmake
root@e30a8a9c90ad:/src # git clone https://github.com/libgit2/libgit2.git
root@e30a8a9c90ad:/src # git clone https://github.com/libgit2/pygit2.git
root@e30a8a9c90ad:/src # cd libgit
root@e30a8a9c90ad:/src/libgit2 # cmake .
root@e30a8a9c90ad:/src/libgit2 # make
root@e30a8a9c90ad:/src/libgit2 # make install
root@e30a8a9c90ad:/src/libgit2 # cd ../pygit
root@e30a8a9c90ad:/src/pygit2 # make
root@e30a8a9c90ad:/src/pygit2 # pip install .
root@e30a8a9c90ad:/src/pygit2 # pip pytest
root@e30a8a9c90ad:/src/pygit2 # ldconfig
root@e30a8a9c90ad:/src/pygit2 # pytest
...
=================================== 423 passed, 2 skipped in 15.17s ===================================
root@e30a8a9c90ad:/src/pygit2 #

@buhl
Copy link
Contributor

buhl commented Oct 31, 2020

Sorry, I think I might slightly have misunderstood the problem. But the missing git2.h file is because you don't have libgit2 installed.
I think the info here might help
https://www.pygit2.org/install.html#advanced

@pro-sumer
Copy link

Had a similar issue on macOS Catalina (10.15.7).

In my case I solved it by running brew install libgit2 before executing pip3 install pygit2 (thanks @buhl).

(I use Homebrew on this Mac)

@alecandido
Copy link

It is failing also on GitHub Actions: the same workflow run for 3.8, but it is failing on 3.9 because of the missing headers.

I would guess that setup-python action (the only difference in the workflow) should be independent on libgit2, so I believe that the two wheels are somewhat different. Will this problem be fixed?

@jdavid
Copy link
Member

jdavid commented Nov 6, 2020

Thanks @buhl that's correct, and the error message is very clear:

 [14:10:12] src/blob.h:33:10: fatal error: git2.h: No such file or directory

@jdavid jdavid added the support label Nov 6, 2020
@jdavid
Copy link
Member

jdavid commented Nov 6, 2020

new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants