mhallin / notify-forwarder

Simple tool that can forward file system events to other machine, such as virtual machines with shared folders
111 stars 21 forks source link

Debian "bullseye" compatibility #11

Open bmorton opened 2 years ago

bmorton commented 2 years ago

I recently had to upgrade a base image to Debian "bullseye" and this dependency was failing to build with:

 > [15/20] RUN make:
#19 0.188 mkdir _build
#19 0.189 g++ -MD -g -O0 -std=c++11  -D WATCH_PLUGIN_TYPE=InotifyWatchPlugin   -c -o src/watch_null.o src/watch_null.cc
#19 0.347 g++ -MD -g -O0 -std=c++11  -D WATCH_PLUGIN_TYPE=InotifyWatchPlugin   -c -o src/notify_udp.o src/notify_udp.cc
#19 0.483 g++ -MD -g -O0 -std=c++11  -D WATCH_PLUGIN_TYPE=InotifyWatchPlugin   -c -o src/receive_udp.o src/receive_udp.cc
#19 0.586 src/receive_udp.cc: In constructor ‘UDPReceivePlugin::UDPReceivePlugin(short int, const ReceiveCallback&)’:
#19 0.586 src/receive_udp.cc:27:20: error: ‘runtime_error’ is not a member of ‘std’
#19 0.586    27 |         throw std::runtime_error("Could not create sending socket");
#19 0.586       |                    ^~~~~~~~~~~~~
#19 0.587 src/receive_udp.cc:40:20: error: ‘runtime_error’ is not a member of ‘std’
#19 0.587    40 |         throw std::runtime_error("Could not bind listening socket");
#19 0.587       |                    ^~~~~~~~~~~~~
#19 0.588 src/receive_udp.cc:49:20: error: ‘runtime_error’ is not a member of ‘std’
#19 0.588    49 |         throw std::runtime_error("Could not set socket timeout");
#19 0.588       |                    ^~~~~~~~~~~~~
#19 0.589 src/receive_udp.cc: In member function ‘virtual void UDPReceivePlugin::start()’:
#19 0.589 src/receive_udp.cc:80:24: error: ‘runtime_error’ is not a member of ‘std’
#19 0.589    80 |             throw std::runtime_error("Could not receive UDP message");
#19 0.589       |                        ^~~~~~~~~~~~~
#19 0.612 make: *** [<builtin>: src/receive_udp.o] Error 1

With a little research, I found this related GitHub issue and my co-worker @lritter's fork and put this together to get my build happy again.

Is this useful for others too?

503Dev commented 1 year ago

Just came to say - this fixes the issue on Raspbian / Raspberry Pi. The pre-compiled binaries do not work however a quick clone and make works fine after adding these changes. I actually came to the conclusion through Google-Fu and came here to make a PR for it -- and saw you already did. Thank you.