Git fork

t/interop: allow per-version make options

Building older versions of Git may require tweaking some build knobs. In
particular, very old versions of Git will fail to build with recent
OpenSSL, because the bignum type switched from a struct to a pointer.

The i5500 interop test uses Git v1.0.0 by default, which triggers this
problem. You can work around it by setting NO_OPENSSL in your
GIT_TEST_MAKE_OPTS variable. But there are two downsides:

1. You have to know to do this, and it's not at all obvious.

2. That sets the options for _all_ versions of Git that we build. And
it's possible for two versions to require conflicting knobs. E.g.,
building with "make NO_OPENSSL=Nope OPENSSL_SHA1=Yes" causes
imap-send.c to barf, because it declares a fallback typedef for SSL.
This is something we may want to fix, but of course many historical
versions are affected, and the interop scripts should be flexible
enough to build everything.

So let's introduce per-version make options, along with the ability for
scripts to specify knobs that match their default versions. That should
make everything build out of the box, but also allow testers flexibility
if they are testing interoperability between non-default versions.

We'll set NO_OPENSSL by default for v1.0.0 in i5500. It doesn't have to
worry about the conflict with OPENSSL_SHA1 because imap-send did not
exist back then (but if it did, it could also just explicitly use a
different hash implementation).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Jeff King and committed by
Junio C Hamano
22ef5f02 39bf06ad

+13 -3
+7
t/interop/README
··· 83 83 should create one with the appropriate version of git. 84 84 85 85 At the end of the script, call test_done as usual. 86 + 87 + Some older versions may need a few build knobs tweaked (e.g., ancient 88 + versions of Git no longer build with modern OpenSSL). Your script can 89 + set MAKE_OPTS_A and MAKE_OPTS_B, which will be passed alongside 90 + GIT_INTEROP_MAKE_OPTS. Users can override them per-script by setting 91 + GIT_INTEROP_MAKE_OPTS_{A,B} in the environment, just like they can set 92 + GIT_TEST_VERSION_{A,B}.
+1
t/interop/i5500-git-daemon.sh
··· 2 2 3 3 VERSION_A=. 4 4 VERSION_B=v1.0.0 5 + MAKE_OPTS_B="NO_OPENSSL=TooOld" 5 6 6 7 : ${LIB_GIT_DAEMON_PORT:=5500} 7 8 LIB_GIT_DAEMON_COMMAND='git.a daemon'
+5 -3
t/interop/interop-lib.sh
··· 45 45 46 46 ( 47 47 cd "$dir" && 48 - make $GIT_INTEROP_MAKE_OPTS >&2 && 48 + make $2 $GIT_INTEROP_MAKE_OPTS >&2 && 49 49 touch .built 50 50 ) || return 1 51 51 ··· 76 76 77 77 VERSION_A=${GIT_TEST_VERSION_A:-$VERSION_A} 78 78 VERSION_B=${GIT_TEST_VERSION_B:-$VERSION_B} 79 + MAKE_OPTS_A=${GIT_INTEROP_MAKE_OPTS_A:-$MAKE_OPTS_A} 80 + MAKE_OPTS_B=${GIT_INTEROP_MAKE_OPTS_B:-$MAKE_OPTS_B} 79 81 80 - if ! DIR_A=$(build_version "$VERSION_A") || 81 - ! DIR_B=$(build_version "$VERSION_B") 82 + if ! DIR_A=$(build_version "$VERSION_A" "$MAKE_OPTS_A") || 83 + ! DIR_B=$(build_version "$VERSION_B" "$MAKE_OPTS_B") 82 84 then 83 85 echo >&2 "fatal: unable to build git versions" 84 86 exit 1