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

build: requires libgit2 1.2.x #1089

Closed
wants to merge 1 commit into from
Closed

build: requires libgit2 1.2.x #1089

wants to merge 1 commit into from

Conversation

chenrui333
Copy link

relates to Homebrew/homebrew-core#84518

  src/types.h:36:2: error: You need a compatible libgit2 version (1.1.x)
  #error You need a compatible libgit2 version (1.1.x)
   ^

src/types.h Outdated Show resolved Hide resolved
update libgit2 to v1.2.0

Signed-off-by: Rui Chen <rui@chenrui.dev>

either libgit 1.1.x or 1.2.x

Revert "update libgit2 to v1.2.0"

This reverts commit 078743e.
@chenrui333
Copy link
Author

@adamgolebiowski any chance of merging this?

@jdavid
Copy link
Member

jdavid commented Sep 10, 2021

For this to be merged CI must be updated to use 1.2 instead of 1.1

@Mindavi Mindavi mentioned this pull request Sep 11, 2021
@Mindavi
Copy link

Mindavi commented Sep 11, 2021

These lines at least:

- LIBSSH2_VERSION=1.9.0 LIBGIT2_VERSION=1.1.0 /bin/sh build.sh test

LIBSSH2_VERSION=1.9.0 LIBGIT2_VERSION=1.1.0 sh build.sh

git clone --depth=1 -b maint/v1.1 https://github.com/libgit2/libgit2.git libgit2

LIBGIT2_VERSION: 1.1.0

LIBSSH2_VERSION=1.9.0 LIBGIT2_VERSION=1.1.0 /bin/sh build.sh test

@alerque
Copy link

alerque commented Sep 14, 2021

Having tried to apply this PR as a patch, it looks like it builds but a large portion of the test suite starts failing with errors like this:

ffi.error: struct git_remote_callbacks: wrong offset for field 'payload' (cdef says 96, but C compiler says 104). fix it or use "...;" as the last field in the cdef for struct git_remote_callbacks to make it flexible

@carlocab
Copy link

Yea, libgit2 added a new field to the git_remote_callbacks struct in libgit2/libgit2@72df17c, so the offset for the payload field should indeed be 104.

@alerque
Copy link

alerque commented Sep 15, 2021

@carlocab Any chance you can make that adjustment in this PR?

@carlocab
Copy link

I'm not familiar enough with the code here to know what the right adjustment is. Do you have a backtrace for the error you saw?

@alerque
Copy link

alerque commented Sep 15, 2021

Here is the first of 12 failed / 14 errors I get when applying this PR as a patch to 1.6.1 sources, then building against libgit2-1.2.0, then running python setup.py pytest:

==================================== ERRORS ====================================
__________________ ERROR at setup of test_branches_remote_get __________________

emptyrepo = pygit2.Repository('/tmp/pytest-of-builduser/pytest-0/test_branches_remote_get0/emptyrepo/.git/')

    @pytest.fixture
    def repo(emptyrepo):
        remote = emptyrepo.remotes[0]
>       remote.fetch()

test/test_branch_empty.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pygit2/remote.py:141: in fetch
    with git_fetch_options(callbacks) as payload:
/usr/lib/python3.9/contextlib.py:119: in __enter__
    return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

payload = <pygit2.callbacks.RemoteCallbacks object at 0x7fdcd1673ac0>
opts = None

    @contextmanager
    def git_fetch_options(payload, opts=None):
        if payload is None:
            payload = RemoteCallbacks()

        if opts is None:
>           opts = ffi.new('git_fetch_options *')
E           ffi.error: struct git_remote_callbacks: wrong offset for field 'payload' (cdef says 96, but C compiler says 104). fix it or use "...;" as the last field in the cdef for struct git_remote_callbacks to make it flexible

pygit2/callbacks.py:247: error
____________________ ERROR at setup of test_branches_remote ____________________

emptyrepo = pygit2.Repository('/tmp/pytest-of-builduser/pytest-0/test_branches_remote0/emptyrepo/.git/')

    @pytest.fixture
    def repo(emptyrepo):
        remote = emptyrepo.remotes[0]
>       remote.fetch()

@jdavid jdavid closed this in dcde9ef Sep 16, 2021
@carlocab
Copy link

Thanks for the fix, @jdavid.

Here's dcde9ef amended so that it applies to the PyPI tarball, in case anyone needs it:

https://raw.githubusercontent.com/Homebrew/formula-patches/bf370d7782f7686a4a61d8d7d28068e78e28e48c/pygit2/libgit2-1.2.0.patch

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Sep 6, 2022
1.10.1 (2022-08-28)
-------------------------

- Fix segfault in ``Signature`` repr
  `#1155 <https://github.com/libgit2/pygit2/pull/1155>`_

- Linux and macOS wheels for Python 3.11
  `#1154 <https://github.com/libgit2/pygit2/pull/1154>`_


1.10.0 (2022-07-24)
-------------------------

- Upgrade to libgit2 1.5

- Add support for ``GIT_OPT_GET_OWNER_VALIDATION`` and
  ``GIT_OPT_SET_OWNER_VALIDATION``
  `#1150 <https://github.com/libgit2/pygit2/pull/1150>`_

