Skip to content

Commit 20899c5

Browse files
authored
PHPC-1994: Fix Evergreen testing for custom libmongoc versions (#1271)
Also updates versions in the libmongoc-version axis.
1 parent 419891d commit 20899c5

File tree

2 files changed

+25
-32
lines changed

2 files changed

+25
-32
lines changed

.evergreen/compile-unix.sh

+14-23
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,13 @@
22
set -o errexit # Exit the script with error if any of the commands fail
33

44
# Supported/used environment variables:
5-
# MARCH Machine Architecture. Defaults to lowercase uname -m
6-
# RELEASE Use the fully qualified release archive
7-
8-
RELEASE=${RELEASE:-no}
9-
5+
# MARCH Machine Architecture. Defaults to lowercase uname -m
6+
# LIBMONGOC_VERSION Optional libmongoc version (regenerate version file if set)
107

118
# Automatically retrieve the machine architecture, lowercase, unless provided
129
# as an environment variable (e.g. to force 32bit)
1310
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
14-
15-
# Get the kernel name, lowercased
16-
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
17-
echo "OS: $OS"
18-
19-
# --strip-components is an GNU tar extension. Check if the platform
20-
# (e.g. Solaris) has GNU tar installed as `gtar`, otherwise we assume to be on
21-
# platform that supports it
22-
# command -v returns success error code if found and prints the path to it
23-
if command -v gtar 2>/dev/null; then
24-
TAR=gtar
25-
else
26-
TAR=tar
27-
fi
11+
echo "MARCH: $MARCH"
2812

2913
# Any architecture specific configuration here
3014
case "$MARCH" in
@@ -39,6 +23,9 @@ case "$MARCH" in
3923
;;
4024
esac
4125

26+
# Get the kernel name, lowercased
27+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
28+
echo "OS: $OS"
4229

4330
# Operating system specific tweaks
4431
case "$OS" in
@@ -57,11 +44,15 @@ case "$OS" in
5744
;;
5845
esac
5946

60-
echo "MARCH: $MARCH"
61-
echo "RELEASE: $RELEASE"
62-
echo "OS: $OS"
63-
echo "PHP: $PHP_VERSION (`php --version | head -1`)"
47+
# Report the current PHP version
48+
echo "PHP: `php --version | head -1`"
6449

6550
phpize
6651
./configure --enable-mongodb-developer-flags
52+
53+
# If we're testing a specific version of libmongoc, regenerate the version file
54+
if [ -n "$LIBMONGOC_VERSION" ]; then
55+
make libmongoc-version-current
56+
fi
57+
6758
make

.evergreen/config.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ functions:
4242
params:
4343
working_dir: "src/src/libmongoc"
4444
script: |
45-
if [ -n "$LIBMONGOC_VERSION" ]; then
45+
if [ -n "${LIBMONGOC_VERSION}" ]; then
46+
echo "Checking out libmongoc version: ${LIBMONGOC_VERSION}"
4647
git fetch
47-
git checkout $LIBMONGOC_VERSION
48-
../../build/calc_release_version.py
48+
git checkout ${LIBMONGOC_VERSION}
49+
# Note: compile-unix.sh will run `make libmongoc-version-current`
4950
fi
5051
# Applies the submitted patch, if any
5152
# Deprecated. Should be removed. But still needed for certain agents (ZAP)
@@ -114,6 +115,7 @@ functions:
114115
115116
export PHP_VERSION="$PHP_VERSION"
116117
export SSL_DIR="$DRIVERS_TOOLS/.evergreen/x509gen"
118+
export LIBMONGOC_VERSION="${LIBMONGOC_VERSION}"
117119
EOT
118120
# See what we've done
119121
cat expansion.yml
@@ -1142,15 +1144,15 @@ axes:
11421144
display_name: libmongoc version
11431145
values:
11441146
- id: "lowest-supported"
1145-
display_name: "Lowest (1.18.0)"
1147+
display_name: "Lowest (1.19.1)"
11461148
variables:
1147-
LIBMONGOC_VERSION: "1.18.0"
1148-
- id: "upccoming-stable"
1149-
display_name: "latest (1.18-dev)"
1149+
LIBMONGOC_VERSION: "1.19.1"
1150+
- id: "upcoming-stable"
1151+
display_name: "latest (1.19-dev)"
11501152
variables:
1151-
LIBMONGOC_VERSION: "r1.18"
1153+
LIBMONGOC_VERSION: "r1.19"
11521154
- id: "latest-dev"
1153-
display_name: "Upcoming release (1.19)"
1155+
display_name: "Upcoming release (1.20)"
11541156
variables:
11551157
LIBMONGOC_VERSION: "master"
11561158

0 commit comments

Comments
 (0)