Skip to content

Commit e11ad25

Browse files
Merge v2.3 into v2.x (#2023)
2 parents c209bfb + 470587b commit e11ad25

5 files changed

Lines changed: 70 additions & 0 deletions

File tree

.evergreen/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ github_pr_aliases: &github_pr_aliases
3737
# Run PR tasks for all PR variants (only MongoDB 7.0)
3838
- variant_tags: ["pr"]
3939
task_tags: ["pr 7.0"]
40+
# Run PECL package test
41+
- variant_tags: ["pr pecl"]
42+
task_tags: ["pr pecl"]
4043

4144
commit_queue_aliases: *github_pr_aliases
4245

.evergreen/config/build-task-groups.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ task_groups:
1919
tasks:
2020
- ".build"
2121

22+
- name: "build-pecl-test"
23+
max_hosts: 1
24+
setup_task: *build_setup
25+
setup_task_can_fail_task: true
26+
setup_task_timeout_secs: 1800
27+
teardown_task: *build_teardown
28+
tasks:
29+
- "test-pecl-package"
30+
2231
- name: "build-php-libmongoc"
2332
# Keep this in sync with the actual number of libmongoc builds (typically 3) defined in _template-build-libmongoc.yml
2433
max_hosts: 2

.evergreen/config/build-variants.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ buildvariants:
1717
tasks:
1818
- name: "build-all-php"
1919

20+
# PECL package test - RHEL 8 does not provide zstd, catching stale config header issues
21+
- name: test-pecl-rhel8
22+
display_name: "Test: PECL package (RHEL 8)"
23+
tags: ["pecl", "x64", "pr", "tag"]
24+
run_on: rhel80-small
25+
expansions:
26+
PHP_VERSION: "8.3"
27+
tasks:
28+
- name: "build-pecl-test"
29+
2030
# RHEL
2131
- name: build-rhel90
2232
display_name: "Build: RHEL 9.0"

.evergreen/config/test-tasks.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,38 @@
11
tasks:
2+
- name: "test-pecl-package"
3+
tags: ["pecl", "nodb", "pr", "tag"]
4+
commands:
5+
- command: shell.exec
6+
type: test
7+
params:
8+
working_dir: "src"
9+
add_expansions_to_env: true
10+
script: |
11+
set -o errexit
12+
13+
PHP_PATH=$(find /opt/php/ -maxdepth 1 -type d -name "${PHP_VERSION}*-64bit" -print | sort -V -r | head -n 1)/bin
14+
export PATH="$PHP_PATH:$PATH"
15+
echo "PHP: $(php --version | head -n 1)"
16+
17+
# Compile the extension: required to generate the Makefile and to
18+
# make MONGODB_VERSION available for `make package.xml`
19+
phpize
20+
./configure --enable-mongodb-developer-flags
21+
make all
22+
23+
echo "Testing" > changelog
24+
make package.xml RELEASE_NOTES_FILE=$(pwd)/changelog
25+
make package
26+
27+
PACKAGE_VERSION=$(./bin/update-release-version.php get-version)
28+
PACKAGE_FILE="mongodb-$PACKAGE_VERSION.tgz"
29+
30+
# Install via PECL (fresh configure + build in a temp directory, same as a real user install)
31+
# Redirect stdin from /dev/null to prevent PECL from reading the rest of the script when
32+
# prompting for configure options (it would use the next script line as the first answer).
33+
pecl install "$PACKAGE_FILE" < /dev/null
34+
php -d extension="$(php-config --extension-dir)/mongodb.so" --ri mongodb
35+
236
- name: "test-atlas-connectivity"
337
tags: ["atlas", "nodb", "pr", "tag"]
438
commands:

bin/prep-release.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,20 @@ function get_files() {
9797
}
9898
}
9999
}
100+
101+
// Exclude headers generated by configure (AC_CONFIG_FILES in config.m4).
102+
// These are produced on the build machine and must not be shipped in the
103+
// PECL package. Their .h.in templates are included above and configure
104+
// regenerates the correct output in the build directory on the target machine.
105+
unset($files['src/libmongoc/src/common/src/common-config.h']);
106+
unset($files['src/libmongoc/src/libbson/src/bson/config.h']);
107+
unset($files['src/libmongoc/src/libbson/src/bson/version.h']);
108+
unset($files['src/libmongoc/src/libmongoc/src/mongoc/mongoc-config.h']);
109+
unset($files['src/libmongoc/src/libmongoc/src/mongoc/mongoc-config-private.h']);
110+
unset($files['src/libmongoc/src/libmongoc/src/mongoc/mongoc-version.h']);
111+
unset($files['src/libmongoc/src/zlib-1.3.1/zconf.h']);
112+
unset($files['src/libmongocrypt/src/mongocrypt-config.h']);
113+
100114
ksort($files);
101115
return $files;
102116
}

0 commit comments

Comments
 (0)