Skip to content

Commit 549706b

Browse files
authored
Declare forward-compatibility with libgit2 v1.2.0 #minor (#800)
We can't yet ship a fully libgit2 v1.2.0-compatible library due to a missing public symbol, but we can allow the v1.1.0-era codebase to link against libgit2 v1.2.0 in the meantime.
1 parent 2077003 commit 549706b

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ jobs:
6161
strategy:
6262
fail-fast: false
6363
matrix:
64-
libgit2: [ '1.1.0' ]
64+
libgit2:
65+
- 'v1.1.0'
66+
- 'v1.2.0'
6567
name: Go (system-wide, dynamic)
6668

6769
runs-on: ubuntu-20.04
@@ -78,7 +80,7 @@ jobs:
7880
run: |
7981
git submodule update --init
8082
sudo apt-get install -y --no-install-recommends libssh2-1-dev
81-
sudo env BUILD_LIBGIT_REF=v${{ matrix.libgit2 }} ./script/build-libgit2.sh --dynamic --system
83+
sudo env BUILD_LIBGIT_REF=${{ matrix.libgit2 }} ./script/build-libgit2.sh --dynamic --system
8284
- name: Test
8385
run: make TEST_ARGS=-test.v test
8486

Build_bundled_static.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ package git
99
#cgo CFLAGS: -DLIBGIT2_STATIC
1010
#include <git2.h>
1111
12-
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
13-
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0"
12+
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 2
13+
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.2.0"
1414
#endif
1515
*/
1616
import "C"

Build_system_dynamic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ package git
77
#cgo CFLAGS: -DLIBGIT2_DYNAMIC
88
#include <git2.h>
99
10-
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
11-
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0"
10+
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 2
11+
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.2.0"
1212
#endif
1313
*/
1414
import "C"

Build_system_static.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ package git
77
#cgo CFLAGS: -DLIBGIT2_STATIC
88
#include <git2.h>
99
10-
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
11-
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0"
10+
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 2
11+
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.2.0"
1212
#endif
1313
*/
1414
import "C"

script/build-libgit2.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ if [ -n "${BUILD_LIBGIT_REF}" ]; then
5151
trap "git submodule update --init" EXIT
5252
fi
5353

54+
BUILD_DEPRECATED_HARD="ON"
5455
if [ "${BUILD_SYSTEM}" = "ON" ]; then
5556
BUILD_INSTALL_PREFIX=${SYSTEM_INSTALL_PREFIX-"/usr"}
57+
# Most system-wide installations won't intentionally omit deprecated symbols.
58+
BUILD_DEPRECATED_HARD="OFF"
5659
else
5760
BUILD_INSTALL_PREFIX="${BUILD_PATH}/install"
5861
mkdir -p "${BUILD_PATH}/install/lib"
@@ -68,7 +71,7 @@ cmake -DTHREADSAFE=ON \
6871
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
6972
-DCMAKE_INSTALL_PREFIX="${BUILD_INSTALL_PREFIX}" \
7073
-DCMAKE_INSTALL_LIBDIR="lib" \
71-
-DDEPRECATE_HARD=ON \
74+
-DDEPRECATE_HARD="${BUILD_DEPRECATE_HARD}" \
7275
"${VENDORED_PATH}"
7376

7477
if which make nproc >/dev/null && [ -f Makefile ]; then

0 commit comments

Comments
 (0)