我尝试在 Ubuntu 19.10 上安装 watchman,但遇到了一些问题。
我的命令:
$ CD〜
$ git clone https://github.com/facebook/watchman.git
$ cd watchman/
$ git checkout v4.9.0
$ sudo apt-get install -y autoconf automake build-essential
python-dev
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install$ watchman --version
问题:
scm/Mercurial.cpp: In constructor ‘watchman::Mercurial::infoCache::infoCache(std::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]
16 | 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
18 | struct FileInformation {
| ^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:4446: scm/watchman-Mercurial.o] Error 1
make[1]: Leaving directory '/home/elavarasan/watchman-4.9.0'
make: *** [Makefile:1264: all] Error 2
预期:watchman 安装成功。watchman 版本 4.9.0
答案1
跑步
./configure --without-python --without-pcre --enable-lenient
之前make
会起作用。
我找到了答案在这个 AskUbuntu 问题中。