cocodelabs / znc-palaver

ZNC module for push notifications
MIT License
112 stars 14 forks source link

gcc 4.9.2 still giving regex build error #43

Closed btaroli closed 7 years ago

btaroli commented 8 years ago

Running this on a NAS for which an update rolled out recently with a major upgrade to Debian 8. It now has gcc 4.9.2 but this package still refuses to build with the regex test failure. Is gcc the issue or could it be a related library?

~/znc-palaver-master$ uname -a
Linux hostname 4.1.30.x86_64.1 #1 SMP Thu Sep 22 16:30:32 PDT 2016 x86_64 GNU/Linux

~/znc-palaver-master$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2
...

~/znc-palaver-master$ make
Your C++ compiler doesn't properly support regex. Please upgrade to GCC 4.9, Clang or newer.
make: *** [test] Error 1
p-vg commented 7 years ago

Having this same issue..

edit: it's sloppy, but if you remove the test-regex (lines 20,21,24, and 25) in the Makefile (assuming you've installed gcc 4.9.x) it'll compile and so far I haven't had any issues. Leave the .PHONY line (line 23) or it'll error.

btaroli commented 7 years ago

That "worked", but I do wonder whether we'll trip over regex issues. Time will tell. I'm sure the test is there for a good reason. :) Just not sure why all gcc 4.9.2 are not equal. ;)

kylef commented 7 years ago

Hi @btaroli and @p-vg, sorry for delay in getting back to you.

I may have been incorrect when I wrote in the instructions that GCC 4.9 or newer required, during some of my testing I found that some version of GCC 4.9 was working correctly and 4.8 wasn't so I assumed GCC 4.9 was the minimum version of GCC that would work with the module. It might well be that GCC 4.9.1, 4.9.2, 4.9.3 or 4.9.4 actually implements regex correctly instead of 4.9(.0).

The test is checking that a regex using word boundaries would be matched correctly as I discovered that some older versions of GCC had problems and would raise an exception instead of correctly matching. If the tests fail then the ZNC module won't be detect when another user mentions your nick or configured mention keywords and then you won't receive push notifications in these cases.

The test checks this very case, the code is very similar to what the module does when checking nick/mention keywords (https://github.com/cocodelabs/znc-palaver/blob/master/palaver.cpp#L514).

I would suggest that instead of removing the test you should instead upgrade to a newer compiler, GCC 4.9 is pretty old and there have been two major release of GCC since (5.x, and 6.x).

ruok5 commented 7 years ago

Just in case it helps someone else, running make clean won't remove the non-passing test-regex binary that was compiled with an older GCC, and it may seem as though the new version you've installed still doesn't work. Once I removed it, I could compile the module.

kylef commented 7 years ago

I've updated make clean in 6ee20dc299eec02f674de73744f3d821bc6716b5 to include test-regex to solve this problem.