Skip to content

List skipped extensions in run-tests.php #8363

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

Closed
wants to merge 13 commits into from
Prev Previous commit
Next Next commit
fix dl fatal error
  • Loading branch information
mvorisek committed Sep 22, 2022
commit 1c78850e9de889af17a421cfbff6238848b07a71
8 changes: 3 additions & 5 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -877,22 +877,20 @@ function write_information(): void
$ext_dir = ini_get('extension_dir');
foreach (scandir($ext_dir) as $file) {
if (preg_match('/^(?:php_)?([_a-zA-Z0-9]+)\.(?:so|dll)$/', $file, $matches)) {
// workaround dl('mysqli') fatal error
// remove once https://github.com/php/php-src/issues/9196 is fixed
// @dl() is fast (about 1 ms / dl() call)
if (extension_loaded($matches[1])) {
if ($matches[1] === 'mysqli') {
continue;
}

if (dl($matches[1])) {
if (@dl($matches[1])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not load dl() if the extension_loaded(), i.e. keep this as it was before.

Copy link
Contributor Author

@mvorisek mvorisek Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is (strictly taken, /wo assuming the name) impossible, as the extension_loaded() input must be the ext name, not the so/dll filename

as long as the @dl() does not end with a fatal error (it should not), what is wrong witch this approach?

all non-fatal errors are suppressed as before and this load is done in a separate php process, thus there is no side effect to the main script

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for performance. Checking whether the extension is already loaded should be much faster than trying to load it again (especially on Windows). And even if some extension names have different filenames, most names match.

Copy link
Contributor Author

@mvorisek mvorisek Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    [29] => bz2
    [30] => 0.0010008811950684
    [31] => com_dotnet
    [32] => 0.00091910362243652
    [33] => curl
    [34] => 0.032949924468994
    [35] => dba
    [36] => 0.0010781288146973
    [37] => dl_test
    [38] => 0.00081610679626465
    [39] => enchant
    [40] => 0.01164698600769
    [41] => exif
    [42] => 0.00087594985961914
    [43] => ffi
    [44] => 0.00097990036010742
    [45] => fileinfo
    [46] => 0.0011739730834961
    [47] => ftp
    [48] => 0.00086712837219238
    [49] => gd
    [50] => 0.0023589134216309
    [51] => gettext
    [52] => 0.00079488754272461
    [53] => gmp
    [54] => 0.00092196464538574
    [55] => imap
    [56] => 0.0031580924987793
    [57] => intl
    [58] => 0.040650129318237
    [59] => mbstring
    [60] => 0.0014688968658447
    [61] => mysqli
    [62] => 0.0011990070343018
    [63] => odbc
    [64] => 0.0031149387359619
    [65] => pdo_firebird
    [66] => 0.0040609836578369
    [67] => pdo_mysql
    [68] => 0.0008399486541748
    [69] => pdo_odbc
    [70] => 0.0032060146331787
    [71] => pdo_pgsql
    [72] => 0.005363941192627
    [73] => pdo_sqlite
    [74] => 0.0039880275726318
    [75] => pgsql
    [76] => 0.0011382102966309
    [77] => shmop
    [78] => 0.00078010559082031
    [79] => snmp
    [80] => 0.087687969207764
    [81] => soap
    [82] => 0.0021140575408936
    [83] => sockets
    [84] => 0.0011708736419678
    [85] => sodium
    [86] => 0.011409997940063
    [87] => sqlite3
    [88] => 0.0010068416595459
    [89] => sysvshm
    [90] => 0.00088095664978027
    [91] => tidy
    [92] => 0.0016140937805176
    [93] => xsl
    [94] => 0.0010459423065186
    [95] => zend_test
    [96] => 0.00094985961914062
    [97] => zip
    [98] => 0.0012450218200684

performance isn't a problem and the data are cached, but I have found a problem in PHP when using Win + ZTS - #9527

$exts[] = $matches[1];
$exts[] = microtime(true) - $t;
}
}
}
echo implode(',', $exts);
PHP);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably "detend" this line:

Suggested change
PHP);
PHP);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? with the new change, the code has (as I would expect) no indentation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry, what do you mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing PHP tag should match the indentation of the opening 'PHP'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? The indentation is determined solely by the ending PHP tag.

You meant to remove 1 indentation more for whole nowdoc?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry, you're right. The indentation is fine as is.

$extensionsNames = explode(',', shell_exec("$php $pass_options $info_params $no_file_cache \"$info_file\""));
print_r($extensionsNames);echo "\nxxxxxx\n\n\n";
$exts_to_test = array_unique(remap_loaded_extensions_names($extensionsNames));
// check for extensions that need special handling and regenerate
$info_params_ex = [
Expand Down