facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.57k stars 986 forks source link

Build fails on ubuntu 22.10 - CMake could not find cargo but cargo is installed #1072

Closed CapSap closed 1 year ago

CapSap commented 1 year ago

Hi, I'm trying to install from source. Following instructions from here: https://facebook.github.io/watchman/docs/install.html#-building-from-source Steps I've taken are:

git clone https://github.com/facebook/watchman.git
cd watchman
git checkout -b v2022.11.07.00
sudo ./install-system-packages.sh
sudo ./autogen.sh

and this error appears

CMake Error at build/fbcode_builder/CMake/RustStaticLibrary.cmake:61 (find_program):
  Could not find CARGO_COMMAND using the following names: cargo
Call Stack (most recent call first):
  CMakeLists.txt:139 (include)

I do have cargo installed- in terminal running command cargo version returns cargo 1.65.0 (4bc8f24d3 2022-10-20)

I've also tried using the deb but get this error

dpkg: dependency problems prevent configuration of watchman:
 watchman depends on libevent-2.1-7; however:
  Package libevent-2.1-7 is not installed.

dpkg: error processing package watchman (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 watchman

I've attempted to install the above package but get a conflicting package error and I do not know how to resolve this.

sudo dpkg -i libevent-2.1-7_2.1.11-stable-1_amd64.deb 
dpkg: regarding libevent-2.1-7_2.1.11-stable-1_amd64.deb containing libevent-2.1-7:amd64:
 libevent-2.1-7a:amd64 conflicts with libevent-2.1-7
  libevent-2.1-7:amd64 (version 2.1.11-stable-1) is to be installed.

dpkg: error processing archive libevent-2.1-7_2.1.11-stable-1_amd64.deb (--install):
 conflicting packages - not installing libevent-2.1-7:amd64
Errors were encountered while processing:
 libevent-2.1-7_2.1.11-stable-1_amd64.deb

Thanks for your time. This is my first time raising an issue

chadaustin commented 1 year ago

On the cargo issue:

We use CMake's built-in find_program command to find the cargo command, so it's possible your shell and CMake have a different search PATH. Can you run which cargo and show the output?

On the deb: you need to run sudo apt-get -f install after dpkg -i. Can you try that and let me know how it goes?

CapSap commented 1 year ago

Hello chadaustin

which cargo returns /home/sheila/.cargo/bin/cargo

the output of dpkg -i + sudo apt-get -f install

sudo dpkg -i watchman_ubuntu22.04_v2022.11.07.00.deb 
Selecting previously unselected package watchman.
(Reading database ... 239531 files and directories currently installed.)
Preparing to unpack watchman_ubuntu22.04_v2022.11.07.00.deb ...
Unpacking watchman (20221102.224517.0) ...
dpkg: dependency problems prevent configuration of watchman:
 watchman depends on libevent-2.1-7; however:
  Package libevent-2.1-7 is not installed.

dpkg: error processing package watchman (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 watchman
sheila@sheila-x1:~/Downloads$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  watchman
0 to upgrade, 0 to newly install, 1 to remove and 4 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 239535 files and directories currently installed.)
Removing watchman (20221102.224517.0) ...
dpkg: warning: while removing watchman, directory '/usr/local' not empty so not removed

(sorry; should have mentioned this in the initial post)

chadaustin commented 1 year ago

I just installed Ubuntu 21.10 and once I had cargo in my PATH it worked for me.

CMake should search PATH. Did you try building in a new shell after you installed cargo? ~/.cargo/env has to be sourced by your current shell.

CapSap commented 1 year ago

In my .bashrc I can see the line . "$HOME/.cargo/env"

and in this attempt at building, i've run which cargo prior to running build commands to confirm that cargo is in $PATH in the current shell. which cargo returns /home/sheila/.cargo/bin/cargo

and then sudo ./autogen.sh Same error

Assessing watchman...
Building watchman...
---
+ CMAKE_PREFIX_PATH=\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fb303:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/edencommon:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fbthrift:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/wangle:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fizz:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/folly:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/python-six-a_PuBql0-TcavVCS0SYl5gjjcl7jCpIVWAuUaU9OOJM:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fmt-bg_AhaTvmUSRN6k77LQLauT5ePDTpQjkMMS39M_KEls:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/cpptoml-PrUH3exhzbhBwaI2-x5QxVJn9HLAgtOBB-DD97BeIMc:\
+ DESTDIR=/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/watchman \
+ GETDEPS_BUILD_DIR=/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build \
+ GETDEPS_INSTALL_DIR=/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed \
+ LD_LIBRARY_PATH=\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fb303/lib:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/edencommon/lib:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fbthrift/lib:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/wangle/lib:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fizz/lib:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/folly/lib:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/python-six-a_PuBql0-TcavVCS0SYl5gjjcl7jCpIVWAuUaU9OOJM/lib:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fmt-bg_AhaTvmUSRN6k77LQLauT5ePDTpQjkMMS39M_KEls/lib:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/cpptoml-PrUH3exhzbhBwaI2-x5QxVJn9HLAgtOBB-DD97BeIMc/lib:\
+ PATH=\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fbthrift/bin:\
+      /usr/local/sbin:\
+      /usr/local/bin:\
+      /usr/sbin:\
+      /usr/bin:\
+      /sbin:\
+      /bin:\
+      /snap/bin:\
+ PKG_CONFIG_PATH=\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/folly/lib/pkgconfig:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fmt-bg_AhaTvmUSRN6k77LQLauT5ePDTpQjkMMS39M_KEls/lib/pkgconfig:\
+ PYTHONPATH=\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fb303/lib/fb-py-libs/fb303_thrift_py:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fbthrift/lib/fb-py-libs/thrift_py_inspect:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fbthrift/lib/fb-py-libs/thrift_py:\
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/python-six-a_PuBql0-TcavVCS0SYl5gjjcl7jCpIVWAuUaU9OOJM/lib/fb-py-libs/python-six:\
+ SSL_CERT_DIR=/etc/ssl/certs \
+ THRIFT_INCLUDE_PATH=/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fb303/include/thrift-files \
+ cd /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman && \
+ /usr/bin/cmake \
+      /home/sheila/Downloads/watchman \
+      -DCMAKE_INSTALL_PREFIX=/usr/local \
+      -DBUILD_SHARED_LIBS=OFF \
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+      -G \
+      Ninja
-- PACKAGE_VERSION=20221102.224517.0, BUILD_INFO=2911933b5cc68cbb1d1d27adc38fad0f7bdc8efa
-- The CXX compiler identification is GNU 12.2.0
-- The C compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found gmock via config, defines=, include=/usr/include, libs=GTest::gmock_main;GTest::gmock;GTest::gtest
CMake Error at build/fbcode_builder/CMake/RustStaticLibrary.cmake:61 (find_program):
  Could not find CARGO_COMMAND using the following names: cargo
Call Stack (most recent call first):
  CMakeLists.txt:139 (include)

-- Configuring incomplete, errors occurred!
See also "/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman/CMakeFiles/CMakeOutput.log".
Command '['/usr/bin/cmake', '/home/sheila/Downloads/watchman', '-DCMAKE_INSTALL_PREFIX=/usr/local', '-DBUILD_SHARED_LIBS=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-G', 'Ninja']' returned non-zero exit status 1.
!! Failed
CapSap commented 1 year ago

I've also tried to install using the deb on a different machine running ubuntu 22.04 and it worked okay. On the machine where the deb install fails (ubuntu 22.10) a different (newer?) libevent-2.1-7a package is installed and it's conflicting with libevent-2.1-7. Apt-get can't resolve the conflict and neither can I. I'm googling around for a possible solution.

I've also tried building again from v2022.14.00.00 with no luck.

chadaustin commented 1 year ago

I wonder if there's a CMake version discrepancy? Did find_program at one point not search the PATH? What CMake do you have? Given I was unable to reproduce, I'm not sure how much I'll be able to help.

CapSap commented 1 year ago

cmake --version returns

cmake version 3.24.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

and just in case/ to rule things out the ninja version I'm running is 1.11.0.

Just as another note / attempt I've removed rust with rustup self uninstall and reinstalled it. Made sure $PATH was updated/reloaded, before attempting the build.

_RE: Did findprogram at one point not search the PATH? I'm not sure how to find the answer to this question. Could I ask you to point me in the right direction?

I appreciate your time and effort so far. Thank you

Just putting some thoughts out loud to assist my understanding whats going (and please correct me if im wrong) - as part of the build CMake is checking if cargo is on my system and it can't find it so throws an error. It was able to find the other things okay ie c++, c complier. So something wrong around rust/cargo and the find_program command?

I'm looking at CMakeLists.txt and at line 139 is this call: include(RustStaticLibrary) and I was able to find the file at watchman/build/fbcode_builder/CMake/RustStaticLibrary.cmake. Within RustStaticLibrary.cmake I can see the find_program function at line 61 find_program(CARGO_COMMAND cargo REQUIRED) but I have no idea where to look next.

Thanks

CapSap commented 1 year ago

I've just had a thought: here is part taken from the stack trace below the error message

See also "/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman/CMakeFiles/CMakeOutput.log".
Command '['/usr/bin/cmake', '/home/sheila/Downloads/watchman', '-DCMAKE_INSTALL_PREFIX=/usr/local', '-DBUILD_SHARED_LIBS=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-G', 'Ninja']' returned non-zero exit status 1.
!! Failed

could: '-DCMAKE_INSTALL_PREFIX=/usr/local' be an issue?

CapSap commented 1 year ago

So just as a little update; within CMake/RustStaticLibrary.cmake I've added my cargo path to HINTS in find_program find_program(CARGO_COMMAND cargo HINTS "/home/sheila/.cargo/bin" REQUIRED)

and getting a different error when running sudo ./autogen.sh

[59/212] Building pywatchman
/home/sheila/Downloads/watchman/watchman/python/setup.py:14: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.core import Extension, setup
/usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'zip_safe'
  warnings.warn(msg)
/usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
running build
running build_py
creating build/lib.linux-x86_64-3.10
creating build/lib.linux-x86_64-3.10/pywatchman
copying /home/sheila/Downloads/watchman/watchman/python/pywatchman/encoding.py -> build/lib.linux-x86_64-3.10/pywatchman
copying /home/sheila/Downloads/watchman/watchman/python/pywatchman/capabilities.py -> build/lib.linux-x86_64-3.10/pywatchman
copying /home/sheila/Downloads/watchman/watchman/python/pywatchman/load.py -> build/lib.linux-x86_64-3.10/pywatchman
copying /home/sheila/Downloads/watchman/watchman/python/pywatchman/__init__.py -> build/lib.linux-x86_64-3.10/pywatchman
copying /home/sheila/Downloads/watchman/watchman/python/pywatchman/pybser.py -> build/lib.linux-x86_64-3.10/pywatchman
copying /home/sheila/Downloads/watchman/watchman/python/pywatchman/windows.py -> build/lib.linux-x86_64-3.10/pywatchman
running build_ext
building 'pywatchman.bser' extension
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/home
creating build/temp.linux-x86_64-3.10/home/sheila
creating build/temp.linux-x86_64-3.10/home/sheila/Downloads
creating build/temp.linux-x86_64-3.10/home/sheila/Downloads/watchman
creating build/temp.linux-x86_64-3.10/home/sheila/Downloads/watchman/watchman
creating build/temp.linux-x86_64-3.10/home/sheila/Downloads/watchman/watchman/python
creating build/temp.linux-x86_64-3.10/home/sheila/Downloads/watchman/watchman/python/pywatchman
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c /home/sheila/Downloads/watchman/watchman/python/pywatchman/bser.c -o build/temp.linux-x86_64-3.10/home/sheila/Downloads/watchman/watchman/python/pywatchman/bser.o
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c /home/sheila/Downloads/watchman/watchman/python/pywatchman/bsermodule.c -o build/temp.linux-x86_64-3.10/home/sheila/Downloads/watchman/watchman/python/pywatchman/bsermodule.o
x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.10/home/sheila/Downloads/watchman/watchman/python/pywatchman/bser.o build/temp.linux-x86_64-3.10/home/sheila/Downloads/watchman/watchman/python/pywatchman/bsermodule.o -o build/lib.linux-x86_64-3.10/pywatchman/bser.cpython-310-x86_64-linux-gnu.so
running build_scripts
creating build/scripts-3.10
copying and adjusting /home/sheila/Downloads/watchman/watchman/python/bin/watchman-make -> build/scripts-3.10
copying and adjusting /home/sheila/Downloads/watchman/watchman/python/bin/watchman-wait -> build/scripts-3.10
copying and adjusting /home/sheila/Downloads/watchman/watchman/python/bin/watchman-replicate-subscription -> build/scripts-3.10
changing mode of build/scripts-3.10/watchman-make from 644 to 755
changing mode of build/scripts-3.10/watchman-wait from 644 to 755
changing mode of build/scripts-3.10/watchman-replicate-subscription from 644 to 755
[64/212] Building CXX object CMakeFiles/eden_config_thrift.dir/eden/fs/config/gen-cpp2/eden_config_data.cpp.o
/tmp/cccu2q6y.s: Assembler messages:
/tmp/cccu2q6y.s:6: Warning: setting incorrect section attributes for .rodata.thrift.data
[73/212] Building Rust executable 'watchmanctl'...
FAILED: watchman/cli/CMakeFiles/watchmanctl.cargo watchman/cli/debug/watchmanctl watchman/cli/release/watchmanctl /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman/watchman/cli/CMakeFiles/watchmanctl.cargo /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman/watchman/cli/debug/watchmanctl /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman/watchman/cli/release/watchmanctl 
cd /home/sheila/Downloads/watchman/watchman/cli && /usr/bin/cmake -E remove -f /home/sheila/Downloads/watchman/watchman/cli/Cargo.lock && /usr/bin/cmake -E env CARGO_TARGET_DIR=/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman/watchman/cli /home/sheila/.cargo/bin/cargo build --release -p watchmanctl
error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
[77/212] Building CXX object CMakeFiles/eden_config_thrift.dir/eden/fs/config/gen-cpp2/eden_config_types.cpp.o
ninja: build stopped: subcommand failed.
Command '['/usr/bin/cmake', '--build', '/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman', '--target', 'install', '--config', 'Release', '-j', '6']' returned non-zero exit status 1.
!! Failed

I've ran the rustup default stable but there is a toolchain already set stable-x86_64-unknown-linux-gnu unchanged - rustc 1.65.0 (897e37553 2022-11-02)

CapSap commented 1 year ago

I think i've made a mistake running ./autogen.sh with sudo.

I've cloned the repo again and run ./autogen.sh without sudo and this is the result

[2/5] Linking CXX executable bin/watchman
FAILED: bin/watchman 
: && /usr/bin/c++ -g -Wall -Wextra -std=gnu++17 -O2 -g -DNDEBUG  CMakeFiles/watchman.dir/watchman/ChildProcess.cpp.o CMakeFiles/watchman.dir/watchman/Client.cpp.o CMakeFiles/watchman.dir/watchman/Clock.cpp.o CMakeFiles/watchman.dir/watchman/Command.cpp.o CMakeFiles/watchman.dir/watchman/CommandRegistry.cpp.o CMakeFiles/watchman.dir/watchman/Connect.cpp.o CMakeFiles/watchman.dir/watchman/ContentHash.cpp.o CMakeFiles/watchman.dir/watchman/CookieSync.cpp.o CMakeFiles/watchman.dir/watchman/Errors.cpp.o CMakeFiles/watchman.dir/watchman/fs/FileDescriptor.cpp.o CMakeFiles/watchman.dir/watchman/fs/FileInformation.cpp.o CMakeFiles/watchman.dir/watchman/fs/FileSystem.cpp.o CMakeFiles/watchman.dir/watchman/FlagMap.cpp.o CMakeFiles/watchman.dir/watchman/fs/FSDetect.cpp.o CMakeFiles/watchman.dir/watchman/GroupLookup.cpp.o CMakeFiles/watchman.dir/watchman/IgnoreSet.cpp.o CMakeFiles/watchman.dir/watchman/InMemoryView.cpp.o CMakeFiles/watchman.dir/watchman/Options.cpp.o CMakeFiles/watchman.dir/watchman/PDU.cpp.o CMakeFiles/watchman.dir/watchman/PendingCollection.cpp.o CMakeFiles/watchman.dir/watchman/PerfSample.cpp.o CMakeFiles/watchman.dir/watchman/fs/ParallelWalk.cpp.o CMakeFiles/watchman.dir/watchman/fs/Pipe.cpp.o CMakeFiles/watchman.dir/watchman/ProcessLock.cpp.o CMakeFiles/watchman.dir/watchman/QueryableView.cpp.o CMakeFiles/watchman.dir/watchman/SanityCheck.cpp.o CMakeFiles/watchman.dir/watchman/Shutdown.cpp.o CMakeFiles/watchman.dir/watchman/SignalHandler.cpp.o CMakeFiles/watchman.dir/watchman/SymlinkTargets.cpp.o CMakeFiles/watchman.dir/watchman/ThreadPool.cpp.o CMakeFiles/watchman.dir/watchman/TriggerCommand.cpp.o CMakeFiles/watchman.dir/watchman/fs/UnixDirHandle.cpp.o CMakeFiles/watchman.dir/watchman/fs/WindowsTime.cpp.o CMakeFiles/watchman.dir/watchman/UserDir.cpp.o CMakeFiles/watchman.dir/watchman/WatchmanConfig.cpp.o CMakeFiles/watchman.dir/watchman/fs/WinDirHandle.cpp.o CMakeFiles/watchman.dir/watchman/bser.cpp.o CMakeFiles/watchman.dir/watchman/launchd.cpp.o CMakeFiles/watchman.dir/watchman/listener-user.cpp.o CMakeFiles/watchman.dir/watchman/listener.cpp.o CMakeFiles/watchman.dir/watchman/main.cpp.o CMakeFiles/watchman.dir/watchman/sockname.cpp.o CMakeFiles/watchman.dir/watchman/state.cpp.o CMakeFiles/watchman.dir/watchman/stream.cpp.o CMakeFiles/watchman.dir/watchman/stream_unix.cpp.o CMakeFiles/watchman.dir/watchman/stream_stdout.cpp.o CMakeFiles/watchman.dir/watchman/stream_win.cpp.o CMakeFiles/watchman.dir/watchman/portability/PosixSpawn.cpp.o CMakeFiles/watchman.dir/watchman/portability/WinError.cpp.o CMakeFiles/watchman.dir/watchman/query/FileResult.cpp.o CMakeFiles/watchman.dir/watchman/query/LocalFileResult.cpp.o CMakeFiles/watchman.dir/watchman/query/GlobEscaping.cpp.o CMakeFiles/watchman.dir/watchman/query/GlobTree.cpp.o CMakeFiles/watchman.dir/watchman/query/QueryContext.cpp.o CMakeFiles/watchman.dir/watchman/query/Query.cpp.o CMakeFiles/watchman.dir/watchman/query/QueryResult.cpp.o CMakeFiles/watchman.dir/watchman/query/TermRegistry.cpp.o CMakeFiles/watchman.dir/watchman/query/base.cpp.o CMakeFiles/watchman.dir/watchman/query/dirname.cpp.o CMakeFiles/watchman.dir/watchman/query/empty.cpp.o CMakeFiles/watchman.dir/watchman/query/eval.cpp.o CMakeFiles/watchman.dir/watchman/query/fieldlist.cpp.o CMakeFiles/watchman.dir/watchman/query/glob.cpp.o CMakeFiles/watchman.dir/watchman/query/intcompare.cpp.o CMakeFiles/watchman.dir/watchman/query/match.cpp.o CMakeFiles/watchman.dir/watchman/query/name.cpp.o CMakeFiles/watchman.dir/watchman/query/parse.cpp.o CMakeFiles/watchman.dir/watchman/query/pcre.cpp.o CMakeFiles/watchman.dir/watchman/query/since.cpp.o CMakeFiles/watchman.dir/watchman/query/suffix.cpp.o CMakeFiles/watchman.dir/watchman/query/type.cpp.o CMakeFiles/watchman.dir/watchman/cmds/debug.cpp.o CMakeFiles/watchman.dir/watchman/cmds/find.cpp.o CMakeFiles/watchman.dir/watchman/cmds/info.cpp.o CMakeFiles/watchman.dir/watchman/cmds/log.cpp.o CMakeFiles/watchman.dir/watchman/cmds/query.cpp.o CMakeFiles/watchman.dir/watchman/cmds/since.cpp.o CMakeFiles/watchman.dir/watchman/cmds/state.cpp.o CMakeFiles/watchman.dir/watchman/cmds/subscribe.cpp.o CMakeFiles/watchman.dir/watchman/cmds/trigger.cpp.o CMakeFiles/watchman.dir/watchman/cmds/watch.cpp.o CMakeFiles/watchman.dir/watchman/root/ageout.cpp.o CMakeFiles/watchman.dir/watchman/root/dir.cpp.o CMakeFiles/watchman.dir/watchman/root/file.cpp.o CMakeFiles/watchman.dir/watchman/root/init.cpp.o CMakeFiles/watchman.dir/watchman/root/iothread.cpp.o CMakeFiles/watchman.dir/watchman/root/notifythread.cpp.o CMakeFiles/watchman.dir/watchman/root/reap.cpp.o CMakeFiles/watchman.dir/watchman/root/resolve.cpp.o CMakeFiles/watchman.dir/watchman/root/sync.cpp.o CMakeFiles/watchman.dir/watchman/root/threading.cpp.o CMakeFiles/watchman.dir/watchman/root/watchlist.cpp.o CMakeFiles/watchman.dir/watchman/saved_state/LocalSavedStateInterface.cpp.o CMakeFiles/watchman.dir/watchman/saved_state/SavedStateFactory.cpp.o CMakeFiles/watchman.dir/watchman/saved_state/SavedStateInterface.cpp.o CMakeFiles/watchman.dir/watchman/scm/Git.cpp.o CMakeFiles/watchman.dir/watchman/scm/Mercurial.cpp.o CMakeFiles/watchman.dir/watchman/scm/SCM.cpp.o CMakeFiles/watchman.dir/watchman/thirdparty/getopt/GetOpt.cpp.o CMakeFiles/watchman.dir/watchman/watcher/Watcher.cpp.o CMakeFiles/watchman.dir/watchman/watcher/WatcherRegistry.cpp.o CMakeFiles/watchman.dir/watchman/watcher/fsevents.cpp.o CMakeFiles/watchman.dir/watchman/watcher/inotify.cpp.o CMakeFiles/watchman.dir/watchman/watcher/kqueue.cpp.o CMakeFiles/watchman.dir/watchman/watcher/portfs.cpp.o CMakeFiles/watchman.dir/watchman/watcher/kqueue_and_fsevents.cpp.o CMakeFiles/watchman.dir/watchman/watcher/win32.cpp.o CMakeFiles/watchman.dir/watchman/watcher/eden.cpp.o -o bin/watchman  liblog.a  libstring.a  liberr.a  libjansson.a  libwildmatch.a  libstreamingeden_thrift.a  libstring.a  libjansson_utf.a  /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.2  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/edencommon/lib/libedencommon_utils.a  /usr/lib/x86_64-linux-gnu/libglog.so  /usr/lib/x86_64-linux-gnu/libpcre2-8.so  /usr/lib/x86_64-linux-gnu/libcrypto.so  libeden_service_thrift.a  libeden_config_thrift.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fb303/lib/libfb303_thrift_cpp.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthriftcpp2.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthriftfrozen2.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthriftmetadata.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthriftprotocol.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthriftprotocol.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libasync.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libtransport.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/librpcmetadata.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libconcurrency.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/wangle/lib/libwangle.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fizz/lib/libfizz.a  /usr/lib/x86_64-linux-gnu/libz.so  /usr/lib/x86_64-linux-gnu/libsodium.so  /usr/lib/x86_64-linux-gnu/librt.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthrift-core.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthriftanyrep.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthrifttype.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthrifttyperep.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fbthrift/lib/libthriftannotation.a  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/folly/lib/libfolly.a  /usr/lib/x86_64-linux-gnu/libboost_context.so.1.74.0  /usr/lib/x86_64-linux-gnu/libboost_filesystem.a  /usr/lib/x86_64-linux-gnu/libboost_program_options.a  /usr/lib/x86_64-linux-gnu/libboost_regex.a  /usr/lib/x86_64-linux-gnu/libboost_system.a  /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.74.0  /usr/lib/x86_64-linux-gnu/libboost_atomic.so.1.74.0  /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/fmt-3M3G-Ty1dgjK63gAhyAwywxd44o5BBu6q5tFsTj0qcE/lib/libfmt.a  /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.2  -lpthread  /usr/lib/x86_64-linux-gnu/libdouble-conversion.so  /usr/lib/x86_64-linux-gnu/libglog.so  /usr/lib/x86_64-linux-gnu/libevent.so  /usr/lib/x86_64-linux-gnu/libz.so  /usr/lib/x86_64-linux-gnu/libssl.so  /usr/lib/x86_64-linux-gnu/libcrypto.so  /usr/lib/x86_64-linux-gnu/libbz2.so  /usr/lib/x86_64-linux-gnu/liblzma.so  /usr/lib/x86_64-linux-gnu/liblz4.so  /usr/lib/x86_64-linux-gnu/libzstd.so  /usr/lib/x86_64-linux-gnu/libsnappy.so  /usr/lib/x86_64-linux-gnu/libsodium.so  -ldl  /usr/lib/x86_64-linux-gnu/libunwind.so && :
/usr/bin/ld: /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/installed/folly/lib/libfolly.a(Compression.cpp.o):(.data.rel.ro+0x58): undefined reference to `typeinfo for snappy::Source'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Command '['/usr/bin/cmake', '--build', '/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder/build/watchman', '--target', 'install', '--config', 'Release', '-j', '7']' returned non-zero exit status 1.
!! Failed

update: I think these 2 issues are related to this error https://github.com/mhx/dwarfs/issues/56 https://github.com/facebook/proxygen/issues/361 https://github.com/facebook/folly/issues/1606

arnolanglade commented 1 year ago

I can't install it, I got this error whenI try to install thanks to the source

/tmp/fbcode_builder_getdeps-ZhomeZarnaud-proZDownloadsZwatchmanZbuildZfbcode_builder/installed/fb303/include/fb303/thrift/gen-cpp2/BaseServiceAsyncClient.h:1557:7: note: declared here
 1557 | using BaseServiceAsyncClient [[deprecated("Use apache::thrift::Client<BaseService> instead")]] = ::apache::thrift::Client<BaseService>;
      |       ^~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
Command '['/usr/bin/cmake', '--build', '/tmp/fbcode_builder_getdeps-ZhomeZarnaud-proZDownloadsZwatchmanZbuildZfbcode_builder/build/watchman', '--target', 'install', '--config', 'Release', '-j', '3']' returned non-zero exit status 1.
!! Failed

and I got this error whenI try to install thanks to package.

dpkg: warning: while removing watchman, directory '/usr/local' not empty so not removed
arnolanglade commented 1 year ago

I found a workaround! I install it with brew.

fanzeyi commented 1 year ago

@CapSap Looking at the thread you are right it is the sudo causing PATH issue for you. It's likely that sudo did not inherit environment variable from your current session so it won't see your PATH setting in your $HOME/.bashrc. You will need to either run ./autogen.sh without sudo or install cargo globally where it exists in your root user's PATH.

I'll close this issue.