php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74531 config.cache causes build failures in upgrades; should be php-version-specific
Submitted: 2017-05-02 17:13 UTC Modified: 2018-08-21 03:46 UTC
From: litt at acm dot org Assigned: petk (profile)
Status: Closed Package: Compile Failure
PHP Version: 7.1.4 OS: Linux
Private report: No CVE-ID: None
 [2017-05-02 17:13 UTC] litt at acm dot org
Description:
------------
configure creates a cache file in ..; specifically ../config.cache.

I'm not thrilled about a build touching a directory above itself - this is not good practice, as the containing directory is often shared among many products.

However, PHP even creates trouble for itself, since it caches paths.

For example, consider an upgrade from PHP 5.4.7 to 5.6.30 or 7.1.4.

Burried in the configure script (after debugging various weird symptoms - compile and/or link failures):

checking for PDO includes... (cached) /home/litt/kits/php-5.4.7/ext

configure is using the result of a different version.

I strongly suggest that the configure .cache file be put in a subdirectory of the kit.  I understand why ../ was chosen - it allows one to wipe out the kit directory, untar cleanly, and still use the cache.  And if one has a common directory for php extensions, arguably they can use the same cache.  But the side effect is bad, and quite unexpected; starting over should START OVER!.

If you must have a sticky cache, or believe its benefits outweigh the risks, how about changing the file name?  E.g. php-5.4.7-config.cache

At least this would prevent versions of PHP from conflicing with each-other - and with other products...

Thanks.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-21 03:43 UTC] petk@php.net
Hello,

PHP can use optional config.cache file for saving tests. By Autoconf default the file is created in the php-src directory when using option --config-cache

The file can be also manually defined with the --cache-file=FILE configure option instead, so this might be what is described above.

More info is also described in the Autoconf manual[1].

By default PHP doesn't touch the parent directory with such file otherwise.

In case this is still relevant or I've missed something, please reopen it to check it out in more details.

Thanks for reporting issues...

[1]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html#Cache-Files
 [2018-08-21 03:46 UTC] petk@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: petk
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC