Could
docker-php-ext-configurethrow an error in such cases?
https://github.com/docker-library/wordpress/pull/454#issuecomment-561119742
Open discussion that it might be useful to do exactly that. I think passing --enable-option-checking=fatal to ./configure should do the trick.
We make break some users where it is currently just a warning. Their flag is wrong, so it does seem reasonable. Alternatively we only enable this for 7.4 and above, since that is when flags change appreciably (https://github.com/docker-library/php/pull/910#issuecomment-559383597).
I'm +1 on enabling this unilaterally -- I think the end result, even if there's breakage, is net-positive (because folks may be supplying configure flags now expecting that they're working when in fact they're being ignored, just like we saw with the transition to 7.4 and gd's flags).
Here is the proposed change:
diff --git a/docker-php-ext-configure b/docker-php-ext-configure
index 9e949e1..34fc133 100755
--- a/docker-php-ext-configure
+++ b/docker-php-ext-configure
@@ -66,4 +66,4 @@ fi
cd "$ext"
phpize
-./configure "$@"
+./configure --enable-option-checking=fatal "$@"
This works correctly for 7.4:
root@bc0a546c72be:/# # install dev packages
...
root@bc0a546c72be:/# docker-php-ext-configure gd --with-freetype --with-jpeg
... works fine
root@bc0a546c72be:/# docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
configure: error: unrecognized options: --with-freetype-dir, --with-jpeg-dir
$ # and can be put back to warnings with "--enable-option-checking"
root@bc0a546c72be:/# docker-php-ext-configure gd --enable-option-checking --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
...
configure: WARNING: unrecognized options: --with-freetype-dir, --with-jpeg-dir
thanks
Most helpful comment
Here is the proposed change:
This works correctly for 7.4: