From 3ab3cb85940bcb8515990312b363172521bbade8 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Mon, 2 Apr 2018 13:51:08 +1000 Subject: [PATCH 1/4] Increment version to 4.6.4. --- docs/release-notes.rst | 1 + docs/release-notes/version-4.6.4.rst | 7 +++++++ src/server/wsgi_version.h | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 docs/release-notes/version-4.6.4.rst diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 4b399126..e6d49b14 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -5,6 +5,7 @@ Release Notes .. toctree:: :maxdepth: 2 + release-notes/version-4.6.4 release-notes/version-4.6.3 release-notes/version-4.6.2 release-notes/version-4.6.1 diff --git a/docs/release-notes/version-4.6.4.rst b/docs/release-notes/version-4.6.4.rst new file mode 100644 index 00000000..6f3642ab --- /dev/null +++ b/docs/release-notes/version-4.6.4.rst @@ -0,0 +1,7 @@ +============= +Version 4.6.4 +============= + +Version 4.6.4 of mod_wsgi can be obtained from: + + https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.6.4 diff --git a/src/server/wsgi_version.h b/src/server/wsgi_version.h index 8ee561fe..b9b7f43f 100755 --- a/src/server/wsgi_version.h +++ b/src/server/wsgi_version.h @@ -25,8 +25,8 @@ #define MOD_WSGI_MAJORVERSION_NUMBER 4 #define MOD_WSGI_MINORVERSION_NUMBER 6 -#define MOD_WSGI_MICROVERSION_NUMBER 3 -#define MOD_WSGI_VERSION_STRING "4.6.3" +#define MOD_WSGI_MICROVERSION_NUMBER 4 +#define MOD_WSGI_VERSION_STRING "4.6.4" /* ------------------------------------------------------------------------- */ From d4ea7fce0158cdbe720c121ee7db9e752f3f242e Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Mon, 2 Apr 2018 13:58:38 +1000 Subject: [PATCH 2/4] Python config directory can have platform name in it. --- docs/release-notes/version-4.6.4.rst | 12 ++++++++++++ setup.py | 2 ++ 2 files changed, 14 insertions(+) diff --git a/docs/release-notes/version-4.6.4.rst b/docs/release-notes/version-4.6.4.rst index 6f3642ab..45f904ab 100644 --- a/docs/release-notes/version-4.6.4.rst +++ b/docs/release-notes/version-4.6.4.rst @@ -5,3 +5,15 @@ Version 4.6.4 Version 4.6.4 of mod_wsgi can be obtained from: https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.6.4 + +Bugs Fixed +---------- + +* In more recent Python versions, the config directory in the Python + installation incorporates the platform name. This directory was added as + an additional directory to search for Python shared libraries when + installing using the ``setup.py`` file or ``pip``. It should not even be + needed for newer Python versions but still check for older Python + versions. The only issue arising from the wrong directory, not incorporating + the platform name, being used, was a linker warning about the directory + not being present. diff --git a/setup.py b/setup.py index 6be132b7..f72fa5dd 100644 --- a/setup.py +++ b/setup.py @@ -442,6 +442,8 @@ def get_apu_includes(): if PYTHON_LDVERSION and PYTHON_LDVERSION != PYTHON_VERSION: PYTHON_CFGDIR = '%s-%s' % (PYTHON_CFGDIR, PYTHON_LDVERSION) + if not os.path.exists(PYTHON_CFGDIR): + PYTHON_CFGDIR = '%s-%s' % (PYTHON_CFGDIR, sys.platform) PYTHON_LDFLAGS = ['-L%s' % PYTHON_LIBDIR, '-L%s' % PYTHON_CFGDIR] PYTHON_LDLIBS = ['-lpython%s' % PYTHON_LDVERSION] From b864998e2060aa9bdf06a2a7200196140f63fe61 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Mon, 2 Apr 2018 14:02:51 +1000 Subject: [PATCH 3/4] Fix compile time issue in Windows with wsgi_daemon_process being undefined. --- docs/release-notes/version-4.6.4.rst | 6 ++++++ src/server/mod_wsgi.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/docs/release-notes/version-4.6.4.rst b/docs/release-notes/version-4.6.4.rst index 45f904ab..8c3e36bc 100644 --- a/docs/release-notes/version-4.6.4.rst +++ b/docs/release-notes/version-4.6.4.rst @@ -17,3 +17,9 @@ Bugs Fixed versions. The only issue arising from the wrong directory, not incorporating the platform name, being used, was a linker warning about the directory not being present. + +* Installing mod_wsgi on Windows would fail as hadn't exclude mod_wsgi + daemon mode specific code from Windows build. This would result in compile + time error about ``wsgi_daemon_process`` being undefined. This problem + was introduced to Windows in version 4.6.0. A prior attempt to fix this + in 4.6.3 missed one place in the code which needed to be changed. diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c index 04a0bafe..81b41173 100644 --- a/src/server/mod_wsgi.c +++ b/src/server/mod_wsgi.c @@ -4248,8 +4248,12 @@ static apr_status_t wsgi_python_child_cleanup(void *data) * before trying to wait on request threads. */ +#if defined(MOD_WSGI_WITH_DAEMONS) if (!wsgi_daemon_process) wsgi_publish_process_stopping(wsgi_shutdown_reason); +#else + wsgi_publish_process_stopping(wsgi_shutdown_reason); +#endif /* In a multithreaded MPM must protect table. */ From a4ddd9fd9f8fcc60d5da267d8c510d1759cf7b59 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Tue, 3 Apr 2018 10:22:45 +1000 Subject: [PATCH 4/4] Fix issues with undefined wsgi_daemon_process when compiling for Windows. --- src/server/wsgi_interp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/server/wsgi_interp.c b/src/server/wsgi_interp.c index 0aa64697..7d318d0c 100644 --- a/src/server/wsgi_interp.c +++ b/src/server/wsgi_interp.c @@ -419,6 +419,8 @@ InterpreterObject *newInterpreterObject(const char *name) int is_threaded = 0; int is_forked = 0; + int is_service_script = 0; + const char *str = NULL; /* Create handle for interpreter and local data. */ @@ -595,7 +597,10 @@ InterpreterObject *newInterpreterObject(const char *name) * registering signal handlers so they are ignored. */ +#if defined(MOD_WSGI_WITH_DAEMONS) if (wsgi_daemon_process && wsgi_daemon_process->group->threads == 0) { + is_service_script = 1; + module = PyImport_ImportModule("signal"); if (module) { @@ -637,7 +642,9 @@ InterpreterObject *newInterpreterObject(const char *name) Py_XDECREF(module); } - else if (wsgi_server_config->restrict_signal != 0) { +#endif + + if (!is_service_script && wsgi_server_config->restrict_signal != 0) { module = PyImport_ImportModule("signal"); if (module) { @@ -2057,17 +2064,19 @@ apr_status_t wsgi_python_term(void) * condition. */ +#if defined(MOD_WSGI_WITH_DAEMONS) if (wsgi_daemon_process) apr_thread_mutex_lock(wsgi_shutdown_lock); -#if defined(MOD_WSGI_WITH_DAEMONS) wsgi_daemon_shutdown++; #endif Py_Finalize(); +#if defined(MOD_WSGI_WITH_DAEMONS) if (wsgi_daemon_process) apr_thread_mutex_unlock(wsgi_shutdown_lock); +#endif wsgi_python_initialized = 0;