Commit 919991ee124 for php
commit 919991ee1240fb52b38d2aa628ff5bc4fa6778f7
Author: Jérôme Tamarelle <jerome@tamarelle.net>
Date: Thu Sep 3 21:02:05 2026 +0200
phpize: Fail when build files cannot be copied
Both cp calls run in subshells with no status check, and
phpize_copy_files is called unconditionally, so phpize exits 0 even when
the copy fails. The extension is then configured with stale files left
over from a previous run. After a PHP upgrade in place, this silently
builds against the previous PHP's php.m4, Makefile.global and
run-tests.php.
Propagate the failure with "|| exit 1", matching the style already used
in phpize_autotools().
diff --git a/scripts/phpize.in b/scripts/phpize.in
index 3a904607616..8e99fa1d6d6 100644
--- a/scripts/phpize.in
+++ b/scripts/phpize.in
@@ -148,8 +148,8 @@ phpize_copy_files()
{
test -d build || mkdir build
- (cd "$phpdir" && cp -f $FILES_BUILD "$builddir"/build)
- (cd "$phpdir" && cp -f $FILES "$builddir")
+ (cd "$phpdir" && cp -f $FILES_BUILD "$builddir"/build) || exit 1
+ (cd "$phpdir" && cp -f $FILES "$builddir") || exit 1
}
phpize_replace_prefix()