fedora-infra / fresque

Fedora Review Server
GNU Affero General Public License v3.0
13 stars 9 forks source link

libgit2 version mismatch on Fedora 23 #16

Open ncoghlan opened 8 years ago

ncoghlan commented 8 years ago

Attempting to run pip install -r requirements.txt in a fresh virtualenv currently fails when attempting to build the cffi extension for pygit2.

The error messages when using the pinned pygit2==0.22.0 from the requirements file are quite cryptic, but running pip install pygit2 directly gave the more informative:

#error You need a compatible libgit2 version (v0.24.x)

Changing the pygit2 pinned dependency to 0.23.0 to match the system libgit2 installation did indeed fix the problem.

puiterwijk commented 8 years ago

The problem here is that the libgit2 and pygit2 versions must always match exactly: libgit2-0.23.0 will not work with pygit2-0.24.0, but also libgit2-0.24.0 will not work with pygit2-0.24.0. They must match identically.

Because of this, if you install libgit from the repos, you should also install python-pygit2 from the same repos and just use system-site-packages in the virtualenv, as you did edit the dependency file to the correct pygit version manually, since otherwise we would need to ship a requirements-f23.txt and requirements-f24.txt etc, and keep those in close sync with the Fedora repo status.

pypingou commented 8 years ago

Except for the typo in libgit2-0.24.0 will not work with pygit2-0.24.0. @puiterwijk is right, the X.Y version of libgit2 and pygit2 must match.

You have libgit2 0.24.0 on F23? It is in updates-testing? Because this is simply not possible, it will break every user of libgit2/pygit2 since they constantly break their APIs.

ncoghlan commented 8 years ago

pygit2 0.24.0 is the latest version on PyPI, and they appear to have fixed it to give a nicer error on version mismatch than 0.22.0. The approach that actually got me a running Fresque install on F23 was pinning to 0.23.0 instead of 0.22.0.

The actual bug report here is more that the README is incomplete - if you've never heard of pygit2, didn't realise that Fresque created local git repositories, or both, then this is a very surprising issue to run into. (I've only ever used Dulwich to interact with git from Python, which was a lot easier to deploy since it doesn't rely on a system library with an unstable ABI)

pypingou commented 8 years ago

Yes F23 has libgit2 and pygit2 at 0.23.x so your mention of 0.24 scared me a little but if you installed it manually I'm reassured :)

The README is indeed incomplete, but the project has also basically not been touched for almost a year now. I only merged recently one of the two PRs because I was tired of seeing it in our review queue. I might end up resolving the conflict of the remaining one for the same reason.

ncoghlan commented 8 years ago

No worries. As a bit of additional background, I was getting Fresque running locally in the context of an idea I have for https://fedoraproject.org/wiki/Env_and_Stacks/Projects/PackageReviewProcessRedesign#Aleph_4:_Redistributed_components

However, it turns out that while what I'm looking at doing for that is similar to Fresque in some ways, it's not the same as what Fresque aims to cover, so my original hope that I'd be able to contribute what I'm working on back to Fresque itself probably won't be feasible :(

ncoghlan commented 8 years ago

The simplified fork I created for project reviews that drops the concept of local git repos on the server: https://github.com/ncoghlan/downstreaming

I closed #9 on that basis, and it also eliminates my own personal need for an improved developer experience around pygit2 installation.