On buster/sid, updated today, watchman v4.9.0 will not compile.
CXX scm/watchman-Mercurial.o
scm/Mercurial.cpp: In constructor ‘watchman::Mercurial::infoCache::infoCache(std::__cxx11::string)’:
scm/Mercurial.cpp:16:40: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct watchman::FileInformation’; use assignment or value-initialization instead [-Werror=class-memaccess]
memset(&dirstate, 0, sizeof(dirstate));
^
In file included from scm/Mercurial.h:10,
from scm/Mercurial.cpp:3:
./FileInformation.h:18:8: note: ‘struct watchman::FileInformation’ declared here
struct FileInformation {
^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:4446: scm/watchman-Mercurial.o] Error 1
make[1]: Leaving directory '/home/user/src/watchman'
make: *** [Makefile:1264: all] Error 2
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.2.0-4' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.2.0 (Debian 8.2.0-4)
Your build configuration:
CC = gcc
CPPFLAGS = -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CFLAGS = -g -O2 -Wall -Wextra -Wdeclaration-after-statement -g -gdwarf-2 -fno-omit-frame-pointer
CXX = g++
CXXFLAGS = -g -O2 -Wall -Wextra -g -gdwarf-2 -fno-omit-frame-pointer
LDFLAGS =
prefix: /usr/local
version: 4.9.0
state directory: /usr/local/var/run/watchman
Issue goes away when I switch to master, and different problems show up in thirdparty/jansson.
thirdparty/jansson/load.cpp:109:26: error: ‘ near '’ directive output may be truncated writing 7 bytes into a region of size between 1 and 160 [-Werror=format-truncation=]
"%s near '%s'", msg_text, saved_text);
^~~~~~
thirdparty/jansson/load.cpp:108:25: note: ‘snprintf’ output 9 or more bytes (assuming 168) into a destination of size 160
You can pass --enable-lenient to configure to disable promoting warnings to errors; hopefully that will unblock you.
Yep, that unblocked. Thank you wez. (Hasn't got the diff view working, but it's squashed Nuclide's "I can't find watchman" on startup.)
I have similar issues related to jansson -- this appears to be a new GCC thing https://github.com/akheron/jansson/pull/423
Thank you @wez
Had exactly the same error. --enable-lenient made it pass.
On Ubuntu 19.04 the only thing that worked for me was checking out the v4.9.0 tag and compiling with:
./configure --without-python --without-pcre --enable-lenient
Hope this helps someone in the future.
./configure --enable-lenient did the job. I had to install python-dev though.
You can pass
--enable-lenientto configure to disable promoting warnings to errors; hopefully that will unblock you.
Thanks a lot! This helped me pass the make step on Ubuntu 19.04
On Ubuntu 19.04 the only thing that worked for me was checking out the
v4.9.0tag and compiling with:./configure --without-python --without-pcre --enable-lenientHope this helps someone in the future.
No errors but a lot of warnings with those options. Apparently the watchman was installed.
On Ubuntu 19.04 the only thing that worked for me was checking out the
v4.9.0tag and compiling with:./configure --without-python --without-pcre --enable-lenientHope this helps someone in the future.
Thanks alot helped pass the make step ubuntu 20.04 
Most helpful comment
On Ubuntu 19.04 the only thing that worked for me was checking out the
v4.9.0tag and compiling with:Hope this helps someone in the future.