- New ``untracked_files`` and ``ignored`` optional arguments for
  ``Repository.status(...)``
  `#1151 <https://github.com/libgit2/pygit2/pull/1151>`_


1.9.2 (2022-05-24)
-------------------------

- New ``Repository.create_commit_string(...)`` and
  ``Repository.create_commit_with_signature(...)``
  `#1142 <https://github.com/libgit2/pygit2/pull/1142>`_

- Linux and macOS wheels updated to libgit2 v1.4.3

- Remove redundant line
  `#1139 <https://github.com/libgit2/pygit2/pull/1139>`_


1.9.1 (2022-03-22)
-------------------------

- Type hints: added to C code and Branches/References
  `#1121 <https://github.com/libgit2/pygit2/pull/1121>`_
  `#1132 <https://github.com/libgit2/pygit2/pull/1132>`_

- New ``Signature`` supports ``str()`` and ``repr()``
  `#1135 <https://github.com/libgit2/pygit2/pull/1135>`_

- Fix ODB backend's read in big endian architectures
  `#1130 <https://github.com/libgit2/pygit2/pull/1130>`_

- Fix install with poetry
  `#1129 <https://github.com/libgit2/pygit2/pull/1129>`_
  `#1128 <https://github.com/libgit2/pygit2/issues/1128>`_

- Wheels: update to libgit2 v1.4.2

- Tests: fix testing ``parse_diff``
  `#1131 <https://github.com/libgit2/pygit2/pull/1131>`_

- CI: various fixes after migration to libgit2 v1.4


1.9.0 (2022-02-22)
-------------------------

- Upgrade to libgit2 v1.4

- Documentation, new recipes for committing and cloning
  `#1125 <https://github.com/libgit2/pygit2/pull/1125>`_


1.8.0 (2022-02-04)
-------------------------

- Rename ``RemoteCallbacks.progress(...)`` callback to ``.sideband_progress(...)``
  `#1120 <https://github.com/libgit2/pygit2/pull/1120>`_

- New ``Repository.merge_base_many(...)`` and ``Repository.merge_base_octopus(...)``
  `#1112 <https://github.com/libgit2/pygit2/pull/1112>`_

- New ``Repository.listall_stashes()``
  `#1117 <https://github.com/libgit2/pygit2/pull/1117>`_

- Code cleanup
  `#1118 <https://github.com/libgit2/pygit2/pull/1118>`_

Backward incompatible changes:

- The ``RemoteCallbacks.progress(...)`` callback has been renamed to
  ``RemoteCallbacks.sideband_progress(...)``. This matches the documentation,
  but may break existing code that still uses the old name.


1.7.2 (2021-12-06)
-------------------------

- Universal wheels for macOS
  `#1109 <https://github.com/libgit2/pygit2/pull/1109>`_


1.7.1 (2021-11-19)
-------------------------

- New ``Repository.amend_commit(...)``
  `#1098 <https://github.com/libgit2/pygit2/pull/1098>`_

- New ``Commit.message_trailers``
  `#1101 <https://github.com/libgit2/pygit2/pull/1101>`_

- Windows wheels for Python 3.10
  `#1103 <https://github.com/libgit2/pygit2/pull/1103>`_

- Changed: now ``DiffDelta.is_binary`` returns ``None`` if the file data has
  not yet been loaded, cf. `#962 <https://github.com/libgit2/pygit2/issues/962>`_

- Document ``Repository.get_attr(...)`` and update theme
  `#1017 <https://github.com/libgit2/pygit2/issues/1017>`_
  `#1105 <https://github.com/libgit2/pygit2/pull/1105>`_


1.7.0 (2021-10-08)
-------------------------

- Upgrade to libgit2 1.3.0
  `#1089 <https://github.com/libgit2/pygit2/pull/1089>`_

- Linux wheels now bundled with libssh2 1.10.0 (instead of 1.9.0)

- macOS wheels now include libssh2

- Add support for Python 3.10
  `#1092 <https://github.com/libgit2/pygit2/pull/1092>`_
  `#1093 <https://github.com/libgit2/pygit2/pull/1093>`_

- Drop support for Python 3.6

- New `pygit2.GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES`
  `#1087 <https://github.com/libgit2/pygit2/pull/1087>`_

- New optional argument ``location`` in ``Repository.applies(..)`` and
  ``Repository.apply(..)``
  `#1091 <https://github.com/libgit2/pygit2/pull/1091>`_

- Fix: Now the `flags` argument in `Repository.blame()` is passed through
  `#1083 <https://github.com/libgit2/pygit2/pull/1083>`_

- CI: Stop using Travis, move to GitHub actions

Caveats:

- Windows wheels for Python 3.10 not yet available.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Sep 6, 2022
1.10.1 (2022-08-28)
-------------------------

- Fix segfault in ``Signature`` repr
  `#1155 <https://github.com/libgit2/pygit2/pull/1155>`_

- Linux and macOS wheels for Python 3.11
  `#1154 <https://github.com/libgit2/pygit2/pull/1154>`_


