Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change docker-php-ext-configure to error on unknown configure flags #917

Closed
yosifkit opened this issue Dec 3, 2019 · 3 comments · Fixed by #918
Closed

change docker-php-ext-configure to error on unknown configure flags #917

yosifkit opened this issue Dec 3, 2019 · 3 comments · Fixed by #918

Comments

@yosifkit
Copy link
Member

yosifkit commented Dec 3, 2019

Could docker-php-ext-configure throw an error in such cases?

docker-library/wordpress#454 (comment)

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 (#910 (comment)).

@tianon
Copy link
Member

tianon commented Dec 3, 2019

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).

@yosifkit
Copy link
Member Author

yosifkit commented Dec 4, 2019

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

@1sting

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants