FGasper/p5-Net-LibNFS

Windows no longer compiles

FGasper opened this issue · 10 comments

libnfs appears, in sahlberg/libnfs@028cff9, to have broken this module on Windows.

I’m unsure of the fix presently. While libnfs itself builds on Windows, its internal writev implementation doesn’t seem to work for this module.

I’ve tried setting that implementation to be non-inline, but that didn’t fix the situation. I either see “missing symbol”, or multiple-definition errors, for writev.

@rovo89, do you have any insight here?

Unfortunately I don't have a test environment, so I can just check the actions... I assume the latest one is this:
https://github.com/FGasper/p5-Net-LibNFS/actions/runs/3593949367/jobs/6051579223

And there the error is:

libnfs.xs: In function '_set_unix_authn':
libnfs.xs:806:78: error: expected ')' before 'PRIu32'
  806 |     if (value > UINT32_MAX) croak("%s: value (%" UVuf ") exceeds maximum (%" PRIu32 ")", name, value, UINT32_MAX);
      |                                  ~                                           ^~~~~~
libnfs.xs:806:78: note: in definition of macro '_croak_if_uv_exceeds_u32'
  806 |     if (value > UINT32_MAX) croak("%s: value (%" UVuf ") exceeds maximum (%" PRIu32 ")", name, value, UINT32_MAX);
      |                                                                              ^~~~~~
libnfs.xs:31:1: note: 'PRIu32' is defined in header '<inttypes.h>'; did you forget to '#include <inttypes.h>'?
   30 | #include <fcntl.h>
  +++ |+#include <inttypes.h>

Maybe try the suggestion, or maybe use UVuf instead of PRIu32? I don't know the definition, but if it can represent value, then it should be able to represent the smaller UINT32_MAX as well.

Oof, that’s another issue, but at least probably an easy one to accommodate.

The “real” problem is writev and readv, which don’t exist in Windows-land. libnfs builds in Windows just fine, but when I try to link libnfs.a into Net::LibNFS I get the linker error that writev and readv don’t exist.

Difficult... are we even sure that win32_compat.h is included? Maybe https://github.com/marketplace/actions/debugging-with-ssh helps to debug this on the runner itself?

Notwithstanding the love that that action inspires in me (!!) …
image

I think I can get access to a Windows VM; hopefully that’ll yield some answers.

Fixed via update to libnfs.