-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Windows out-of-tree extension build (using phpize.bat
) doesn't play nice when two folders contain .c files with the same name
#16843
Comments
dktapps
added a commit
to pmmp/ext-pmmpthread
that referenced
this issue
Nov 18, 2024
dktapps
added a commit
to pmmp/ext-pmmpthread
that referenced
this issue
Nov 18, 2024
After digging through confutils.js I was able to come up with a workaround like so: Looks like php-src/win32/build/confutils.js Line 1618 in 1307d30
dir in phpize mode. Probably needs to replace the base build dir with "" in dir instead of ignoring it completely.
|
Indeed, this looks like a bug. Maybe the following is sufficient and won't break working builds: win32/build/confutils.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 3623dcf7e2..d7e2a211e7 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1614,8 +1614,15 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
if (obj_dir == null) {
if (MODE_PHPIZE) {
/* In the phpize mode, the subdirs are always relative to BUID_DIR.
- No need to differentiate by extension, only one gets built. */
- var build_dir = (dirname ? dirname : "").replace(new RegExp("^..\\\\"), "");
+ No need to differentiate by extension, only one gets built.
+ We still need to cater to subfolders, though. */
+ if (dir.charAt(configure_module_dirname.length) === "\\" &&
+ dir.substr(0, configure_module_dirname.length) === configure_module_dirname) {
+ var reldir = dir.substr(configure_module_dirname.length + 1);
+ var build_dir = (dirname ? (reldir + "\\" + dirname) : reldir).replace(new RegExp("^..\\\\"), "");
+ } else {
+ var build_dir = (dirname ? dirname : "").replace(new RegExp("^..\\\\"), "");
+ }
} else {
var build_dir = (dirname ? (dir + "\\" + dirname) : dir).replace(new RegExp("^..\\\\"), "");
} Still, I'm not sure if we should apply this for stable PHP versions. |
dktapps
added a commit
to pmmp/ext-pmmpthread
that referenced
this issue
Nov 18, 2024
this required a MODE_PHPIZE switched workaround for php/php-src#16843 Extension is now built out-of-tree using phpize.bat, which significantly speeds up the build by allowing the main PHP part to be cached. Exact versions of PHP are now used to improve build reproducibility, like the Linux builds.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Relevant config.w32 code: https://github.com/pmmp/ext-pmmpthread/blob/ed6b7eeda8e6eab54f95c61bd94de69a15d339f6/config.w32#L29-L38
Both
classes
andsrc
have different files calledworker.c
. This works fine when the extension is built in-tree, but bails out when usingphpize
on Windows.Extension is fully successful in building on *nix, so this is a Windows build system specific issue.
https://github.com/pmmp/ext-pmmpthread/actions/runs/11891894259/job/33133760918
PHP Version
8.1.30, 8.2.25 & 8.3.13
Operating System
GitHub Actions windows-2019 image
The text was updated successfully, but these errors were encountered: