php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55634 ./configure does not fail if invalid option is used
Submitted: 2011-09-07 13:17 UTC Modified: 2019-07-02 20:25 UTC
Votes:3
Avg. Score:3.7 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: cweiske@php.net Assigned:
Status: Wont fix Package: *Configuration Issues
PHP Version: 5.3.8 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cweiske@php.net
New email:
PHP Version: OS:

 

 [2011-09-07 13:17 UTC] cweiske@php.net
Description:
------------
When using ./configure --with-foo, configure tells me at the end:
> Notice: Following unknown configure options were used:
> --with-foo

There are two problems:
- This problem is echoed to stdout, not stderr where capturing it would be possible
- The exit code is still 0, although I clearly issued a wrong option.

In the end I cannot figure out if the configure run was *fully* successful.

Expected result:
----------------
1. config option errors echoed to stderr
2. exit code of configure script != 0


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-07 22:28 UTC] fa@php.net
I'm not saying this behaviour is wrong or right, I've been bitten by this already myself, but I do think that could be considered a BC break, as I remember it always being like that, although I'm only 100% sure on 5.2+
 [2011-09-22 19:07 UTC] ashnazg@php.net
Perhaps a BC compromise here would be to at least *also* echo to stderr, while leaving the existing echo to stdout in place?
 [2011-09-22 19:09 UTC] pajoye@php.net
well, I do consider it as a bug fix.
 [2013-08-02 11:57 UTC] mike@php.net
It's not always been like that, there have been times where configure ignored 
unknown arguments silently.  So, I'd say, we're open for improvements.
 [2016-09-15 14:08 UTC] cmb@php.net
On Windows, configure bails out early if an unknown option is
passed, what I find rather helpful.
 [2019-07-02 00:09 UTC] petk@php.net
The following pull request has been associated:

Patch Name: Use default Autoconf configuration options checkings (bug #55634)
On GitHub:  https://github.com/php/php-src/pull/4348
Patch:      https://github.com/php/php-src/pull/4348.patch
 [2019-07-02 20:25 UTC] petk@php.net
-Status: Open +Status: Wont fix
 [2019-07-02 20:25 UTC] petk@php.net
Helo, instead of building a custom macro for checking configure options, Autoconf 2.62+ already outputs a warning at the beginning and the end of the output of configure script. It automatically detects correct and wrong options better.


So now instead a better way is the default Autoconf approach:

This outputs a warning at the beginning and end of the configure output:

    ./configure --with-non-existing

This results in fatal error:

    ./configure --non-existing

    configure: error: unrecognized option: `--non-existing'
    Try `./configure --help' for more information

The `--enable-option-checking=fatal` results in fatal error for all non existing options:

    ./configure --with-non-existing --enable-option-checking=fatal

    configure: error: unrecognized options: --with-non-existing

Applied to PHP-7.4+. Hope this helps more now.

Thank you for reporting issues and helping make PHP better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC