fswatch
fswatch copied to clipboard
realpath on mingw-w64
Trying to build on windows with msys2 (mingw-w64
) fails with:
checking for working strtod... yes
checking for atexit... yes
checking for realpath... no
configure: error: The realpath function cannot be found.
From what I understand from this issue, realpath is actually not a standard ansi/posix function and therefore mingw-w64 does not implement it.
This topic seems to have a working version of realpath for windows. Perhaps we could include that within a #ifdef win32
or so?
Working on feature/windows-realpath
.
@emcrisostomo You mean that it works already, or that you are working on it? :) Thanks!
Hi @gaborcsardi, you're welcome. It means that I'm working on it on that branch.
Hi MinGW users, would you mind trying to build the feature/windows-realpath branch?
@emcrisostomo Thanks! It is improving I believe, I get now:
checking whether lstat correctly handles trailing slash... no
checking for modf... yes
checking for regcomp... no
configure: error: The regcomp function cannot be found.
configure: error: ./configure failed for libfswatch
I don't know if msys2 has regcomp.
Maybe it is in glib2, trying now....
Unfortunately not. Anyway, thanks for the fix, that takes us one step closer.
It seems that c++11 has std::regex that can easily replace the regcomp function in the code. We should be able to get around this error. I am going to take a crack at this and file a PR when I am done.
Hi @allidev, regcomp
is not what it's blocking this issue to proceed.
Also, take into account that the fact that we use regcomp
instead of the <regex>
library is that there was (is?) no support in all the platform I tested with and would like to support. gcc, for example, shipped the first implementation in 4.9. That's also why I'm not using any newer C++ standard
Hence: I do not believe much on the value of using <regex>
, and take this into account:
- The support for
mingw
is not blocked on the availability ofregcomp
, but simply on my time. - If you want to add support to
<regex>
then the following must occur:- Autotools machinery must be provided to correctly detect the host configuration.
- All platforms must be checked and tested, including obviously Linux, OS X/macOS, FreeBSD, SmartOS, Windows and Solaris.
If that doesn't happen, with a special emphasis on the portability check, the PR is not going to be merged.
@emcrisostomo, I understand your concern. In fact, in filter.cpp, you do use <regex>
, so it seems that the value of using <regex>
has been validated in the current codebase. Maybe I am missing something.
@allidev You're right, I had completely forgotten about it. Thanks.
I prefer to track this one in a dedicated issue: #178
Have a feeling that this issue/use case ends up being a (mis)use of MSYS2 as this thread or this even older thread suggests. That said, it looks like one might be able to #define
an equivalent function to realpath
. Admittedly that is quite old code that may need to be retested.
Also I believe regcomp
and friends are available in pcre
. So that would be another option to consider.
Is there any movement here? I saw that #214 had some solution, can parts of that be added in the repo?
As someone that have not done much c/c++-programming, is there something I can do to help move this forward?