-
Notifications
You must be signed in to change notification settings - Fork 83
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 support #263
base: master
Are you sure you want to change the base?
Windows support #263
Conversation
38263ad
to
d93b00e
Compare
Regarding zlib, there might be some additional logic at https://github.com/DanielRuf/php-spx/pull/1/files that can be helpful. I didn't test this so far due to other more important things. |
d3b1a59
to
114469d
Compare
@DanielRuf Yes, I now have to add zlib dev package to the windows image. I'm looking for an example, without success so far. |
Maybe https://github.com/DanielRuf/spx-windows-build/actions/runs/10763553391/job/29845207008#step:2:54 I also found this: https://wiki.php.net/internals/windows/libs/apache22 https://github.com/madler/zlib/tree/develop/win32 Not sure if there is some more step needed to compile and load the zlib library. |
953727e
to
ac17287
Compare
I think these should be all relevant files. I will check later, because a quick search at https://github.com/search?q=repo%3Aphp%2Fphp-windows-builder+libraries&type=code makes me think, that we can simply drop the files in some Upon further inspection, this is used via |
@cmb69 before I am going in circles, where can we drop the files to let config.w32 find them with the least amount of changes and most portable setup ( |
78cd7aa
to
6c0285a
Compare
6c0285a
to
41dc7a3
Compare
I can't port the logic of the Makefile.frag (adding assets dir copy to |
@cmb69 would you be open to support here and is there something that I can do to cover the efforts or shall I try my luck (still not much C knowledge so it would be pure trial & error on my side)? |
Something like this patch Makefile.frag.w32 | 9 +++++++++
config.w32 | 3 ++-
src/php_spx.c | 2 +-
src/spx_reporter_fp.c | 2 +-
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/Makefile.frag.w32 b/Makefile.frag.w32
new file mode 100644
index 0000000..da1aaee
--- /dev/null
+++ b/Makefile.frag.w32
@@ -0,0 +1,9 @@
+
+spx_ui_assets_dir = $(PHP_PREFIX)/share/misc/php-spx/assets/web-ui
+
+install-spx-ui-assets:
+ @echo "Installing SPX web UI to: $(spx_ui_assets_dir)"
+ @mkdir -p $(spx_ui_assets_dir)
+ @cp -r assets/web-ui/* $(spx_ui_assets_dir)
+
+install: $(all_targets) $(install_targets) install-spx-ui-assets
diff --git a/config.w32 b/config.w32
index d6cc0f5..4231332 100644
--- a/config.w32
+++ b/config.w32
@@ -5,7 +5,7 @@ ARG_ENABLE("spx-dev", "Compile SPX with debugging symbols", "no");
if (PHP_SPX == "yes") {
AC_DEFINE("HAVE_SPX", 1, "spx");
- ADD_FLAG("CFLAGS", "/Ox /Wall /WX /W2 /wd4820 /wd4774 /wd4711 /wd4710 /wd4464 /wd4005");
+ ADD_FLAG("CFLAGS", "/Ox /Wall /W2 /wd4820 /wd4774 /wd4711 /wd4710 /wd4464 /wd4005");
if (PHP_SPX_DEV == "yes") {
ADD_FLAG("CFLAGS", "/Zi");
@@ -18,6 +18,7 @@ if (PHP_SPX == "yes") {
ERROR("zlib not found");
}
+ AC_DEFINE("SPX_HTTP_UI_ASSETS_DIR", PHP_PREFIX.replace(/\\/g, "/") + "/share/misc/php-spx/assets/web-ui");
EXTENSION("spx", "src/php_spx.c \
src/spx_profiler.c \
src/spx_profiler_tracer.c \
diff --git a/src/php_spx.c b/src/php_spx.c
index 02276f9..b9759cc 100644
--- a/src/php_spx.c
+++ b/src/php_spx.c
@@ -926,7 +926,7 @@ static void http_ui_handler_shutdown(void)
goto finish;
}
- char local_file_absolute_path[PATH_MAX];
+ char local_file_absolute_path[MAXPATHLEN];
if (
spx_utils_resolve_confined_file_absolute_path(
diff --git a/src/spx_reporter_fp.c b/src/spx_reporter_fp.c
index 6c503ee..f4828d7 100644
--- a/src/spx_reporter_fp.c
+++ b/src/spx_reporter_fp.c
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <math.h>
-#include <unistd.h>
+// #include <unistd.h>
#include "spx_reporter_fp.h"
#include "spx_resource_stats.h" should be a step in the right direction. With this patch applied (and also having pthreads in the deps/ folder; should be checked in config.w32), I get:
|
bece402
to
a9f39df
Compare
Thanks @cmb69, I've applied your patch, with a slight variation around PATH_MAX management, and I got this error:
https://github.com/NoiseByNorthwest/php-spx/actions/runs/11263855256/job/31322677812 |
a9f39df
to
d651e72
Compare
d651e72
to
7c4520e
Compare
Sorry, I still had no time to look closer into this, but I do not understand why there is a src\ in x64\Release\src\php_spx.obj. The .obj files are supposed to be placed in x64\Release, and they are in my local build. Is that something that php/php-windows-builder does? |
Don't worry, and thank you again for your help.
I don't know either, I will do some tests with other php-windows-builder's versions, and look at the doc and other extensions using it. |
Initiated from the work of @DanielRuf here https://github.com/DanielRuf/spx-windows-build