Windows support?
Opened this issue · 1 comments
JasonKleban commented
For local workstation simulations, I'm interested in an Nginx plugin for handling authentication responsibilities within the reverse proxy. Many workstations I aim to support are Windows though - how far away is Windows support for nginx plugins, please?
bavshin-f5 commented
I've been looking into that, and there are several complications. Some of these should be easy to address, some are not.
- The official builds target MSVC x32, and we don't support dynamic modules for this target.
A static module support was introduced in #67, but the scripts are not compatible with Windows and NMAKE. - There's a disagreement in alignment requirements between Rust and our code. Windows x64 build detects
NGX_ALIGNMENT
as 4, but Rust enforces 8 byte alignment for pointers to composite objects.
This could possibly be worked around by usingi686-pc-windows-msvc
or MinGW family of targets. - Static builds require providing all the static dependencies of the module, e.g. output of
rustc --print=native-static-libs
. The command does a full build of the Rust code, making it unexpectedly hard to integrate with the NGINX buildsystem. - Microsoft C compiler does not support Microsoft's UNC path format produced by
std::fs::canonicalize()
. That's the most unexpected kind of problem and it requires small changes in the bindings generation.
Even after addressing all of the above, one of the example modules causes immediate crash that I'm still trying to debug. If I manage to figure out and fix that, I'll publish the changes and the build instructions.