Skip to content

Commit 4cf84bd

Browse files
committed
Build driver with system libs
1 parent 45dc641 commit 4cf84bd

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

.github/actions/linux/build/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ inputs:
44
version:
55
description: "PHP version to build for"
66
required: true
7+
configureOpts:
8+
description: "Extra options to use for the call to ./configure"
9+
default: ""
10+
711
runs:
812
using: composite
913
steps:
@@ -17,6 +21,8 @@ runs:
1721
- name: "Configure driver"
1822
run: .github/workflows/configure.sh
1923
shell: bash
24+
env:
25+
CONFIGURE_OPTS: ${{ inputs.configureOpts }}
2026

2127
- name: "Build driver"
2228
run: "make all"

.github/workflows/system-libs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,14 @@ jobs:
2121
uses: ./.github/actions/linux/build-libmongoc
2222
with:
2323
version: 2.0.1
24+
25+
- name: "Build Driver"
26+
id: build-driver
27+
uses: ./.github/actions/linux/build
28+
with:
29+
version: "8.4"
30+
configureOpts: "--with-mongodb-system-libs=yes"
31+
32+
- name: "Check driver version"
33+
shell: bash
34+
run: make show-config

Makefile.frag

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: mv-coverage lcov-coveralls lcov-local coverage coveralls format format-changed format-check test-clean package package.xml libmongocrypt-version-current generate-function-map
1+
.PHONY: mv-coverage lcov-coveralls lcov-local coverage coveralls format format-changed format-check test-clean package package.xml libmongocrypt-version-current generate-function-map show-config
22

33
ifneq (,$(realpath $(EXTENSION_DIR)/json.so))
44
PHP_TEST_SHARED_EXTENSIONS := "-d" "extension=$(EXTENSION_DIR)/json.so" $(PHP_TEST_SHARED_EXTENSIONS)
@@ -88,6 +88,28 @@ generate-function-map: all
8888
echo "ERROR: Cannot generate function maps without CLI sapi."; \
8989
fi
9090

91+
show-config: all
92+
@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
93+
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
94+
if test "$$INI_FILE"; then \
95+
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
96+
else \
97+
echo > $(top_builddir)/tmp-php.ini; \
98+
fi; \
99+
INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
100+
if test "$$INI_SCANNED_PATH"; then \
101+
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
102+
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
103+
fi; \
104+
CC="$(CC)" \
105+
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) --ri mongodb; \
106+
RESULT_EXIT_CODE=$$?; \
107+
rm $(top_builddir)/tmp-php.ini; \
108+
exit $$RESULT_EXIT_CODE; \
109+
else \
110+
echo "ERROR: Cannot show config without CLI sapi."; \
111+
fi
112+
91113
test-no-build:
92114
@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
93115
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \

0 commit comments

Comments
 (0)