Why does this unmodified code from the official PHP 5.6.18 release:
--SKIPIF--
<?php
if (phpversion() < "5.3.0") { die('SKIP php version so lower.'); }
if (!extension_loaded('openssl')) { die('ext/openssl required'); }
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
die('skip windows only test');
}
?>
... not cause a windows-only test to be skipped when I'm building the PHP package on Arch Linux?
I'm trying to build PHP5.6.18 using the PKGBUILD from the official Arch Build System. Here's what I've done:
git clone git://projects.archlinux.org/svntogit/packages.git
packages
, and git checkout
that commit ID.pkgver=5.6.18
pkgrel=1
'177ba962557795866ae331ad4ad99bba'
makechrootpkg -c -r $CHROOT
(in the directory with the PKGBUILD
file.The build works fine, but I get the following test failure:
Number of tests : 6651 6180
Tests skipped : 471 ( 7.1%) --------
Tests warned : 1 ( 0.0%) ( 0.0%)
Tests failed : 1 ( 0.0%) ( 0.0%)
Expected fail : 9 ( 0.1%) ( 0.1%)
Tests passed : 6169 ( 92.8%) ( 99.8%)
---------------------------------------------------------------------
Time taken : 45 seconds
...
FAILED TEST SUMMARY
---------------------------------------------------------------------
mixed stream_socket_enable_crypto(resource $stream , bool $enable [, int $crypto_type [, resource $session_stream
]] ) ; [ext/standard/tests/streams/stream_socket_enable_crypto-win32.phpt]
=====================================================================
=====================================================================
WARNED TEST SUMMARY
---------------------------------------------------------------------
Bug #70172 - Use After Free Vulnerability in unserialize() [ext/standard/tests/serialize/bug70172.phpt] (warn: XFA
IL section but test passes)
=====================================================================
OK, so the win32
already looks suspicious in the filename, and a look at the file contents indeed suggests that the test should be skipped on Linux:
--TEST--
mixed stream_socket_enable_crypto(resource $stream , bool $enable [, int $crypto_type [, resource $session_stream ]] ) ;
...
--SKIPIF--
<?php
if (phpversion() < "5.3.0") { die('SKIP php version so lower.'); }
if (!extension_loaded('openssl')) { die('ext/openssl required'); }
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
die('skip windows only test');
}
?>
Note the PHP_OS
related check. So, I'm thinking, maybe PHP_OS is somehow getting the wrong value. So, I:
arch-nspawn $CHROOT/$USER/
echo substr(PHP_OS, 0, 3)
to the beginning of that test (just under the <?php
in the --FILE--
section, and in the actual stream_socket_enable_crypto-win32.php
file)stream_socket_enable_crypto-win32.sh
script in the same directory, I indeed see the expected Lin
output.Why is this test not skipped? I'm really confused. How can I fix this issue?
As a workaround, for now I'll just delete the test in the prepare()
section of the PKGBUILD
file:
prepare() {
cd ${srcdir}/${pkgbase}-${pkgver}
# ....
# add this line:
rm ./ext/standard/tests/streams/stream_socket_enable_crypto-win32.phpt
}
It would be nice if M01 would let us know the name of the PKGBUILD file he edited so i could take a look at that as well.
But until then just open up this file:
/usr/src/php/ext/standard/tests/streams/stream_socket_enable_crypto-win32.phpt
and find this line as shown above as well.
And just comment out the line, if anyone is still running php 5.3 they should be tarballed and feathered anyway lol..
//commented out by dave due to bug and should be skipped
//if (phpversion() < "5.3.0") { die('SKIP php version so lower.'); }