1.10.0 (2022-07-24)
-------------------------

- Upgrade to libgit2 1.5

- Add support for ``GIT_OPT_GET_OWNER_VALIDATION`` and
  ``GIT_OPT_SET_OWNER_VALIDATION``
  `#1150 <https://github.com/libgit2/pygit2/pull/1150>`_

- New ``untracked_files`` and ``ignored`` optional arguments for
  ``Repository.status(...)``
  `#1151 <https://github.com/libgit2/pygit2/pull/1151>`_


1.9.2 (2022-05-24)
-------------------------

- New ``Repository.create_commit_string(...)`` and
  ``Repository.create_commit_with_signature(...)``
  `#1142 <https://github.com/libgit2/pygit2/pull/1142>`_

- Linux and macOS wheels updated to libgit2 v1.4.3

- Remove redundant line
  `#1139 <https://github.com/libgit2/pygit2/pull/1139>`_


1.9.1 (2022-03-22)
-------------------------

- Type hints: added to C code and Branches/References
  `#1121 <https://github.com/libgit2/pygit2/pull/1121>`_
  `#1132 <https://github.com/libgit2/pygit2/pull/1132>`_

- New ``Signature`` supports ``str()`` and ``repr()``
  `#1135 <https://github.com/libgit2/pygit2/pull/1135>`_

- Fix ODB backend's read in big endian architectures
  `#1130 <https://github.com/libgit2/pygit2/pull/1130>`_

- Fix install with poetry
  `#1129 <https://github.com/libgit2/pygit2/pull/1129>`_
  `#1128 <https://github.com/libgit2/pygit2/issues/1128>`_

- Wheels: update to libgit2 v1.4.2

- Tests: fix testing ``parse_diff``
  `#1131 <https://github.com/libgit2/pygit2/pull/1131>`_

- CI: various fixes after migration to libgit2 v1.4


1.9.0 (2022-02-22)
-------------------------

- Upgrade to libgit2 v1.4

- Documentation, new recipes for committing and cloning
  `#1125 <https://github.com/libgit2/pygit2/pull/1125>`_


1.8.0 (2022-02-04)
-------------------------

- Rename ``RemoteCallbacks.progress(...)`` callback to ``.sideband_progress(...)``
  `#1120 <https://github.com/libgit2/pygit2/pull/1120>`_

- New ``Repository.merge_base_many(...)`` and ``Repository.merge_base_octopus(...)``
  `#1112 <https://github.com/libgit2/pygit2/pull/1112>`_

- New ``Repository.listall_stashes()``
  `#1117 <https://github.com/libgit2/pygit2/pull/1117>`_

- Code cleanup
  `#1118 <https://github.com/libgit2/pygit2/pull/1118>`_

Backward incompatible changes:

- The ``RemoteCallbacks.progress(...)`` callback has been renamed to
  ``RemoteCallbacks.sideband_progress(...)``. This matches the documentation,
  but may break existing code that still uses the old name.


1.7.2 (2021-12-06)
-------------------------

- Universal wheels for macOS
  `#1109 <https://github.com/libgit2/pygit2/pull/1109>`_


1.7.1 (2021-11-19)
-------------------------

- New ``Repository.amend_commit(...)``
  `#1098 <https://github.com/libgit2/pygit2/pull/1098>`_

- New ``Commit.message_trailers``
  `#1101 <https://github.com/libgit2/pygit2/pull/1101>`_

- Windows wheels for Python 3.10
  `#1103 <https://github.com/libgit2/pygit2/pull/1103>`_

- Changed: now ``DiffDelta.is_binary`` returns ``None`` if the file data has
  not yet been loaded, cf. `#962 <https://github.com/libgit2/pygit2/issues/962>`_

- Document ``Repository.get_attr(...)`` and update theme
  `#1017 <https://github.com/libgit2/pygit2/issues/1017>`_
  `#1105 <https://github.com/libgit2/pygit2/pull/1105>`_


1.7.0 (2021-10-08)
-------------------------

- Upgrade to libgit2 1.3.0
  `#1089 <https://github.com/libgit2/pygit2/pull/1089>`_

- Linux wheels now bundled with libssh2 1.10.0 (instead of 1.9.0)

- macOS wheels now include libssh2

- Add support for Python 3.10
  `#1092 <https://github.com/libgit2/pygit2/pull/1092>`_
  `#1093 <https://github.com/libgit2/pygit2/pull/1093>`_

- Drop support for Python 3.6

- New `pygit2.GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES`
  `#1087 <https://github.com/libgit2/pygit2/pull/1087>`_

- New optional argument ``location`` in ``Repository.applies(..)`` and
  ``Repository.apply(..)``
  `#1091 <https://github.com/libgit2/pygit2/pull/1091>`_

- Fix: Now the `flags` argument in `Repository.blame()` is passed through
  `#1083 <https://github.com/libgit2/pygit2/pull/1083>`_

- CI: Stop using Travis, move to GitHub actions

Caveats:

- Windows wheels for Python 3.10 not yet available.
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

Successfully merging this pull request may close these issues.

None yet

6 participants