├── .gitattributes ├── .github └── workflows │ ├── generate-release-yml.rs │ ├── getdeps_linux.yml │ ├── getdeps_mac.yml │ ├── getdeps_windows.yml │ ├── package.yml │ ├── release.yml │ └── release.yml.in ├── .gitignore ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.markdown ├── autogen.cmd ├── autogen.sh ├── build ├── deps │ └── github_hashes │ │ ├── facebook │ │ ├── fb303-rev.txt │ │ ├── fbthrift-rev.txt │ │ ├── folly-rev.txt │ │ ├── mvfst-rev.txt │ │ └── wangle-rev.txt │ │ ├── facebookexperimental │ │ └── edencommon-rev.txt │ │ └── facebookincubator │ │ └── fizz-rev.txt └── fbcode_builder │ ├── .gitignore │ ├── CMake │ ├── FBBuildOptions.cmake │ ├── FBCMakeParseArgs.cmake │ ├── FBCompilerSettings.cmake │ ├── FBCompilerSettingsMSVC.cmake │ ├── FBCompilerSettingsUnix.cmake │ ├── FBPythonBinary.cmake │ ├── FBPythonTestAddTests.cmake │ ├── FBThriftCppLibrary.cmake │ ├── FBThriftLibrary.cmake │ ├── FBThriftPyLibrary.cmake │ ├── FindDoubleConversion.cmake │ ├── FindGMock.cmake │ ├── FindGflags.cmake │ ├── FindGlog.cmake │ ├── FindLMDB.cmake │ ├── FindLibEvent.cmake │ ├── FindLibUnwind.cmake │ ├── FindPCRE.cmake │ ├── FindPCRE2.cmake │ ├── FindRe2.cmake │ ├── FindSodium.cmake │ ├── FindXxhash.cmake │ ├── FindZstd.cmake │ ├── RustStaticLibrary.cmake │ ├── fb_py_test_main.py │ ├── fb_py_win_main.c │ └── make_fbpy_archive.py │ ├── LICENSE │ ├── README.md │ ├── getdeps.py │ ├── getdeps │ ├── __init__.py │ ├── builder.py │ ├── buildopts.py │ ├── cache.py │ ├── cargo.py │ ├── copytree.py │ ├── dyndeps.py │ ├── envfuncs.py │ ├── errors.py │ ├── expr.py │ ├── fetcher.py │ ├── load.py │ ├── manifest.py │ ├── platform.py │ ├── py_wheel_builder.py │ ├── runcmd.py │ ├── subcmd.py │ └── test │ │ ├── expr_test.py │ │ ├── fixtures │ │ └── duplicate │ │ │ ├── foo │ │ │ └── subdir │ │ │ └── foo │ │ ├── manifest_test.py │ │ ├── platform_test.py │ │ ├── retry_test.py │ │ └── scratch_test.py │ ├── manifests │ ├── CLI11 │ ├── autoconf │ ├── automake │ ├── benchmark │ ├── blake3 │ ├── boost │ ├── bz2 │ ├── cabal │ ├── cachelib │ ├── clang │ ├── cmake │ ├── cpptoml │ ├── double-conversion │ ├── eden │ ├── edencommon │ ├── exprtk │ ├── fast_float │ ├── fatal │ ├── fb303 │ ├── fboss │ ├── fbthrift │ ├── fizz │ ├── fmt │ ├── folly │ ├── gflags │ ├── ghc │ ├── git-lfs │ ├── glean │ ├── glog │ ├── googletest │ ├── gperf │ ├── hexdump │ ├── hsthrift │ ├── iproute2 │ ├── jom │ ├── jq │ ├── katran │ ├── libaio │ ├── libbpf │ ├── libcurl │ ├── libdwarf │ ├── libelf │ ├── libevent │ ├── libffi │ ├── libgit2 │ ├── libgpiod │ ├── libiberty │ ├── libmnl │ ├── libnl │ ├── liboqs │ ├── libsai │ ├── libsodium │ ├── libtool │ ├── libunwind │ ├── libusb │ ├── libyaml │ ├── llvm │ ├── lmdb │ ├── lz4 │ ├── mcrouter │ ├── mononoke │ ├── mononoke_integration │ ├── mvfst │ ├── ncurses │ ├── nghttp2 │ ├── ninja │ ├── nlohmann-json │ ├── nmap │ ├── numa │ ├── openr │ ├── openssl │ ├── osxfuse │ ├── patchelf │ ├── pcre2 │ ├── perl │ ├── pexpect │ ├── proxygen │ ├── python │ ├── python-click │ ├── python-filelock │ ├── python-ptyprocess │ ├── python-setuptools │ ├── python-six │ ├── python-toml │ ├── ragel │ ├── range-v3 │ ├── re2 │ ├── ripgrep │ ├── rocksdb │ ├── rust-shed │ ├── sapling │ ├── snappy │ ├── sparsemap │ ├── sqlite3 │ ├── systemd │ ├── tree │ ├── wangle │ ├── watchman │ ├── xxhash │ ├── xz │ ├── yaml-cpp │ ├── zlib │ └── zstd │ └── patches │ ├── boost_comparator_operator_fix.patch │ ├── iproute2_oss.patch │ ├── libiberty_install_pic_lib.patch │ └── zlib_dont_build_more_than_needed.patch ├── clippy.toml ├── eden └── fs │ ├── config │ └── eden_config.thrift │ ├── inodes │ └── overlay │ │ └── overlay.thrift │ ├── service │ ├── eden.thrift │ └── streamingeden.thrift │ └── takeover │ └── takeover.thrift ├── install-system-packages.sh ├── run-tests.sh ├── rustfmt.toml ├── watchman ├── .clang-format ├── .clang-tidy ├── .projectid ├── ChildProcess.cpp ├── ChildProcess.h ├── Client.cpp ├── Client.h ├── ClientContext.h ├── Clock.cpp ├── Clock.h ├── Command.cpp ├── Command.h ├── CommandRegistry.cpp ├── CommandRegistry.h ├── Connect.cpp ├── Connect.h ├── Constants.h ├── ContentHash.cpp ├── ContentHash.h ├── Cookie.h ├── CookieSync.cpp ├── CookieSync.h ├── Errors.cpp ├── Errors.h ├── FlagMap.cpp ├── FlagMap.h ├── GroupLookup.cpp ├── GroupLookup.h ├── Hash.h ├── IgnoreSet.cpp ├── IgnoreSet.h ├── InMemoryView.cpp ├── InMemoryView.h ├── LRUCache.h ├── LogConfig.cpp ├── LogConfig.h ├── Logging.cpp ├── Logging.h ├── MapUtil.h ├── Options.cpp ├── Options.h ├── PDU.cpp ├── PDU.h ├── PendingCollection.cpp ├── PendingCollection.h ├── PerfSample.cpp ├── PerfSample.h ├── Poison.cpp ├── Poison.h ├── ProcessLock.cpp ├── ProcessLock.h ├── ProcessUtil.cpp ├── ProcessUtil.h ├── PubSub.cpp ├── PubSub.h ├── QueryableView.cpp ├── QueryableView.h ├── Result.h ├── RingBuffer.h ├── SanityCheck.cpp ├── SanityCheck.h ├── Serde.h ├── Shutdown.cpp ├── Shutdown.h ├── SignalHandler.cpp ├── SignalHandler.h ├── SymlinkTargets.cpp ├── SymlinkTargets.h ├── ThreadPool.cpp ├── ThreadPool.h ├── TriggerCommand.cpp ├── TriggerCommand.h ├── UserDir.cpp ├── UserDir.h ├── WatchmanConfig.cpp ├── WatchmanConfig.h ├── XattrUtils.cpp ├── XattrUtils.h ├── benchmarks │ ├── bser.cpp │ └── string.cpp ├── bser.cpp ├── bser.h ├── build │ ├── package │ │ ├── fedora-env │ │ │ └── Dockerfile │ │ ├── make-deb.sh │ │ ├── make-packages.sh │ │ ├── make-rpm.sh │ │ ├── substcontrol.py │ │ ├── ubuntu-env │ │ │ └── Dockerfile │ │ ├── watchman-build │ │ │ └── Dockerfile │ │ ├── watchman-deb │ │ │ ├── DEBIAN │ │ │ │ ├── control │ │ │ │ └── postinst │ │ │ ├── Dockerfile │ │ │ └── make-deb.sh │ │ └── watchman.spec │ └── vagrant │ │ ├── .gitignore │ │ ├── README.md │ │ └── Vagrantfile ├── cli │ ├── CMakeLists.txt │ ├── Cargo.toml │ └── src │ │ ├── audit.rs │ │ ├── main.rs │ │ └── rage │ │ ├── mod.rs │ │ └── stream.rs ├── cmds │ ├── debug.cpp │ ├── find.cpp │ ├── heapprof.cpp │ ├── info.cpp │ ├── log.cpp │ ├── query.cpp │ ├── since.cpp │ ├── state.cpp │ ├── subscribe.cpp │ ├── trigger.cpp │ └── watch.cpp ├── cppclient │ ├── CLI.cpp │ ├── WatchmanClient.cpp │ ├── WatchmanClient.h │ ├── WatchmanConnection.cpp │ ├── WatchmanConnection.h │ ├── WatchmanResponseError.cpp │ └── watchmanclient.pc.in ├── docs │ └── sync.md ├── facebook │ ├── BUCK │ └── saved_state │ │ └── BUCK ├── fs │ ├── DirHandle.h │ ├── FSDetect.cpp │ ├── FSDetect.h │ ├── FileDescriptor.cpp │ ├── FileDescriptor.h │ ├── FileInformation.cpp │ ├── FileInformation.h │ ├── FileSystem.cpp │ ├── FileSystem.h │ ├── ParallelWalk.cpp │ ├── ParallelWalk.h │ ├── ParallelWalkMain.cpp │ ├── Pipe.cpp │ ├── Pipe.h │ ├── UnixDirHandle.cpp │ ├── WinDirHandle.cpp │ ├── WindowsTime.cpp │ └── WindowsTime.h ├── fuzz │ ├── BserDecode.cpp │ ├── JsonDecode.cpp │ └── PyBserDecode.cpp ├── integration │ ├── BUCK │ ├── CMakeLists.txt │ ├── __init__.py │ ├── capabilities.js │ ├── case.js │ ├── cat.py │ ├── cppclient.cpp │ ├── eden │ │ ├── BUCK │ │ ├── test_eden_glob_upper_bound.py │ │ ├── test_eden_journal.py │ │ ├── test_eden_pathgen.py │ │ ├── test_eden_query.py │ │ ├── test_eden_scm.py │ │ ├── test_eden_sha1.py │ │ ├── test_eden_shutdown.py │ │ ├── test_eden_since.py │ │ ├── test_eden_subscribe.py │ │ ├── test_eden_suffix.py │ │ ├── test_eden_takeover.py │ │ ├── test_eden_unmount.py │ │ ├── test_eden_watch_parent.py │ │ └── test_eden_watch_root.py │ ├── facebook │ │ └── BUCK │ ├── lib │ │ ├── BUCK │ │ ├── Interrupt.py │ │ ├── TempDir.py │ │ ├── WatchmanEdenTestCase.py │ │ ├── WatchmanInstance.py │ │ ├── WatchmanSCMTestCase.py │ │ ├── WatchmanTestCase.py │ │ ├── __init__.py │ │ ├── node.py │ │ └── path_utils.py │ ├── node_basic.js │ ├── site_spawn.py │ ├── site_spawn_fail.py │ ├── test_absroot.py │ ├── test_age_file.py │ ├── test_age_watch.py │ ├── test_auth.py │ ├── test_big.py │ ├── test_big_file.py │ ├── test_bsdish.py │ ├── test_bser_cli.py │ ├── test_bulkstat.py │ ├── test_capabilities.py │ ├── test_case_sensitive.py │ ├── test_clock.py │ ├── test_command.py │ ├── test_content_hash.py │ ├── test_cookie.py │ ├── test_cppclient.py │ ├── test_cursor.py │ ├── test_dir_move.py │ ├── test_dirname.py │ ├── test_empty.py │ ├── test_fields.py │ ├── test_find.py │ ├── test_fishy.py │ ├── test_force_recrawl.py │ ├── test_fork.py │ ├── test_fsevents_resync.py │ ├── test_fstype.py │ ├── test_glob.py │ ├── test_ignore.py │ ├── test_info.py │ ├── test_invalid_expr.py │ ├── test_invalid_watchmanconfig.py │ ├── test_kqueue_and_fsevents_recrawl.py │ ├── test_local_saved_state.py │ ├── test_log.py │ ├── test_match.py │ ├── test_name.py │ ├── test_nice.py │ ├── test_nodejs.py │ ├── test_path_generator.py │ ├── test_pcre.py │ ├── test_perms.py │ ├── test_remove.py │ ├── test_remove_then_add.py │ ├── test_request_id.py │ ├── test_restrictions.py │ ├── test_saved_state.py │ ├── test_scm.py │ ├── test_since.py │ ├── test_since_term.py │ ├── test_site_spawn.py │ ├── test_size.py │ ├── test_sock_perms.py │ ├── test_subscribe.py │ ├── test_suffix.py │ ├── test_suffix_generator.py │ ├── test_trigger.py │ ├── test_trigger_chdir.py │ ├── test_trigger_error.py │ ├── test_two_deep.py │ ├── test_type.py │ ├── test_watch_del_all.py │ ├── test_watch_project.py │ ├── test_wm_wait.py │ ├── touch.py │ ├── trig-cwd.py │ ├── trig.py │ └── trigjson.py ├── java │ ├── .buckconfig │ ├── .gitignore │ ├── .nobuckcheck │ ├── BUCK │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ ├── sandcastle.ini │ ├── src │ │ └── com │ │ │ └── facebook │ │ │ └── watchman │ │ │ ├── Callback.java │ │ │ ├── CapabilitiesStrategy.java │ │ │ ├── Deserializer.java │ │ │ ├── WatchmanClient.java │ │ │ ├── WatchmanClientImpl.java │ │ │ ├── WatchmanConnection.java │ │ │ ├── WatchmanException.java │ │ │ ├── WatchmanTransport.java │ │ │ ├── WatchmanTransportBuilder.java │ │ │ ├── WatchmanTransportUnavailableException.java │ │ │ ├── bser │ │ │ ├── BserConstants.java │ │ │ ├── BserDeserializer.java │ │ │ └── BserSerializer.java │ │ │ ├── environment │ │ │ ├── ExecutableFinder.java │ │ │ └── FileFinder.java │ │ │ ├── unixsocket │ │ │ ├── ReferenceCountedFileDescriptor.java │ │ │ ├── UnixDomainSocket.java │ │ │ └── UnixDomainSocketLibrary.java │ │ │ └── windowspipe │ │ │ ├── WindowsNamedPipe.java │ │ │ └── WindowsNamedPipeLibrary.java │ ├── test │ │ └── com │ │ │ └── facebook │ │ │ └── watchman │ │ │ ├── CapabilitiesTest.java │ │ │ ├── WatchmanClientTest.java │ │ │ ├── WatchmanConnectionTest.java │ │ │ ├── WatchmanTestBase.java │ │ │ ├── bser │ │ │ ├── BserDeserializerTest.java │ │ │ └── BserSerializerTest.java │ │ │ ├── environment │ │ │ ├── ExecutableFinderTest.java │ │ │ └── FileFinderTest.java │ │ │ ├── fakes │ │ │ └── FakeWatchmanClient.java │ │ │ └── util │ │ │ └── TemporaryPaths.java │ └── third-party │ │ ├── guava │ │ ├── BUCK │ │ └── README │ │ ├── hamcrest │ │ ├── BUCK │ │ └── README │ │ ├── immutables │ │ ├── BUCK │ │ └── README │ │ ├── jna │ │ ├── BUCK │ │ └── README │ │ ├── jsr-305 │ │ ├── BUCK │ │ └── README │ │ ├── junit │ │ ├── BUCK │ │ └── README │ │ ├── mockito │ │ ├── BUCK │ │ └── README │ │ ├── nuprocess │ │ ├── BUCK │ │ └── README │ │ └── objenesis │ │ ├── BUCK │ │ └── README ├── listener-user.cpp ├── listener.cpp ├── listener.h ├── main.cpp ├── node │ ├── .flowconfig │ ├── README.md │ ├── bser │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── index.js │ │ ├── package.json │ │ ├── test │ │ │ └── bser.js │ │ ├── test_bser.py │ │ └── yarn.lock │ ├── example.js │ ├── index.js │ ├── package.json │ └── yarn.lock ├── portability │ ├── Backtrace.cpp │ ├── Backtrace.h │ ├── GetOpt.h │ ├── PosixSpawn.cpp │ ├── PosixSpawn.h │ ├── WinError.cpp │ └── WinError.h ├── python │ ├── .gitignore │ ├── CMakeLists.txt │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.md │ ├── bin │ │ ├── watchman-diag │ │ ├── watchman-make │ │ ├── watchman-replicate-subscription │ │ ├── watchman-wait │ │ └── watchman-wait-aio │ ├── publish-pypi.sh │ ├── pyproject.toml │ ├── pywatchman │ │ ├── CMakeLists.txt │ │ ├── __init__.py │ │ ├── bser.c │ │ ├── bser.h │ │ ├── bsermodule.c │ │ ├── capabilities.py │ │ ├── encoding.py │ │ ├── load.py │ │ ├── pybser.py │ │ └── windows.py │ ├── pywatchman_aio │ │ └── __init__.py │ ├── setup.py │ └── tests │ │ ├── __init__.py │ │ └── tests.py ├── query │ ├── FileResult.cpp │ ├── FileResult.h │ ├── GlobEscaping.cpp │ ├── GlobEscaping.h │ ├── GlobTree.cpp │ ├── GlobTree.h │ ├── LocalFileResult.cpp │ ├── LocalFileResult.h │ ├── Query.cpp │ ├── Query.h │ ├── QueryContext.cpp │ ├── QueryContext.h │ ├── QueryExpr.h │ ├── QueryResult.cpp │ ├── QueryResult.h │ ├── TermRegistry.cpp │ ├── TermRegistry.h │ ├── base.cpp │ ├── dirname.cpp │ ├── empty.cpp │ ├── eval.cpp │ ├── eval.h │ ├── fieldlist.cpp │ ├── glob.cpp │ ├── intcompare.cpp │ ├── intcompare.h │ ├── match.cpp │ ├── name.cpp │ ├── parse.cpp │ ├── parse.h │ ├── pcre.cpp │ ├── since.cpp │ ├── suffix.cpp │ └── type.cpp ├── root │ ├── Root.h │ ├── ageout.cpp │ ├── dir.cpp │ ├── file.cpp │ ├── init.cpp │ ├── iothread.cpp │ ├── notifythread.cpp │ ├── reap.cpp │ ├── resolve.cpp │ ├── resolve.h │ ├── sync.cpp │ ├── test │ │ └── RootTest.cpp │ ├── threading.cpp │ ├── warnerr.cpp │ ├── warnerr.h │ ├── watchlist.cpp │ └── watchlist.h ├── ruby │ └── ruby-watchman │ │ ├── .gitignore │ │ ├── .rspec │ │ ├── Gemfile │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── Rakefile │ │ ├── ext │ │ └── ruby-watchman │ │ │ ├── depend │ │ │ ├── extconf.rb │ │ │ └── watchman.c │ │ ├── lib │ │ ├── ruby-watchman.rb │ │ └── ruby-watchman │ │ │ └── version.rb │ │ ├── ruby-watchman.gemspec │ │ └── spec │ │ ├── ruby_watchman_spec.rb │ │ └── spec_helper.rb ├── runtests.py ├── rust │ ├── .gitignore │ ├── serde_bser │ │ ├── BUCK │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── README.md │ │ └── src │ │ │ ├── bytestring.rs │ │ │ ├── de │ │ │ ├── bunser.rs │ │ │ ├── map.rs │ │ │ ├── mod.rs │ │ │ ├── read.rs │ │ │ ├── reentrant.rs │ │ │ ├── seq.rs │ │ │ ├── template.rs │ │ │ ├── test.rs │ │ │ └── variant.rs │ │ │ ├── errors.rs │ │ │ ├── header.rs │ │ │ ├── lib.rs │ │ │ ├── ser │ │ │ ├── count_write.rs │ │ │ ├── mod.rs │ │ │ └── test.rs │ │ │ └── value.rs │ └── watchman_client │ │ ├── BUCK │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── examples │ │ ├── glob.rs │ │ ├── since.rs │ │ ├── state.rs │ │ ├── subscribe.rs │ │ └── trigger.rs │ │ └── src │ │ ├── expr.rs │ │ ├── fields.rs │ │ ├── lib.rs │ │ ├── named_pipe.rs │ │ └── pdu.rs ├── saved_state │ ├── LocalSavedStateInterface.cpp │ ├── LocalSavedStateInterface.h │ ├── SavedStateFactory.cpp │ ├── SavedStateFactory.h │ ├── SavedStateInterface.cpp │ └── SavedStateInterface.h ├── scm │ ├── Git.cpp │ ├── Git.h │ ├── Mercurial.cpp │ ├── Mercurial.h │ ├── SCM.cpp │ └── SCM.h ├── sockname.cpp ├── sockname.h ├── state.cpp ├── state.h ├── stream.cpp ├── stream_stdout.cpp ├── stream_unix.cpp ├── stream_win.cpp ├── string.cpp ├── telemetry │ ├── LogEvent.cpp │ ├── LogEvent.h │ ├── WatchmanStats.cpp │ ├── WatchmanStats.h │ ├── WatchmanStructuredLogger.cpp │ └── WatchmanStructuredLogger.h ├── test │ ├── ArtTest.cpp │ ├── BserTest.cpp │ ├── CacheTest.cpp │ ├── ChildProcTest.cpp │ ├── FSDetectTest.cpp │ ├── FailsToStartViewTest.cpp │ ├── GlobUpperBoundTest.cpp │ ├── IgnoreTest.cpp │ ├── InMemoryViewTest.cpp │ ├── JsonBenchmark.cpp │ ├── JsonTest.cpp │ ├── LocalSavedStateInterfaceTest.cpp │ ├── LogTest.cpp │ ├── MapUtilTest.cpp │ ├── MercurialTest.cpp │ ├── PendingCollectionTest.cpp │ ├── PerfSampleTest.cpp │ ├── ResultTest.cpp │ ├── ReturnOnlyFilesTest.cpp │ ├── RingBufferTest.cpp │ ├── SerdeTest.cpp │ ├── StringTest.cpp │ ├── SuffixQueryTest.cpp │ ├── WildmatchTest.cpp │ ├── WildmatchTest.json │ ├── async │ │ ├── AsyncWatchmanTestCase.py │ │ ├── test_dead_socket.py │ │ └── test_subscribe_async.py │ ├── lib │ │ ├── FakeFileSystem.cpp │ │ ├── FakeFileSystem.h │ │ ├── FakeFileSystemTest.cpp │ │ ├── FakeWatcher.cpp │ │ └── FakeWatcher.h │ └── run.sh ├── thirdparty │ ├── deelevate_binding │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── Cargo.toml │ │ ├── include │ │ │ └── deelevate.h │ │ └── src │ │ │ └── lib.rs │ ├── getopt │ │ ├── GetOpt.cpp │ │ └── GetOpt.h │ ├── jansson │ │ ├── dump.cpp │ │ ├── error.cpp │ │ ├── jansson.h │ │ ├── jansson_private.h │ │ ├── load.cpp │ │ ├── strconv.cpp │ │ ├── utf.cpp │ │ ├── utf.h │ │ └── value.cpp │ ├── libart │ │ ├── LICENSE │ │ ├── README.md │ │ ├── src │ │ │ ├── art-inl.h │ │ │ └── art.h │ │ └── tests │ │ │ ├── runner.c │ │ │ ├── uuid.txt │ │ │ └── words.txt │ └── wildmatch │ │ ├── .dir-locals.el │ │ ├── wildmatch.c │ │ └── wildmatch.h ├── watcher │ ├── Watcher.cpp │ ├── Watcher.h │ ├── WatcherRegistry.cpp │ ├── WatcherRegistry.h │ ├── eden.cpp │ ├── fsevents.cpp │ ├── fsevents.h │ ├── inotify.cpp │ ├── kqueue.cpp │ ├── kqueue.h │ ├── kqueue_and_fsevents.cpp │ ├── portfs.cpp │ └── win32.cpp ├── watchman_cmd.h ├── watchman_dir.h ├── watchman_file.h ├── watchman_preprocessor.h ├── watchman_stream.h ├── watchman_string.h ├── watchman_system.h ├── watchman_time.h └── winbuild │ └── susres.cpp └── website ├── .eslintrc.js ├── .gitignore ├── .npmrc ├── .prettierignore ├── .prettierrc ├── .stylelintrc.js ├── README.md ├── babel.config.js ├── docs ├── bser.md ├── capabilities.md ├── casefolding.md ├── cli-options.md ├── clockspec.md ├── cmd │ ├── _category_.json │ ├── clock.md │ ├── find.md │ ├── flush-subscriptions.md │ ├── get-config.md │ ├── get-sockname.md │ ├── list-capabilities.md │ ├── log-level.md │ ├── log.md │ ├── query.md │ ├── shutdown-server.md │ ├── since.md │ ├── state-enter.md │ ├── state-leave.md │ ├── subscribe.md │ ├── trigger-del.md │ ├── trigger-list.md │ ├── trigger.md │ ├── unsubscribe.md │ ├── version.md │ ├── watch-del-all.md │ ├── watch-del.md │ ├── watch-list.md │ ├── watch-project.md │ └── watch.md ├── compatibility.md ├── config.md ├── contributing.md ├── cookies.md ├── cppclient.md ├── expr │ ├── _category_.json │ ├── allof.md │ ├── anyof.md │ ├── dirname.md │ ├── empty.md │ ├── exists.md │ ├── false.md │ ├── match.md │ ├── name.md │ ├── not.md │ ├── pcre.md │ ├── since.md │ ├── size.md │ ├── suffix.md │ ├── true.md │ └── type.md ├── file-query.md ├── install.md ├── nodejs.md ├── release-notes.md ├── scm-query.md ├── simple-query.md ├── socket-interface.md ├── troubleshooting.md ├── watchman-make.md ├── watchman-replicate-subscription.md └── watchman-wait.md ├── docusaurus.config.js ├── package.json ├── sidebars.js ├── src ├── css │ └── custom.css └── pages │ ├── index.js │ ├── index.module.css │ ├── styles.module.css │ └── support.md ├── static ├── .nojekyll └── img │ ├── favicon.png │ ├── logo.png │ ├── meta_opensource_logo.svg │ ├── meta_opensource_logo_negative.svg │ └── watchman-social-card.png └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | *.png binary 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Meta Platforms, Inc. and its affiliates. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /autogen.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | python3 build/fbcode_builder/getdeps.py build --src-dir=. watchman "--project-install-prefix=watchman:%userprofile%" --scratch-path "C:\open\scratch" 4 | 5 | python3 build/fbcode_builder/getdeps.py fixup-dyn-deps --src-dir=. watchman built "--project-install-prefix=watchman:%userprofile%" --final-install-prefix "%userprofile%" --scratch-path "C:\open\scratch" -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # vim:ts=2:sw=2:et: 3 | # Copyright (c) Meta Platforms, Inc. and affiliates. 4 | # 5 | # This source code is licensed under the MIT license found in the 6 | # LICENSE file in the root directory of this source tree. 7 | 8 | cd "$(dirname "$0")" 9 | 10 | set -x 11 | PREFIX=${PREFIX:-/usr/local} 12 | python3 build/fbcode_builder/getdeps.py build \ 13 | --allow-system-packages \ 14 | --src-dir=. \ 15 | "--project-install-prefix=watchman:$PREFIX" \ 16 | watchman 17 | python3 build/fbcode_builder/getdeps.py fixup-dyn-deps \ 18 | --allow-system-packages \ 19 | --src-dir=. \ 20 | "--project-install-prefix=watchman:$PREFIX" \ 21 | --final-install-prefix "$PREFIX" \ 22 | watchman built 23 | 24 | find built -ls 25 | -------------------------------------------------------------------------------- /build/deps/github_hashes/facebook/fb303-rev.txt: -------------------------------------------------------------------------------- 1 | Subproject commit 92a9d914d4de9958de067b54ff1170e52e4482ca 2 | -------------------------------------------------------------------------------- /build/deps/github_hashes/facebook/fbthrift-rev.txt: -------------------------------------------------------------------------------- 1 | Subproject commit ce9edbca67013783bc94f6a9e16e6c29a0387cf9 2 | -------------------------------------------------------------------------------- /build/deps/github_hashes/facebook/folly-rev.txt: -------------------------------------------------------------------------------- 1 | Subproject commit 82bfe10e7180d5537639a3717963c0049f8591f9 2 | -------------------------------------------------------------------------------- /build/deps/github_hashes/facebook/mvfst-rev.txt: -------------------------------------------------------------------------------- 1 | Subproject commit b48045620d4a1be43178bd7837dc35e98a7d8549 2 | -------------------------------------------------------------------------------- /build/deps/github_hashes/facebook/wangle-rev.txt: -------------------------------------------------------------------------------- 1 | Subproject commit a81e6cf166694e38c9955e9bb25e8812e00321c1 2 | -------------------------------------------------------------------------------- /build/deps/github_hashes/facebookexperimental/edencommon-rev.txt: -------------------------------------------------------------------------------- 1 | Subproject commit d48684e4a3ce434da13ab55804399e469773986f 2 | -------------------------------------------------------------------------------- /build/deps/github_hashes/facebookincubator/fizz-rev.txt: -------------------------------------------------------------------------------- 1 | Subproject commit 9d59cc8565a2accb2416a94e2633e1404e3b3968 2 | -------------------------------------------------------------------------------- /build/fbcode_builder/.gitignore: -------------------------------------------------------------------------------- 1 | # Facebook-internal CI builds don't have write permission outside of the 2 | # source tree, so we install all projects into this directory. 3 | /facebook_ci 4 | __pycache__/ 5 | *.pyc 6 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FBBuildOptions.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | function (fb_activate_static_library_option) 4 | option(USE_STATIC_DEPS_ON_UNIX 5 | "If enabled, use static dependencies on unix systems. This is generally discouraged." 6 | OFF 7 | ) 8 | # Mark USE_STATIC_DEPS_ON_UNIX as an "advanced" option, since enabling it 9 | # is generally discouraged. 10 | mark_as_advanced(USE_STATIC_DEPS_ON_UNIX) 11 | 12 | if(UNIX AND USE_STATIC_DEPS_ON_UNIX) 13 | SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a" PARENT_SCOPE) 14 | endif() 15 | endfunction() 16 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FBCompilerSettings.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This file applies common compiler settings that are shared across 4 | # a number of Facebook opensource projects. 5 | # Please use caution and your best judgement before making changes 6 | # to these shared compiler settings in order to avoid accidentally 7 | # breaking a build in another project! 8 | 9 | if (WIN32) 10 | include(FBCompilerSettingsMSVC) 11 | else() 12 | include(FBCompilerSettingsUnix) 13 | endif() 14 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FBCompilerSettingsMSVC.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This file applies common compiler settings that are shared across 4 | # a number of Facebook opensource projects. 5 | # Please use caution and your best judgement before making changes 6 | # to these shared compiler settings in order to avoid accidentally 7 | # breaking a build in another project! 8 | 9 | add_compile_options( 10 | /wd4250 # 'class1' : inherits 'class2::member' via dominance 11 | ) 12 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FBCompilerSettingsUnix.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This file applies common compiler settings that are shared across 4 | # a number of Facebook opensource projects. 5 | # Please use caution and your best judgement before making changes 6 | # to these shared compiler settings in order to avoid accidentally 7 | # breaking a build in another project! 8 | 9 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations") 10 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FindDoubleConversion.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | 3 | # Finds libdouble-conversion. 4 | # 5 | # This module defines: 6 | # DOUBLE_CONVERSION_INCLUDE_DIR 7 | # DOUBLE_CONVERSION_LIBRARY 8 | # 9 | 10 | find_path(DOUBLE_CONVERSION_INCLUDE_DIR double-conversion/double-conversion.h) 11 | find_library(DOUBLE_CONVERSION_LIBRARY NAMES double-conversion) 12 | 13 | include(FindPackageHandleStandardArgs) 14 | find_package_handle_standard_args( 15 | DoubleConversion 16 | DEFAULT_MSG 17 | DOUBLE_CONVERSION_LIBRARY DOUBLE_CONVERSION_INCLUDE_DIR) 18 | 19 | mark_as_advanced(DOUBLE_CONVERSION_INCLUDE_DIR DOUBLE_CONVERSION_LIBRARY) 20 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FindLMDB.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This software may be used and distributed according to the terms of the 4 | # GNU General Public License version 2. 5 | 6 | find_library(LMDB_LIBRARIES NAMES lmdb liblmdb) 7 | mark_as_advanced(LMDB_LIBRARIES) 8 | 9 | find_path(LMDB_INCLUDE_DIR NAMES lmdb.h) 10 | mark_as_advanced(LMDB_INCLUDE_DIR) 11 | 12 | find_package_handle_standard_args( 13 | LMDB 14 | REQUIRED_VARS LMDB_LIBRARIES LMDB_INCLUDE_DIR) 15 | 16 | if(LMDB_FOUND) 17 | set(LMDB_LIBRARIES ${LMDB_LIBRARIES}) 18 | set(LMDB_INCLUDE_DIR, ${LMDB_INCLUDE_DIR}) 19 | endif() 20 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FindPCRE.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | include(FindPackageHandleStandardArgs) 3 | find_path(PCRE_INCLUDE_DIR NAMES pcre.h) 4 | find_library(PCRE_LIBRARY NAMES pcre) 5 | find_package_handle_standard_args( 6 | PCRE 7 | DEFAULT_MSG 8 | PCRE_LIBRARY 9 | PCRE_INCLUDE_DIR 10 | ) 11 | mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARY) 12 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FindPCRE2.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | include(FindPackageHandleStandardArgs) 3 | find_path(PCRE2_INCLUDE_DIR NAMES pcre2.h) 4 | find_library(PCRE2_LIBRARY NAMES pcre2-8) 5 | find_package_handle_standard_args( 6 | PCRE2 7 | DEFAULT_MSG 8 | PCRE2_LIBRARY 9 | PCRE2_INCLUDE_DIR 10 | ) 11 | set(PCRE2_DEFINES "PCRE2_CODE_UNIT_WIDTH=8") 12 | mark_as_advanced(PCRE2_INCLUDE_DIR PCRE2_LIBRARY PCRE2_DEFINES) 13 | -------------------------------------------------------------------------------- /build/fbcode_builder/CMake/FindRe2.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # 3 | # This software may be used and distributed according to the terms of the 4 | # GNU General Public License version 2. 5 | 6 | find_library(RE2_LIBRARY re2) 7 | mark_as_advanced(RE2_LIBRARY) 8 | 9 | find_path(RE2_INCLUDE_DIR NAMES re2/re2.h) 10 | mark_as_advanced(RE2_INCLUDE_DIR) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( 14 | RE2 15 | REQUIRED_VARS RE2_LIBRARY RE2_INCLUDE_DIR) 16 | 17 | if(RE2_FOUND) 18 | set(RE2_LIBRARY ${RE2_LIBRARY}) 19 | set(RE2_INCLUDE_DIR, ${RE2_INCLUDE_DIR}) 20 | endif() 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Facebook, Inc. and its affiliates. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build/fbcode_builder/getdeps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/build/fbcode_builder/getdeps/__init__.py -------------------------------------------------------------------------------- /build/fbcode_builder/getdeps/errors.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # pyre-unsafe 7 | 8 | 9 | class TransientFailure(Exception): 10 | """Raising this error causes getdeps to return with an error code 11 | that Sandcastle will consider to be a retryable transient 12 | infrastructure error""" 13 | 14 | pass 15 | 16 | 17 | class ManifestNotFound(Exception): 18 | def __init__(self, manifest_name) -> None: 19 | super(Exception, self).__init__("Unable to find manifest '%s'" % manifest_name) 20 | -------------------------------------------------------------------------------- /build/fbcode_builder/getdeps/test/fixtures/duplicate/foo: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = foo 3 | -------------------------------------------------------------------------------- /build/fbcode_builder/getdeps/test/fixtures/duplicate/subdir/foo: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = foo 3 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/CLI11: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = CLI11 3 | 4 | [download] 5 | url = https://github.com/CLIUtils/CLI11/archive/v2.0.0.tar.gz 6 | sha256 = 2c672f17bf56e8e6223a3bfb74055a946fa7b1ff376510371902adb9cb0ab6a3 7 | 8 | [build] 9 | builder = cmake 10 | subdir = CLI11-2.0.0 11 | 12 | [cmake.defines] 13 | CLI11_BUILD_TESTS = OFF 14 | CLI11_BUILD_EXAMPLES = OFF 15 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/autoconf: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = autoconf 3 | 4 | [debs] 5 | autoconf 6 | 7 | [homebrew] 8 | autoconf 9 | 10 | [rpms] 11 | autoconf 12 | 13 | [pps] 14 | autoconf 15 | 16 | [download] 17 | url = http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz 18 | sha256 = 954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969 19 | 20 | [build] 21 | builder = autoconf 22 | subdir = autoconf-2.69 23 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/automake: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = automake 3 | 4 | [homebrew] 5 | automake 6 | 7 | [debs] 8 | automake 9 | 10 | [rpms] 11 | automake 12 | 13 | [pps] 14 | automake 15 | 16 | [download] 17 | url = http://ftp.gnu.org/gnu/automake/automake-1.16.1.tar.gz 18 | sha256 = 608a97523f97db32f1f5d5615c98ca69326ced2054c9f82e65bade7fc4c9dea8 19 | 20 | [build] 21 | builder = autoconf 22 | subdir = automake-1.16.1 23 | 24 | [dependencies] 25 | autoconf 26 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/benchmark: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = benchmark 3 | 4 | [download] 5 | url = https://github.com/google/benchmark/archive/refs/tags/v1.8.0.tar.gz 6 | sha256 = ea2e94c24ddf6594d15c711c06ccd4486434d9cf3eca954e2af8a20c88f9f172 7 | 8 | [build] 9 | builder = cmake 10 | subdir = benchmark-1.8.0/ 11 | 12 | [cmake.defines] 13 | BENCHMARK_ENABLE_TESTING=OFF 14 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/blake3: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = blake3 3 | 4 | [download] 5 | url = https://github.com/BLAKE3-team/BLAKE3/archive/refs/tags/1.5.1.tar.gz 6 | sha256 = 822cd37f70152e5985433d2c50c8f6b2ec83aaf11aa31be9fe71486a91744f37 7 | 8 | [build] 9 | builder = cmake 10 | subdir = BLAKE3-1.5.1/c 11 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/bz2: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = bz2 3 | 4 | [debs] 5 | libbz2-dev 6 | bzip2 7 | 8 | [homebrew] 9 | bzip2 10 | 11 | [rpms] 12 | bzip2-devel 13 | bzip2 14 | 15 | [download] 16 | url = https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz 17 | sha256 = ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 18 | 19 | [build.not(os=windows)] 20 | builder = make 21 | subdir = bzip2-1.0.8 22 | 23 | [make.build_args.os=linux] 24 | # python bz2 support on linux needs dynamic library 25 | -f 26 | Makefile-libbz2_so 27 | 28 | [make.install_args] 29 | install 30 | 31 | [build.os=windows] 32 | builder = nop 33 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/cabal: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = cabal 3 | 4 | [download.os=linux] 5 | url = https://downloads.haskell.org/~cabal/cabal-install-3.6.2.0/cabal-install-3.6.2.0-x86_64-linux-deb10.tar.xz 6 | sha256 = 4759b56e9257e02f29fa374a6b25d6cb2f9d80c7e3a55d4f678a8e570925641c 7 | 8 | [build] 9 | builder = nop 10 | 11 | [install.files] 12 | cabal = bin/cabal 13 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/cachelib: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = cachelib 3 | fbsource_path = fbcode/cachelib 4 | shipit_project = cachelib 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/cachelib.git 9 | 10 | [build] 11 | builder = cmake 12 | subdir = cachelib 13 | job_weight_mib = 2048 14 | 15 | [dependencies] 16 | zlib 17 | fizz 18 | fmt 19 | folly 20 | fbthrift 21 | googletest 22 | sparsemap 23 | wangle 24 | zstd 25 | mvfst 26 | numa 27 | libaio 28 | # cachelib also depends on openssl but since the latter requires a platform- 29 | # specific configuration we rely on the folly manifest to provide this 30 | # dependency to avoid duplication. 31 | 32 | [shipit.pathmap] 33 | fbcode/cachelib = cachelib 34 | fbcode/cachelib/public_tld = . 35 | 36 | [shipit.strip] 37 | ^fbcode/cachelib/examples(/|$) 38 | ^fbcode/cachelib/facebook(/|$) 39 | ^fbcode/cachelib/public_tld/website/docs/facebook(/|$) 40 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/clang: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = clang 3 | 4 | [rpms] 5 | clang15-devel 6 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/cpptoml: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = cpptoml 3 | 4 | [homebrew] 5 | cpptoml 6 | 7 | [download] 8 | url = https://github.com/chadaustin/cpptoml/archive/refs/tags/v0.1.2.tar.gz 9 | sha256 = beda37e94f9746874436c8090c045fd80ae6f8a51f7c668c932a2b110a4fc277 10 | 11 | [build] 12 | builder = cmake 13 | subdir = cpptoml-0.1.2 14 | 15 | [cmake.defines.os=freebsd] 16 | ENABLE_LIBCXX=NO 17 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/double-conversion: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = double-conversion 3 | 4 | [download] 5 | url = https://github.com/google/double-conversion/archive/v3.1.4.tar.gz 6 | sha256 = 95004b65e43fefc6100f337a25da27bb99b9ef8d4071a36a33b5e83eb1f82021 7 | 8 | [homebrew] 9 | double-conversion 10 | 11 | [debs] 12 | libdouble-conversion-dev 13 | 14 | [rpms] 15 | double-conversion 16 | double-conversion-devel 17 | 18 | [pps] 19 | double-conversion 20 | 21 | [build] 22 | builder = cmake 23 | subdir = double-conversion-3.1.4 24 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/edencommon: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = edencommon 3 | fbsource_path = fbcode/eden/common 4 | shipit_project = edencommon 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebookexperimental/edencommon.git 9 | 10 | [build] 11 | builder = cmake 12 | 13 | [dependencies] 14 | fbthrift 15 | fb303 16 | fmt 17 | folly 18 | gflags 19 | glog 20 | 21 | [cmake.defines.test=on] 22 | BUILD_TESTS=ON 23 | 24 | [cmake.defines.test=off] 25 | BUILD_TESTS=OFF 26 | 27 | [shipit.pathmap] 28 | fbcode/eden/common = eden/common 29 | fbcode/eden/common/oss = . 30 | 31 | [shipit.strip] 32 | @README.facebook@ 33 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/exprtk: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = exprtk 3 | 4 | [download] 5 | url = https://github.com/ArashPartow/exprtk/archive/refs/tags/0.0.1.tar.gz 6 | sha256 = fb72791c88ae3b3426e14fdad630027715682584daf56b973569718c56e33f28 7 | 8 | [build.not(os=windows)] 9 | builder = nop 10 | subdir = exprtk-0.0.1 11 | 12 | [install.files] 13 | exprtk.hpp = exprtk.hpp 14 | 15 | [dependencies] 16 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/fast_float: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = fast_float 3 | 4 | [download] 5 | url = https://github.com/fastfloat/fast_float/archive/refs/tags/v8.0.0.tar.gz 6 | sha256 = f312f2dc34c61e665f4b132c0307d6f70ad9420185fa831911bc24408acf625d 7 | 8 | [build] 9 | builder = cmake 10 | subdir = fast_float-8.0.0 11 | 12 | [cmake.defines] 13 | FASTFLOAT_TEST = OFF 14 | FASTFLOAT_SANITIZE = OFF 15 | 16 | [debs.not(all(distro=ubuntu,any(distro_vers="18.04",distro_vers="20.04",distro_vers="22.04",distro_vers="24.04")))] 17 | libfast-float-dev 18 | 19 | [rpms.distro=fedora] 20 | fast_float-devel 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/fatal: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = fatal 3 | fbsource_path = fbcode/fatal 4 | shipit_project = fatal 5 | 6 | [git] 7 | repo_url = https://github.com/facebook/fatal.git 8 | 9 | [shipit.pathmap] 10 | fbcode/fatal = fatal 11 | fbcode/fatal/public_tld = . 12 | 13 | [build] 14 | builder = nop 15 | subdir = . 16 | 17 | [install.files] 18 | fatal/portability.h = fatal/portability.h 19 | fatal/preprocessor.h = fatal/preprocessor.h 20 | fatal/container = fatal/container 21 | fatal/functional = fatal/functional 22 | fatal/math = fatal/math 23 | fatal/string = fatal/string 24 | fatal/type = fatal/type 25 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/fb303: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = fb303 3 | fbsource_path = fbcode/fb303 4 | shipit_project = fb303 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/fb303.git 9 | 10 | [cargo] 11 | cargo_config_file = source/fb303/thrift/.cargo/config.toml 12 | 13 | [crate.pathmap] 14 | fb303_core = fb303/thrift 15 | 16 | [build] 17 | builder = cmake 18 | 19 | [dependencies] 20 | folly 21 | gflags 22 | glog 23 | fbthrift 24 | 25 | [cmake.defines.test=on] 26 | BUILD_TESTS=ON 27 | 28 | [cmake.defines.test=off] 29 | BUILD_TESTS=OFF 30 | 31 | [shipit.pathmap] 32 | fbcode/fb303/github = . 33 | fbcode/fb303/public_autocargo = fb303 34 | fbcode/fb303 = fb303 35 | 36 | [shipit.strip] 37 | ^fbcode/fb303/(?!public_autocargo).+/Cargo\.toml$ 38 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/fboss: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = fboss 3 | fbsource_path = fbcode/fboss 4 | shipit_project = fboss 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/fboss.git 9 | 10 | [build.os=linux] 11 | builder = cmake 12 | # fboss files take a lot of RAM to compile. 13 | job_weight_mib = 3072 14 | 15 | [build.not(os=linux)] 16 | builder = nop 17 | 18 | [dependencies] 19 | folly 20 | fb303 21 | wangle 22 | fizz 23 | fmt 24 | libsodium 25 | googletest 26 | zstd 27 | fatal 28 | fbthrift 29 | iproute2 30 | libusb 31 | libcurl 32 | libnl 33 | libsai 34 | re2 35 | python 36 | yaml-cpp 37 | libyaml 38 | CLI11 39 | exprtk 40 | nlohmann-json 41 | libgpiod 42 | systemd 43 | range-v3 44 | 45 | [shipit.pathmap] 46 | fbcode/fboss/github = . 47 | fbcode/fboss/common = common 48 | fbcode/fboss = fboss 49 | 50 | [sandcastle] 51 | run_tests = off 52 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/fbthrift: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = fbthrift 3 | fbsource_path = xplat/thrift 4 | shipit_project = fbthrift 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/fbthrift.git 9 | 10 | [cargo] 11 | cargo_config_file = source/thrift/lib/rust/.cargo/config.toml 12 | 13 | [crate.pathmap] 14 | fbthrift = thrift/lib/rust 15 | 16 | [build] 17 | builder = cmake 18 | job_weight_mib = 2048 19 | 20 | [dependencies] 21 | fizz 22 | fmt 23 | folly 24 | googletest 25 | libsodium 26 | wangle 27 | zstd 28 | mvfst 29 | xxhash 30 | # Thrift also depends on openssl but since the latter requires a platform- 31 | # specific configuration we rely on the folly manifest to provide this 32 | # dependency to avoid duplication. 33 | 34 | [shipit.pathmap] 35 | xplat/thrift/public_tld = . 36 | xplat/thrift = thrift 37 | 38 | [shipit.strip] 39 | ^xplat/thrift/thrift-config\.h$ 40 | ^xplat/thrift/perf/canary.py$ 41 | ^xplat/thrift/perf/loadtest.py$ 42 | ^xplat/thrift/.castle/.* 43 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/fizz: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = fizz 3 | fbsource_path = fbcode/fizz 4 | shipit_project = fizz 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebookincubator/fizz.git 9 | 10 | [build] 11 | builder = cmake 12 | subdir = fizz 13 | 14 | [cmake.defines] 15 | BUILD_EXAMPLES = OFF 16 | 17 | [cmake.defines.test=on] 18 | BUILD_TESTS = ON 19 | 20 | [cmake.defines.all(os=windows, test=on)] 21 | BUILD_TESTS = OFF 22 | 23 | [cmake.defines.test=off] 24 | BUILD_TESTS = OFF 25 | 26 | [dependencies] 27 | folly 28 | liboqs 29 | libsodium 30 | zlib 31 | zstd 32 | 33 | [dependencies.all(test=on, not(os=windows))] 34 | googletest 35 | 36 | [shipit.pathmap] 37 | fbcode/fizz/public_tld = . 38 | fbcode/fizz = fizz 39 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/fmt: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = fmt 3 | 4 | [download] 5 | url = https://github.com/fmtlib/fmt/archive/refs/tags/11.0.2.tar.gz 6 | sha256 = 6cb1e6d37bdcb756dbbe59be438790db409cdb4868c66e888d5df9f13f7c027f 7 | 8 | [build] 9 | builder = cmake 10 | subdir = fmt-11.0.2 11 | 12 | [cmake.defines] 13 | FMT_TEST = OFF 14 | FMT_DOC = OFF 15 | 16 | [homebrew] 17 | fmt 18 | 19 | [rpms.distro=fedora] 20 | fmt-devel 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/gflags: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = gflags 3 | 4 | [download] 5 | url = https://github.com/gflags/gflags/archive/v2.2.2.tar.gz 6 | sha256 = 34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf 7 | 8 | [build] 9 | builder = cmake 10 | subdir = gflags-2.2.2 11 | 12 | [cmake.defines] 13 | BUILD_SHARED_LIBS = ON 14 | BUILD_STATIC_LIBS = ON 15 | #BUILD_gflags_nothreads_LIB = OFF 16 | BUILD_gflags_LIB = ON 17 | 18 | [homebrew] 19 | gflags 20 | 21 | [debs] 22 | libgflags-dev 23 | 24 | [rpms.distro=fedora] 25 | gflags-devel 26 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/ghc: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = ghc 3 | 4 | [download.os=linux] 5 | url = https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-x86_64-fedora27-linux.tar.xz 6 | sha256 = 845f63cd365317bb764d81025554a2527dbe315d6fa268c9859e21b911bf2d3c 7 | 8 | [build] 9 | builder = autoconf 10 | subdir = ghc-9.2.8 11 | build_in_src_dir = true 12 | only_install = true 13 | 14 | [make.install_args] 15 | install 16 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/git-lfs: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = git-lfs 3 | 4 | [rpms] 5 | git-lfs 6 | 7 | [debs] 8 | git-lfs 9 | 10 | [homebrew] 11 | git-lfs 12 | 13 | # only used from system packages currently 14 | [build] 15 | builder = nop 16 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/glean: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = glean 3 | fbsource_path = fbcode/glean 4 | shipit_project = facebookincubator/Glean 5 | use_shipit = true 6 | 7 | [shipit.pathmap] 8 | # These are only used by target determinator to trigger builds, the 9 | # real path mappings are in the ShipIt config. 10 | fbcode/glean = glean 11 | fbcode/common/hs = hsthrift 12 | 13 | [subprojects] 14 | hsthrift = hsthrift 15 | 16 | [dependencies] 17 | cabal 18 | ghc 19 | gflags 20 | glog 21 | folly 22 | rocksdb 23 | xxhash 24 | llvm 25 | clang 26 | re2 27 | 28 | [build] 29 | builder = make 30 | 31 | [make.build_args] 32 | cabal-update 33 | all 34 | glean-hie 35 | glass 36 | glean-clang 37 | EXTRA_GHC_OPTS=-j4 +RTS -A32m -n4m -RTS 38 | CABAL_CONFIG_FLAGS=-f-hack-tests -f-typescript-tests -f-python-tests -f-dotnet-tests -f-go-tests -f-rust-tests -f-java-lsif-tests -f-flow-tests 39 | 40 | [make.install_args] 41 | install 42 | 43 | [make.test_args] 44 | test 45 | EXTRA_GHC_OPTS=-j4 +RTS -A32m -n4m -RTS 46 | CABAL_CONFIG_FLAGS=-f-hack-tests -f-typescript-tests -f-python-tests -f-dotnet-tests -f-go-tests -f-rust-tests -f-java-lsif-tests -f-flow-tests 47 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/glog: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = glog 3 | 4 | [download] 5 | url = https://github.com/google/glog/archive/v0.5.0.tar.gz 6 | sha256 = eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5 7 | 8 | [build] 9 | builder = cmake 10 | subdir = glog-0.5.0 11 | 12 | [dependencies] 13 | gflags 14 | 15 | [cmake.defines] 16 | BUILD_SHARED_LIBS=ON 17 | BUILD_TESTING=NO 18 | WITH_PKGCONFIG=ON 19 | 20 | [cmake.defines.os=freebsd] 21 | HAVE_TR1_UNORDERED_MAP=OFF 22 | HAVE_TR1_UNORDERED_SET=OFF 23 | 24 | [homebrew] 25 | glog 26 | 27 | # on ubuntu glog brings in liblzma-dev, which in turn breaks watchman tests 28 | [debs.not(distro=ubuntu)] 29 | libgoogle-glog-dev 30 | 31 | [rpms.distro=fedora] 32 | glog-devel 33 | 34 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/googletest: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = googletest 3 | 4 | [download] 5 | url = https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz 6 | sha256 = 81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2 7 | 8 | [build] 9 | builder = cmake 10 | subdir = googletest-release-1.12.1 11 | 12 | [cmake.defines] 13 | # Everything else defaults to the shared runtime, so tell gtest that 14 | # it should not use its choice of the static runtime 15 | gtest_force_shared_crt=ON 16 | 17 | [cmake.defines.os=windows] 18 | BUILD_SHARED_LIBS=ON 19 | 20 | [homebrew] 21 | googletest 22 | 23 | # packaged googletest is too old 24 | [debs.not(all(distro=ubuntu,any(distro_vers="18.04",distro_vers="20.04",distro_vers="22.04")))] 25 | libgtest-dev 26 | libgmock-dev 27 | 28 | [rpms.distro=fedora] 29 | gmock-devel 30 | gtest-devel 31 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/gperf: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = gperf 3 | 4 | [download] 5 | url = http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz 6 | sha256 = 588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2 7 | 8 | [build.not(os=windows)] 9 | builder = autoconf 10 | subdir = gperf-3.1 11 | 12 | [build.os=windows] 13 | builder = nop 14 | 15 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/hexdump: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = hexdump 3 | 4 | [rpms] 5 | util-linux 6 | 7 | [debs] 8 | bsdmainutils 9 | 10 | # only used from system packages currently 11 | [build] 12 | builder = nop 13 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/hsthrift: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = hsthrift 3 | fbsource_path = fbcode/common/hs 4 | shipit_project = facebookincubator/hsthrift 5 | use_shipit = true 6 | 7 | [shipit.pathmap] 8 | # These are only used by target determinator to trigger builds, the 9 | # real path mappings are in the ShipIt config. 10 | fbcode/common/hs = . 11 | 12 | [dependencies] 13 | cabal 14 | ghc 15 | gflags 16 | glog 17 | folly 18 | fbthrift 19 | wangle 20 | fizz 21 | boost 22 | 23 | [build] 24 | builder = make 25 | 26 | [make.build_args] 27 | cabal-update 28 | all 29 | 30 | [make.install_args] 31 | install 32 | 33 | [make.test_args] 34 | test 35 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/iproute2: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = iproute2 3 | 4 | [download] 5 | url = https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.12.0.tar.gz 6 | sha256 = 46612a1e2d01bb31932557bccdb1b8618cae9a439dfffc08ef35ed8e197f14ce 7 | 8 | [build.os=linux] 9 | builder = iproute2 10 | subdir = iproute2-4.12.0 11 | patchfile = iproute2_oss.patch 12 | 13 | [build.not(os=linux)] 14 | builder = nop 15 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/jom: -------------------------------------------------------------------------------- 1 | # jom is compatible with MSVC nmake, but adds the /j argment which 2 | # speeds up openssl build a lot 3 | [manifest] 4 | name = jom 5 | 6 | # see https://download.qt.io/official_releases/jom/changelog.txt for latest version 7 | [download.os=windows] 8 | url = https://download.qt.io/official_releases/jom/jom_1_1_4.zip 9 | sha256 = d533c1ef49214229681e90196ed2094691e8c4a0a0bef0b2c901debcb562682b 10 | 11 | [build.os=windows] 12 | builder = nop 13 | 14 | [install.files.os=windows] 15 | . = bin 16 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/jq: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = jq 3 | 4 | [rpms.distro=fedora] 5 | jq 6 | 7 | [homebrew] 8 | jq 9 | 10 | [download.not(os=windows)] 11 | # we use jq-1.7+ to get fix for number truncation https://github.com/jqlang/jq/pull/1752 12 | url = https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-1.7.1.tar.gz 13 | sha256 = 478c9ca129fd2e3443fe27314b455e211e0d8c60bc8ff7df703873deeee580c2 14 | 15 | [build.not(os=windows)] 16 | builder = autoconf 17 | subdir = jq-1.7.1 18 | 19 | [build.os=windows] 20 | builder = nop 21 | 22 | [autoconf.args] 23 | # This argument turns off some developers tool and it is recommended in jq's 24 | # README 25 | --disable-maintainer-mode 26 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/katran: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = katran 3 | fbsource_path = fbcode/katran 4 | shipit_project = katran 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebookincubator/katran.git 9 | 10 | [build.not(os=linux)] 11 | builder = nop 12 | 13 | [build.os=linux] 14 | builder = cmake 15 | subdir = . 16 | 17 | [cmake.defines.test=on] 18 | BUILD_TESTS=ON 19 | 20 | [cmake.defines.test=off] 21 | BUILD_TESTS=OFF 22 | 23 | [dependencies] 24 | folly 25 | fizz 26 | libbpf 27 | libmnl 28 | zlib 29 | googletest 30 | fmt 31 | 32 | [debs] 33 | libssl-dev 34 | 35 | [shipit.pathmap] 36 | fbcode/katran/public_root = . 37 | fbcode/katran = katran 38 | 39 | [shipit.strip] 40 | ^fbcode/katran/facebook 41 | ^fbcode/katran/OSS_SYNC 42 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libaio: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libaio 3 | 4 | [debs] 5 | libaio-dev 6 | 7 | [rpms.distro=centos_stream] 8 | libaio-devel 9 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libbpf: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libbpf 3 | 4 | [download] 5 | url = https://github.com/libbpf/libbpf/archive/refs/tags/v0.7.0.tar.gz 6 | sha256 = 5083588ce5a3a620e395ee1e596af77b4ec5771ffc71cff2af49dfee38c06361 7 | 8 | # BPF only builds on linux, so make it a NOP on other platforms 9 | [build.not(os=linux)] 10 | builder = nop 11 | 12 | [build.os=linux] 13 | builder = make 14 | subdir = libbpf-0.7.0/src 15 | 16 | [make.build_args] 17 | BUILD_STATIC_ONLY=y 18 | 19 | # libbpf-0.3 requires uapi headers >= 5.8 20 | [make.install_args] 21 | install 22 | install_uapi_headers 23 | BUILD_STATIC_ONLY=y 24 | 25 | [dependencies] 26 | libelf 27 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libcurl: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libcurl 3 | 4 | [rpms] 5 | libcurl-devel 6 | libcurl-minimal 7 | 8 | [debs] 9 | libcurl4-openssl-dev 10 | 11 | [pps] 12 | libcurl-gnutls 13 | 14 | [download] 15 | url = https://curl.haxx.se/download/curl-7.65.1.tar.gz 16 | sha256 = 821aeb78421375f70e55381c9ad2474bf279fc454b791b7e95fc83562951c690 17 | 18 | [dependencies] 19 | nghttp2 20 | 21 | # We use system OpenSSL on Linux (see folly's manifest for details) 22 | [dependencies.not(os=linux)] 23 | openssl 24 | 25 | [build.not(os=windows)] 26 | builder = autoconf 27 | subdir = curl-7.65.1 28 | 29 | [autoconf.args] 30 | # fboss (which added the libcurl dep) doesn't need ldap so it is disabled here. 31 | # if someone in the future wants to add ldap for something else, it won't hurt 32 | # fboss. However, that would require adding an ldap manifest. 33 | # 34 | # For the same reason, we disable libssh2 and libidn2 which aren't really used 35 | # but would require adding manifests if we don't disable them. 36 | --disable-ldap 37 | --without-libssh2 38 | --without-libidn2 39 | 40 | [build.os=windows] 41 | builder = cmake 42 | subdir = curl-7.65.1 43 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libdwarf: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libdwarf 3 | 4 | [rpms] 5 | libdwarf-devel 6 | libdwarf 7 | 8 | [debs] 9 | libdwarf-dev 10 | 11 | [homebrew] 12 | dwarfutils 13 | 14 | [download] 15 | url = https://www.prevanders.net/libdwarf-0.9.2.tar.xz 16 | sha256 = 22b66d06831a76f6a062126cdcad3fcc58540b89a1acb23c99f8861f50999ec3 17 | 18 | [build] 19 | builder = cmake 20 | subdir = libdwarf-0.9.2 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libelf: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libelf 3 | 4 | [rpms] 5 | elfutils-libelf-devel-static 6 | 7 | [debs] 8 | libelf-dev 9 | 10 | [pps] 11 | libelf 12 | 13 | [download] 14 | url = https://ftp.osuosl.org/pub/blfs/conglomeration/libelf/libelf-0.8.13.tar.gz 15 | sha256 = 591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d 16 | 17 | # libelf only makes sense on linux, so make it a NOP on other platforms 18 | [build.not(os=linux)] 19 | builder = nop 20 | 21 | [build.os=linux] 22 | builder = autoconf 23 | subdir = libelf-0.8.13 24 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libevent: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libevent 3 | 4 | [debs] 5 | libevent-dev 6 | 7 | [homebrew] 8 | libevent 9 | 10 | [rpms] 11 | libevent-devel 12 | 13 | [pps] 14 | libevent 15 | 16 | # Note that the CMakeLists.txt file is present only in 17 | # git repo and not in the release tarball, so take care 18 | # to use the github generated source tarball rather than 19 | # the explicitly uploaded source tarball 20 | [download] 21 | url = https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz 22 | sha256 = 92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb 23 | 24 | [build] 25 | builder = cmake 26 | subdir = libevent-2.1.12-stable 27 | 28 | [cmake.defines] 29 | EVENT__DISABLE_TESTS = ON 30 | EVENT__DISABLE_BENCHMARK = ON 31 | EVENT__DISABLE_SAMPLES = ON 32 | EVENT__DISABLE_REGRESS = ON 33 | 34 | [cmake.defines.shared_libs=on] 35 | EVENT__BUILD_SHARED_LIBRARIES = ON 36 | 37 | [cmake.defines.os=windows] 38 | EVENT__LIBRARY_TYPE = STATIC 39 | 40 | [dependencies.not(any(os=linux, os=freebsd))] 41 | openssl 42 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libffi: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libffi 3 | 4 | [debs] 5 | libffi-dev 6 | 7 | [homebrew] 8 | libffi 9 | 10 | [rpms] 11 | libffi-devel 12 | libffi 13 | 14 | [pps] 15 | libffi 16 | 17 | [download] 18 | url = https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz 19 | sha256 = 540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620 20 | 21 | [build] 22 | builder = autoconf 23 | subdir = libffi-3.4.2 24 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libgit2: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libgit2 3 | 4 | [homebrew] 5 | libgit2 6 | 7 | [rpms] 8 | libgit2-devel 9 | 10 | [pps] 11 | libgit2 12 | 13 | # Ubuntu 18.04 libgit2 has clash with libcurl4-openssl-dev as it depends on 14 | # libcurl4-gnutls-dev. Should be ok from 20.04 again 15 | # There is a description at https://github.com/r-hub/sysreqsdb/issues/77 16 | [debs.not(all(distro=ubuntu,distro_vers="18.04"))] 17 | libgit2-dev 18 | 19 | [download] 20 | url = https://github.com/libgit2/libgit2/archive/v0.28.1.tar.gz 21 | sha256 = 0ca11048795b0d6338f2e57717370208c2c97ad66c6d5eac0c97a8827d13936b 22 | 23 | [build] 24 | builder = cmake 25 | subdir = libgit2-0.28.1 26 | 27 | [cmake.defines] 28 | # Could turn this on if we also wanted to add a manifest for libssh2 29 | USE_SSH = OFF 30 | BUILD_CLAR = OFF 31 | # Have to build shared to work around annoying problems with cmake 32 | # mis-parsing the frameworks required to link this on macos :-/ 33 | BUILD_SHARED_LIBS = ON 34 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libgpiod: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libgpiod 3 | 4 | [download] 5 | url = https://cdn.kernel.org/pub/software/libs/libgpiod/libgpiod-1.6.tar.xz 6 | sha256 = 62908023d59e8cbb9137ddd14deec50ced862d8f9b8749f288d3dbe7967151ef 7 | 8 | [build] 9 | builder = autoconf 10 | subdir = libgpiod-1.6 11 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libiberty: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libiberty 3 | 4 | [rpms] 5 | binutils-devel 6 | binutils 7 | 8 | [debs] 9 | binutils-dev 10 | 11 | [download] 12 | url = https://ftp.gnu.org/gnu/binutils/binutils-2.43.tar.xz 13 | sha256 = b53606f443ac8f01d1d5fc9c39497f2af322d99e14cea5c0b4b124d630379365 14 | 15 | [dependencies] 16 | zlib 17 | 18 | [build] 19 | builder = autoconf 20 | subdir = binutils-2.43/libiberty 21 | patchfile = libiberty_install_pic_lib.patch 22 | 23 | # only build the parts needed for demangling 24 | # as we still want to use system linker and assembler etc 25 | [autoconf.args] 26 | --enable-install-libiberty 27 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libmnl: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libmnl 3 | 4 | [rpms] 5 | libmnl-devel 6 | 7 | # all centos 8 distros are missing this, 8 | # but its in fedora so may be back in a later version 9 | [rpms.not(all(any(distro=centos_stream,distro=centos),distro_vers=8))] 10 | libmnl-static 11 | 12 | [debs] 13 | libmnl-dev 14 | 15 | [pps] 16 | libmnl 17 | 18 | [download] 19 | url = http://www.netfilter.org/pub/libmnl/libmnl-1.0.4.tar.bz2 20 | sha256 = 171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81 21 | 22 | [build.os=linux] 23 | builder = autoconf 24 | subdir = libmnl-1.0.4 25 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libnl: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libnl 3 | 4 | [rpms] 5 | libnl3-devel 6 | libnl3 7 | 8 | [debs] 9 | libnl-3-dev 10 | libnl-route-3-dev 11 | 12 | [pps] 13 | libnl 14 | 15 | [download] 16 | url = https://github.com/thom311/libnl/releases/download/libnl3_2_25/libnl-3.2.25.tar.gz 17 | sha256 = 8beb7590674957b931de6b7f81c530b85dc7c1ad8fbda015398bc1e8d1ce8ec5 18 | 19 | [build.os=linux] 20 | builder = autoconf 21 | subdir = libnl-3.2.25 22 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/liboqs: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = liboqs 3 | 4 | [download] 5 | url = https://github.com/open-quantum-safe/liboqs/archive/refs/tags/0.12.0.tar.gz 6 | sha256 = df999915204eb1eba311d89e83d1edd3a514d5a07374745d6a9e5b2dd0d59c08 7 | 8 | [build] 9 | builder = cmake 10 | subdir = liboqs-0.12.0 11 | 12 | [cmake.defines] 13 | OQS_MINIMAL_BUILD = KEM_kyber_512;KEM_kyber_768;KEM_kyber_1024;KEM_ml_kem_512;KEM_ml_kem_768;KEM_ml_kem_1024 14 | 15 | [dependencies] 16 | openssl 17 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libsai: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libsai 3 | 4 | [download] 5 | url = https://github.com/opencomputeproject/SAI/archive/v1.14.0.tar.gz 6 | sha256 = 4e3a1d010bda0c589db46e077725a2cd9624a5cc255c89d1caa79deb408d1fa7 7 | 8 | [build] 9 | builder = nop 10 | subdir = SAI-1.14.0 11 | 12 | [install.files] 13 | inc = include 14 | experimental = experimental 15 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libsodium: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libsodium 3 | 4 | [debs] 5 | libsodium-dev 6 | 7 | [homebrew] 8 | libsodium 9 | 10 | [rpms] 11 | libsodium-devel 12 | libsodium-static 13 | 14 | [pps] 15 | libsodium 16 | 17 | [download.not(os=windows)] 18 | url = https://github.com/jedisct1/libsodium/releases/download/1.0.20-RELEASE/libsodium-1.0.20.tar.gz 19 | sha256 = ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19 20 | 21 | [build.not(os=windows)] 22 | builder = autoconf 23 | subdir = libsodium-1.0.20 24 | 25 | [download.os=windows] 26 | url = https://github.com/jedisct1/libsodium/releases/download/1.0.20-RELEASE/libsodium-1.0.20-msvc.zip 27 | sha256 = 2ff97f9e3f5b341bdc808e698057bea1ae454f99e29ff6f9b62e14d0eb1b1baa 28 | 29 | [build.os=windows] 30 | builder = nop 31 | 32 | [install.files.os=windows] 33 | libsodium/x64/Release/v143/dynamic/libsodium.dll = bin/libsodium.dll 34 | libsodium/x64/Release/v143/dynamic/libsodium.lib = lib/libsodium.lib 35 | libsodium/x64/Release/v143/dynamic/libsodium.exp = lib/libsodium.exp 36 | libsodium/x64/Release/v143/dynamic/libsodium.pdb = lib/libsodium.pdb 37 | libsodium/include = include 38 | 39 | [autoconf.args] 40 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libtool: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libtool 3 | 4 | [homebrew] 5 | libtool 6 | 7 | [rpms] 8 | libtool 9 | 10 | [debs] 11 | libtool 12 | 13 | [pps] 14 | libtool 15 | 16 | [download] 17 | url = http://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz 18 | sha256 = e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3 19 | 20 | [build] 21 | builder = autoconf 22 | subdir = libtool-2.4.6 23 | 24 | [dependencies] 25 | automake 26 | 27 | [autoconf.args] 28 | --enable-ltdl-install 29 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libunwind: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libunwind 3 | 4 | [rpms] 5 | libunwind-devel 6 | libunwind 7 | 8 | # on ubuntu this brings in liblzma-dev, which in turn breaks watchman tests 9 | [debs.not(distro=ubuntu)] 10 | libunwind-dev 11 | 12 | # The current libunwind v1.8.1 release has compiler issues with aarch64 (https://github.com/libunwind/libunwind/issues/702). 13 | # This more recent libunwind version (based on the latest commit, not a release version) got it fixed. 14 | [download] 15 | url = https://github.com/libunwind/libunwind/archive/f081cf42917bdd5c428b77850b473f31f81767cf.tar.gz 16 | sha256 = 4ff5c335c02d225491d6c885db827fb5fa505fee4e68b4d7e866efc0087e7264 17 | 18 | [build] 19 | builder = autoconf 20 | subdir = libunwind-f081cf42917bdd5c428b77850b473f31f81767cf 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libusb: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libusb 3 | 4 | [debs] 5 | libusb-1.0-0-dev 6 | 7 | [homebrew] 8 | libusb 9 | 10 | [rpms] 11 | libusb-devel 12 | libusb 13 | 14 | [pps] 15 | libusb 16 | 17 | [download] 18 | url = https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.tar.bz2 19 | sha256 = 75aeb9d59a4fdb800d329a545c2e6799f732362193b465ea198f2aa275518157 20 | 21 | [build.os=linux] 22 | builder = autoconf 23 | subdir = libusb-1.0.22 24 | 25 | [autoconf.args] 26 | # fboss (which added the libusb dep) doesn't need udev so it is disabled here. 27 | # if someone in the future wants to add udev for something else, it won't hurt 28 | # fboss. 29 | --disable-udev 30 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/libyaml: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = libyaml 3 | 4 | [download] 5 | url = http://pyyaml.org/download/libyaml/yaml-0.1.7.tar.gz 6 | sha256 = 8088e457264a98ba451a90b8661fcb4f9d6f478f7265d48322a196cec2480729 7 | 8 | [build.os=linux] 9 | builder = autoconf 10 | subdir = yaml-0.1.7 11 | 12 | [build.not(os=linux)] 13 | builder = nop 14 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/llvm: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = llvm 3 | 4 | [rpms] 5 | llvm15-devel 6 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/lmdb: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = lmdb 3 | 4 | [build] 5 | builder = make 6 | subdir = lmdb-LMDB_0.9.31/libraries/liblmdb 7 | 8 | [download] 9 | url = https://github.com/LMDB/lmdb/archive/refs/tags/LMDB_0.9.31.tar.gz 10 | sha256 = dd70a8c67807b3b8532b3e987b0a4e998962ecc28643e1af5ec77696b081c9b0 11 | 12 | [make.build_args] 13 | BUILD_STATIC_ONLY=y 14 | 15 | [make.install_args] 16 | install 17 | BUILD_STATIC_ONLY=y 18 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/lz4: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = lz4 3 | 4 | [homebrew] 5 | lz4 6 | 7 | [rpms] 8 | lz4-devel 9 | # centos 8 and centos_stream 9 are missing this rpm 10 | [rpms.not(any(all(distro=centos,distro_vers=8),all(distro=centos_stream,distro_vers=9)))] 11 | lz4-static 12 | 13 | [debs] 14 | liblz4-dev 15 | 16 | [pps] 17 | lz4 18 | 19 | [download] 20 | url = https://github.com/lz4/lz4/archive/v1.8.3.tar.gz 21 | sha256 = 33af5936ac06536805f9745e0b6d61da606a1f8b4cc5c04dd3cbaca3b9b4fc43 22 | 23 | [build] 24 | builder = cmake 25 | subdir = lz4-1.8.3/contrib/cmake_unofficial 26 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/mcrouter: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = mcrouter 3 | 4 | [git] 5 | repo_url = https://github.com/facebook/mcrouter.git 6 | 7 | [dependencies] 8 | folly 9 | wangle 10 | fizz 11 | fbthrift 12 | mvfst 13 | ragel 14 | 15 | [build] 16 | builder = cmake 17 | subdir = . 18 | 19 | [cmake.defines.test=on] 20 | BUILD_TESTS=ON 21 | 22 | [cmake.defines.test=off] 23 | BUILD_TESTS=OFF 24 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/mononoke_integration: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = mononoke_integration 3 | fbsource_path = fbcode/eden 4 | shipit_project = eden 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/sapling.git 9 | 10 | [build.not(os=windows)] 11 | builder = make 12 | subdir = eden/mononoke/tests/integration 13 | 14 | [build.os=windows] 15 | # building Mononoke on windows is not supported 16 | builder = nop 17 | 18 | [make.build_args] 19 | build-getdeps 20 | 21 | [make.install_args] 22 | install-getdeps 23 | 24 | [make.test_args] 25 | test-getdeps 26 | 27 | [shipit.pathmap] 28 | fbcode/eden/mononoke/tests/integration = eden/mononoke/tests/integration 29 | 30 | [shipit.strip] 31 | ^.*/facebook/.*$ 32 | ^.*/fb/.*$ 33 | 34 | [dependencies] 35 | git-lfs 36 | jq 37 | mononoke 38 | nmap 39 | python 40 | python-click 41 | ripgrep 42 | sapling 43 | tree 44 | zstd 45 | 46 | [dependencies.os=linux] 47 | sqlite3 48 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/mvfst: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = mvfst 3 | fbsource_path = fbcode/quic 4 | shipit_project = mvfst 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/mvfst.git 9 | 10 | [build] 11 | builder = cmake 12 | subdir = . 13 | 14 | [cmake.defines.test=on] 15 | BUILD_TESTS = ON 16 | 17 | [cmake.defines.all(os=windows, test=on)] 18 | BUILD_TESTS = OFF 19 | 20 | [cmake.defines.test=off] 21 | BUILD_TESTS = OFF 22 | 23 | [dependencies] 24 | folly 25 | fizz 26 | 27 | [dependencies.all(test=on, not(os=windows))] 28 | googletest 29 | 30 | [shipit.pathmap] 31 | fbcode/quic/public_root = . 32 | fbcode/quic = quic 33 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/ncurses: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = ncurses 3 | 4 | [debs] 5 | libncurses-dev 6 | 7 | [homebrew] 8 | ncurses 9 | 10 | [rpms] 11 | ncurses-devel 12 | 13 | [download] 14 | url = https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz 15 | sha256 = 97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059 16 | 17 | [build.not(os=windows)] 18 | builder = autoconf 19 | subdir = ncurses-6.3 20 | 21 | [autoconf.args] 22 | --without-cxx-binding 23 | --without-ada 24 | 25 | [autoconf.args.os=linux] 26 | --enable-shared 27 | --with-shared 28 | 29 | [build.os=windows] 30 | builder = nop 31 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/nghttp2: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = nghttp2 3 | 4 | [rpms] 5 | libnghttp2-devel 6 | libnghttp2 7 | 8 | [debs] 9 | libnghttp2-dev 10 | 11 | [pps] 12 | libnghttp2 13 | 14 | [download] 15 | url = https://github.com/nghttp2/nghttp2/releases/download/v1.47.0/nghttp2-1.47.0.tar.gz 16 | sha256 = 62f50f0e9fc479e48b34e1526df8dd2e94136de4c426b7680048181606832b7c 17 | 18 | [build] 19 | builder = autoconf 20 | subdir = nghttp2-1.47.0 21 | 22 | [autoconf.args] 23 | --enable-lib-only 24 | --disable-dependency-tracking 25 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/ninja: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = ninja 3 | 4 | [debs] 5 | ninja-build 6 | 7 | [homebrew] 8 | ninja 9 | 10 | [rpms] 11 | ninja-build 12 | 13 | [pps] 14 | ninja 15 | 16 | [download.os=windows] 17 | url = https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip 18 | sha256 = bbde850d247d2737c5764c927d1071cbb1f1957dcabda4a130fa8547c12c695f 19 | 20 | [build.os=windows] 21 | builder = nop 22 | 23 | [install.files.os=windows] 24 | ninja.exe = bin/ninja.exe 25 | 26 | [download.not(os=windows)] 27 | url = https://github.com/ninja-build/ninja/archive/v1.10.2.tar.gz 28 | sha256 = ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed 29 | 30 | [build.not(os=windows)] 31 | builder = ninja_bootstrap 32 | subdir = ninja-1.10.2 33 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/nlohmann-json: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = nlohmann-json 3 | 4 | [download] 5 | url = https://github.com/nlohmann/json/archive/refs/tags/v3.10.5.tar.gz 6 | sha256 = 5daca6ca216495edf89d167f808d1d03c4a4d929cef7da5e10f135ae1540c7e4 7 | 8 | [dependencies] 9 | 10 | [build] 11 | builder = cmake 12 | subdir = json-3.10.5 13 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/nmap: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = nmap 3 | 4 | [rpms] 5 | nmap 6 | nmap-ncat 7 | 8 | [debs] 9 | nmap 10 | 11 | # 18.04 combines ncat into the nmap package, newer need the separate one 12 | [debs.not(all(distro=ubuntu,distro_vers="18.04"))] 13 | ncat 14 | 15 | [download.not(os=windows)] 16 | url = https://api.github.com/repos/nmap/nmap/tarball/ef8213a36c2e89233c806753a57b5cd473605408 17 | sha256 = eda39e5a8ef4964fac7db16abf91cc11ff568eac0fa2d680b0bfa33b0ed71f4a 18 | 19 | [build.not(os=windows)] 20 | builder = autoconf 21 | subdir = nmap-nmap-ef8213a 22 | build_in_src_dir = true 23 | 24 | [build.os=windows] 25 | builder = nop 26 | 27 | [autoconf.args] 28 | # Without this option the build was filing to find some third party libraries 29 | # that we don't need 30 | enable_rdma=no 31 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/numa: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = numa 3 | 4 | [download] 5 | url = https://github.com/numactl/numactl/releases/download/v2.0.19/numactl-2.0.19.tar.gz 6 | sha256 = f2672a0381cb59196e9c246bf8bcc43d5568bc457700a697f1a1df762b9af884 7 | 8 | [build] 9 | builder = autoconf 10 | subdir = numactl-2.0.19 11 | 12 | [rpms.distro=centos_stream] 13 | numactl-devel 14 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/openr: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = openr 3 | fbsource_path = facebook/openr 4 | shipit_project = openr 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/openr.git 9 | 10 | [build.os=linux] 11 | builder = cmake 12 | # openr files take a lot of RAM to compile. 13 | job_weight_mib = 3072 14 | 15 | [build.not(os=linux)] 16 | # boost.fiber is required and that is not available on macos. 17 | builder = nop 18 | 19 | [dependencies] 20 | boost 21 | fb303 22 | fbthrift 23 | folly 24 | googletest 25 | re2 26 | range-v3 27 | 28 | [cmake.defines.test=on] 29 | BUILD_TESTS=ON 30 | ADD_ROOT_TESTS=OFF 31 | 32 | [cmake.defines.test=off] 33 | BUILD_TESTS=OFF 34 | 35 | 36 | [shipit.pathmap] 37 | fbcode/openr = openr 38 | fbcode/openr/public_tld = . 39 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/openssl: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = openssl 3 | 4 | [debs] 5 | libssl-dev 6 | 7 | [homebrew] 8 | openssl 9 | # on homebrew need the matching curl and ca- 10 | 11 | [rpms] 12 | openssl 13 | openssl-devel 14 | openssl-libs 15 | 16 | [pps] 17 | openssl 18 | 19 | # no need to download on the systems where we always use the system libs 20 | [download.not(any(os=linux, os=freebsd))] 21 | # match the openssl version packages in ubuntu LTS folly current supports 22 | url = https://www.openssl.org/source/openssl-3.0.15.tar.gz 23 | sha256 = 23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533 24 | 25 | # We use the system openssl on these platforms even without --allow-system-packages 26 | [build.any(os=linux, os=freebsd)] 27 | builder = nop 28 | 29 | [build.not(any(os=linux, os=freebsd))] 30 | builder = openssl 31 | subdir = openssl-3.0.15 32 | 33 | [dependencies.os=windows] 34 | jom 35 | perl 36 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/osxfuse: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = osxfuse 3 | 4 | [download] 5 | url = https://github.com/osxfuse/osxfuse/archive/osxfuse-3.8.3.tar.gz 6 | sha256 = 93bab6731bdfe8dc1ef069483437270ce7fe5a370f933d40d8d0ef09ba846c0c 7 | 8 | [build] 9 | builder = nop 10 | 11 | [install.files] 12 | osxfuse-osxfuse-3.8.3/common = include 13 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/patchelf: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = patchelf 3 | 4 | [rpms] 5 | patchelf 6 | 7 | [debs] 8 | patchelf 9 | 10 | [pps] 11 | patchelf 12 | 13 | [download] 14 | url = https://github.com/NixOS/patchelf/archive/0.10.tar.gz 15 | sha256 = b3cb6bdedcef5607ce34a350cf0b182eb979f8f7bc31eae55a93a70a3f020d13 16 | 17 | [build] 18 | builder = autoconf 19 | subdir = patchelf-0.10 20 | 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/pcre2: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = pcre2 3 | 4 | [homebrew] 5 | pcre2 6 | 7 | [rpms] 8 | pcre2-devel 9 | pcre-static 10 | 11 | [debs] 12 | libpcre2-dev 13 | 14 | [download] 15 | url = https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.40/pcre2-10.40.tar.bz2 16 | sha256 = 14e4b83c4783933dc17e964318e6324f7cae1bc75d8f3c79bc6969f00c159d68 17 | 18 | [build] 19 | builder = cmake 20 | subdir = pcre2-10.40 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/perl: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = perl 3 | 4 | [download.os=windows] 5 | url = http://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-64bit-portable.zip 6 | sha256 = 935c95ba096fa11c4e1b5188732e3832d330a2a79e9882ab7ba8460ddbca810d 7 | 8 | [build.os=windows] 9 | builder = nop 10 | subdir = perl 11 | 12 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/pexpect: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = pexpect 3 | 4 | [download] 5 | url = https://files.pythonhosted.org/packages/0e/3e/377007e3f36ec42f1b84ec322ee12141a9e10d808312e5738f52f80a232c/pexpect-4.7.0-py2.py3-none-any.whl 6 | sha256 = 2094eefdfcf37a1fdbfb9aa090862c1a4878e5c7e0e7e7088bdb511c558e5cd1 7 | 8 | [build] 9 | builder = python-wheel 10 | 11 | [dependencies] 12 | python-ptyprocess 13 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/proxygen: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = proxygen 3 | fbsource_path = fbcode/proxygen 4 | shipit_project = proxygen 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/proxygen.git 9 | 10 | [build.os=windows] 11 | builder = nop 12 | 13 | [build] 14 | builder = cmake 15 | subdir = . 16 | job_weight_mib = 3072 17 | 18 | [cmake.defines.test=on] 19 | BUILD_TESTS = ON 20 | 21 | [cmake.defines.test=off] 22 | BUILD_TESTS = OFF 23 | 24 | [dependencies] 25 | zlib 26 | gperf 27 | folly 28 | fizz 29 | wangle 30 | mvfst 31 | 32 | [dependencies.test=on] 33 | googletest 34 | 35 | [shipit.pathmap] 36 | fbcode/proxygen/public_tld = . 37 | fbcode/proxygen = proxygen 38 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/python-click: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = python-click 3 | 4 | [download] 5 | url = https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl 6 | sha256 = dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc 7 | 8 | [build] 9 | builder = python-wheel 10 | 11 | [rpms] 12 | python3-click 13 | 14 | [debs] 15 | python3-click 16 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/python-filelock: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = python-filelock 3 | 4 | [download] 5 | url = https://files.pythonhosted.org/packages/31/24/ee722b92f23b9ebd87783e893a75352c048bbbc1f67dce0d63b58b46cb48/filelock-3.3.2-py3-none-any.whl 6 | sha256 = bb2a1c717df74c48a2d00ed625e5a66f8572a3a30baacb7657add1d7bac4097b 7 | 8 | [build] 9 | builder = python-wheel 10 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/python-ptyprocess: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = python-ptyprocess 3 | 4 | [download] 5 | url = https://files.pythonhosted.org/packages/d1/29/605c2cc68a9992d18dada28206eeada56ea4bd07a239669da41674648b6f/ptyprocess-0.6.0-py2.py3-none-any.whl 6 | sha256 = d7cc528d76e76342423ca640335bd3633420dc1366f258cb31d05e865ef5ca1f 7 | 8 | [build] 9 | builder = python-wheel 10 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/python-setuptools: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = python-setuptools 3 | 4 | [download] 5 | url = https://files.pythonhosted.org/packages/c0/7a/3da654f49c95d0cc6e9549a855b5818e66a917e852ec608e77550c8dc08b/setuptools-69.1.1-py3-none-any.whl 6 | sha256 = 02fa291a0471b3a18b2b2481ed902af520c69e8ae0919c13da936542754b4c56 7 | 8 | [build] 9 | builder = python-wheel 10 | 11 | [rpms] 12 | python3-setuptools 13 | 14 | [homebrew] 15 | python-setuptools 16 | 17 | [debs] 18 | python3-setuptools 19 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/python-six: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = python-six 3 | 4 | [download] 5 | url = https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl 6 | sha256 = 3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c 7 | 8 | [build] 9 | builder = python-wheel 10 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/python-toml: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = python-toml 3 | 4 | [download] 5 | url = https://files.pythonhosted.org/packages/a2/12/ced7105d2de62fa7c8fb5fce92cc4ce66b57c95fb875e9318dba7f8c5db0/toml-0.10.0-py2.py3-none-any.whl 6 | sha256 = 235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e 7 | 8 | [build] 9 | builder = python-wheel 10 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/ragel: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = ragel 3 | 4 | [debs] 5 | ragel 6 | 7 | [homebrew] 8 | ragel 9 | 10 | [rpms] 11 | ragel 12 | 13 | [download] 14 | url = https://www.colm.net/files/ragel/ragel-6.10.tar.gz 15 | sha256 = 5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f 16 | 17 | [build] 18 | builder = autoconf 19 | subdir = ragel-6.10 20 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/range-v3: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = range-v3 3 | 4 | [download] 5 | url = https://github.com/ericniebler/range-v3/archive/refs/tags/0.11.0.tar.gz 6 | sha256 = 376376615dbba43d3bef75aa590931431ecb49eb36d07bb726a19f680c75e20c 7 | 8 | 9 | [build] 10 | builder = cmake 11 | subdir = range-v3-0.11.0 12 | 13 | [cmake.defines] 14 | RANGE_V3_EXAMPLES=OFF 15 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/re2: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = re2 3 | 4 | [homebrew] 5 | re2 6 | 7 | [debs] 8 | libre2-dev 9 | 10 | [rpms] 11 | re2 12 | re2-devel 13 | 14 | [pps] 15 | re2 16 | 17 | [download] 18 | url = https://github.com/google/re2/archive/2020-11-01.tar.gz 19 | sha256 = 8903cc66c9d34c72e2bc91722288ebc7e3ec37787ecfef44d204b2d6281954d7 20 | 21 | [build] 22 | builder = cmake 23 | subdir = re2-2020-11-01 24 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/ripgrep: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = ripgrep 3 | 4 | [rpms] 5 | ripgrep 6 | 7 | [debs] 8 | ripgrep 9 | 10 | [homebrew] 11 | ripgrep 12 | 13 | # only used from system packages currently 14 | [build] 15 | builder = nop 16 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/rust-shed: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = rust-shed 3 | fbsource_path = fbcode/common/rust/shed 4 | shipit_project = rust-shed 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebookexperimental/rust-shed.git 9 | 10 | [build] 11 | builder = cargo 12 | 13 | [cargo] 14 | build_doc = true 15 | workspace_dir = 16 | 17 | [shipit.pathmap] 18 | fbcode/common/rust/shed = shed 19 | fbcode/common/rust/shed/public_autocargo = shed 20 | fbcode/common/rust/shed/public_tld = . 21 | tools/rust/ossconfigs = . 22 | 23 | [shipit.strip] 24 | ^fbcode/common/rust/shed/(?!public_autocargo|public_tld).+/Cargo\.toml$ 25 | 26 | [dependencies] 27 | fbthrift 28 | fb303 29 | 30 | # We use the system openssl on linux 31 | [dependencies.not(os=linux)] 32 | openssl 33 | 34 | [dependencies.fbsource=on] 35 | rust 36 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/snappy: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = snappy 3 | 4 | [homebrew] 5 | snappy 6 | 7 | [debs] 8 | libsnappy-dev 9 | 10 | [rpms] 11 | snappy-devel 12 | 13 | [pps] 14 | snappy 15 | 16 | [download] 17 | url = https://github.com/google/snappy/archive/1.1.7.tar.gz 18 | sha256 = 3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4 19 | 20 | [build] 21 | builder = cmake 22 | subdir = snappy-1.1.7 23 | 24 | [cmake.defines] 25 | SNAPPY_BUILD_TESTS = OFF 26 | 27 | # Avoid problems like `relocation R_X86_64_PC32 against symbol` on ELF systems 28 | # when linking rocksdb, which builds PIC even when building a static lib 29 | [cmake.defines.os=linux] 30 | BUILD_SHARED_LIBS = ON 31 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/sparsemap: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = sparsemap 3 | 4 | [download] 5 | url = https://github.com/Tessil/sparse-map/archive/refs/tags/v0.6.2.tar.gz 6 | sha256 = 7020c21e8752e59d72e37456cd80000e18671c803890a3e55ae36b295eba99f6 7 | 8 | [build] 9 | builder = cmake 10 | subdir = sparse-map-0.6.2/ 11 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/sqlite3: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = sqlite3 3 | 4 | [debs] 5 | libsqlite3-dev 6 | sqlite3 7 | 8 | [homebrew] 9 | sqlite 10 | 11 | [rpms] 12 | sqlite-devel 13 | sqlite-libs 14 | sqlite 15 | 16 | [pps] 17 | sqlite3 18 | 19 | [download] 20 | url = https://sqlite.org/2019/sqlite-amalgamation-3280000.zip 21 | sha256 = d02fc4e95cfef672b45052e221617a050b7f2e20103661cda88387349a9b1327 22 | 23 | [dependencies] 24 | cmake 25 | ninja 26 | 27 | [build] 28 | builder = sqlite 29 | subdir = sqlite-amalgamation-3280000 30 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/systemd: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = systemd 3 | 4 | [rpms] 5 | systemd 6 | systemd-devel 7 | 8 | [download] 9 | url = https://github.com/systemd/systemd/archive/refs/tags/v256.7.tar.gz 10 | sha256 = 896d76ff65c88f5fd9e42f90d152b0579049158a163431dd77cdc57748b1d7b0 11 | 12 | 13 | [build] 14 | builder = systemd 15 | subdir = systemd-256.7 16 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/tree: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = tree 3 | 4 | [debs] 5 | tree 6 | 7 | [homebrew] 8 | tree 9 | 10 | [rpms] 11 | tree 12 | 13 | [download.os=linux] 14 | url = https://salsa.debian.org/debian/tree-packaging/-/archive/debian/1.8.0-1/tree-packaging-debian-1.8.0-1.tar.gz 15 | sha256 = a841eee1d52bfd64a48f54caab9937b9bd92935055c48885c4ab1ae4dab7fae5 16 | 17 | [download.os=darwin] 18 | # The official package of tree source requires users of non-Linux platform to 19 | # comment/uncomment certain lines in the Makefile to build for their platform. 20 | # Besauce getdeps.py doesn't have that functionality we just use this custom 21 | # fork of tree which has proper lines uncommented for a OSX build 22 | url = https://github.com/lukaspiatkowski/tree-command/archive/debian/1.8.0-1-macos.tar.gz 23 | sha256 = 9cbe889553d95cf5a2791dd0743795d46a3c092c5bba691769c0e5c52e11229e 24 | 25 | [build.os=linux] 26 | builder = make 27 | subdir = tree-packaging-debian-1.8.0-1 28 | 29 | [build.os=darwin] 30 | builder = make 31 | subdir = tree-command-debian-1.8.0-1-macos 32 | 33 | [build.os=windows] 34 | builder = nop 35 | 36 | [make.install_args] 37 | install 38 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/wangle: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = wangle 3 | fbsource_path = fbcode/wangle 4 | shipit_project = wangle 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/wangle.git 9 | 10 | [build] 11 | builder = cmake 12 | subdir = wangle 13 | 14 | [cmake.defines.test=on] 15 | BUILD_TESTS=ON 16 | 17 | [cmake.defines.test=off] 18 | BUILD_TESTS=OFF 19 | 20 | [dependencies] 21 | folly 22 | googletest 23 | fizz 24 | 25 | [shipit.pathmap] 26 | fbcode/wangle/public_tld = . 27 | fbcode/wangle = wangle 28 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/watchman: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = watchman 3 | fbsource_path = fbcode/watchman 4 | shipit_project = watchman 5 | shipit_fbcode_builder = true 6 | 7 | [git] 8 | repo_url = https://github.com/facebook/watchman.git 9 | 10 | [build] 11 | builder = cmake 12 | 13 | [dependencies] 14 | boost 15 | cpptoml 16 | edencommon 17 | fb303 18 | fbthrift 19 | folly 20 | pcre2 21 | googletest 22 | python-setuptools 23 | 24 | [dependencies.fbsource=on] 25 | rust 26 | 27 | [shipit.pathmap] 28 | fbcode/watchman = watchman 29 | fbcode/watchman/oss = . 30 | fbcode/eden/fs = eden/fs 31 | 32 | [shipit.strip] 33 | ^fbcode/eden/fs/(?!.*\.thrift|service/shipit_test_file\.txt) 34 | 35 | [cmake.defines.fb=on] 36 | ENABLE_EDEN_SUPPORT=ON 37 | IS_FB_BUILD=ON 38 | 39 | # FB macos specific settings 40 | [cmake.defines.all(fb=on,os=darwin)] 41 | # this path is coupled with the FB internal watchman-osx.spec 42 | WATCHMAN_STATE_DIR=/opt/facebook/watchman/var/run/watchman 43 | # tell cmake not to try to create /opt/facebook/... 44 | INSTALL_WATCHMAN_STATE_DIR=OFF 45 | USE_SYS_PYTHON=OFF 46 | 47 | [depends.environment] 48 | WATCHMAN_VERSION_OVERRIDE 49 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/xxhash: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = xxhash 3 | 4 | [download] 5 | url = https://github.com/Cyan4973/xxHash/archive/refs/tags/v0.8.2.tar.gz 6 | sha256 = baee0c6afd4f03165de7a4e67988d16f0f2b257b51d0e3cb91909302a26a79c4 7 | 8 | [rpms] 9 | xxhash-devel 10 | 11 | [debs] 12 | libxxhash-dev 13 | xxhash 14 | 15 | [homebrew] 16 | xxhash 17 | 18 | [build.not(os=windows)] 19 | builder = make 20 | subdir = xxHash-0.8.2 21 | 22 | [make.build_args] 23 | all 24 | 25 | [make.install_args] 26 | install 27 | 28 | [build.os=windows] 29 | builder = cmake 30 | subdir = xxHash-0.8.2/cmake_unofficial 31 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/xz: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = xz 3 | 4 | # ubuntu's package causes watchman's tests to hang 5 | [debs.not(distro=ubuntu)] 6 | liblzma-dev 7 | 8 | [homebrew] 9 | xz 10 | 11 | [rpms] 12 | xz-devel 13 | 14 | [download] 15 | url = https://tukaani.org/xz/xz-5.2.5.tar.gz 16 | sha256 = f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10 17 | 18 | [build] 19 | builder = autoconf 20 | subdir = xz-5.2.5 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/yaml-cpp: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = yaml-cpp 3 | 4 | [download] 5 | url = https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.2.tar.gz 6 | sha256 = e4d8560e163c3d875fd5d9e5542b5fd5bec810febdcba61481fe5fc4e6b1fd05 7 | 8 | [build.os=linux] 9 | builder = cmake 10 | subdir = yaml-cpp-yaml-cpp-0.6.2 11 | 12 | [build.not(os=linux)] 13 | builder = nop 14 | 15 | [dependencies] 16 | boost 17 | googletest 18 | 19 | [cmake.defines] 20 | YAML_CPP_BUILD_TESTS=OFF 21 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/zlib: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = zlib 3 | 4 | [debs] 5 | zlib1g-dev 6 | 7 | [homebrew] 8 | zlib 9 | 10 | [rpms.not(distro=fedora)] 11 | zlib-devel 12 | zlib-static 13 | 14 | [rpms.distro=fedora] 15 | zlib-ng-compat-devel 16 | zlib-ng-compat-static 17 | 18 | [pps] 19 | zlib 20 | 21 | [download] 22 | url = https://zlib.net/zlib-1.3.1.tar.gz 23 | sha256 = 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 24 | 25 | [build] 26 | builder = cmake 27 | subdir = zlib-1.3.1 28 | patchfile = zlib_dont_build_more_than_needed.patch 29 | -------------------------------------------------------------------------------- /build/fbcode_builder/manifests/zstd: -------------------------------------------------------------------------------- 1 | [manifest] 2 | name = zstd 3 | 4 | [homebrew] 5 | zstd 6 | 7 | # 18.04 zstd is too old 8 | [debs.not(all(distro=ubuntu,distro_vers="18.04"))] 9 | libzstd-dev 10 | zstd 11 | 12 | [rpms] 13 | libzstd-devel 14 | libzstd 15 | 16 | [pps] 17 | zstd 18 | 19 | [download] 20 | url = https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz 21 | sha256 = 9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4 22 | 23 | [build] 24 | builder = cmake 25 | subdir = zstd-1.5.5/build/cmake 26 | 27 | # The zstd cmake build explicitly sets the install name 28 | # for the shared library in such a way that cmake discards 29 | # the path to the library from the install_name, rendering 30 | # the library non-resolvable during the build. The short 31 | # term solution for this is just to link static on macos. 32 | # 33 | # And while we're at it, let's just always link statically. 34 | [cmake.defines] 35 | ZSTD_BUILD_SHARED = OFF 36 | -------------------------------------------------------------------------------- /build/fbcode_builder/patches/boost_comparator_operator_fix.patch: -------------------------------------------------------------------------------- 1 | diff --git a/boost/serialization/strong_typedef.hpp b/boost/serialization/strong_typedef.hpp 2 | --- a/boost/serialization/strong_typedef.hpp 3 | +++ b/boost/serialization/strong_typedef.hpp 4 | @@ -44,6 +44,7 @@ 5 | operator const T&() const {return t;} \ 6 | operator T&() {return t;} \ 7 | bool operator==(const D& rhs) const {return t == rhs.t;} \ 8 | + bool operator==(const T& lhs) const {return t == lhs;} \ 9 | bool operator<(const D& rhs) const {return t < rhs.t;} \ 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /build/fbcode_builder/patches/iproute2_oss.patch: -------------------------------------------------------------------------------- 1 | diff --git a/bridge/fdb.c b/bridge/fdb.c 2 | --- a/bridge/fdb.c 3 | +++ b/bridge/fdb.c 4 | @@ -31,7 +31,7 @@ 5 | 6 | static unsigned int filter_index, filter_vlan, filter_state; 7 | 8 | -json_writer_t *jw_global; 9 | +static json_writer_t *jw_global; 10 | 11 | static void usage(void) 12 | { 13 | diff --git a/ip/ipmroute.c b/ip/ipmroute.c 14 | --- a/ip/ipmroute.c 15 | +++ b/ip/ipmroute.c 16 | @@ -44,7 +44,7 @@ 17 | exit(-1); 18 | } 19 | 20 | -struct rtfilter { 21 | +static struct rtfilter { 22 | int tb; 23 | int af; 24 | int iif; 25 | diff --git a/ip/xfrm_monitor.c b/ip/xfrm_monitor.c 26 | --- a/ip/xfrm_monitor.c 27 | +++ b/ip/xfrm_monitor.c 28 | @@ -34,7 +34,7 @@ 29 | #include "ip_common.h" 30 | 31 | static void usage(void) __attribute__((noreturn)); 32 | -int listen_all_nsid; 33 | +static int listen_all_nsid; 34 | 35 | static void usage(void) 36 | { 37 | -------------------------------------------------------------------------------- /build/fbcode_builder/patches/libiberty_install_pic_lib.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile.in b/Makefile.in 2 | index b77a41c..cbe71fe 100644 3 | --- a/Makefile.in 4 | +++ b/Makefile.in 5 | @@ -389,7 +389,7 @@ MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` 6 | install_to_libdir: all 7 | if test -n "${target_header_dir}"; then \ 8 | ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \ 9 | - $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n; \ 10 | + $(INSTALL_DATA) pic/$(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n; \ 11 | ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ); \ 12 | mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB); \ 13 | case "${target_header_dir}" in \ 14 | -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | too-many-lines-threshold = 200 2 | await-holding-invalid-types = [ 3 | { path = "tracing::span::Entered", reason = "`Entered` is not aware when a function is suspended: https://docs.rs/tracing/latest/tracing/struct.Span.html#in-asynchronous-code" }, 4 | { path = "tracing::span::EnteredSpan", reason = "`EnteredSpan` is not aware when a function is suspended: https://docs.rs/tracing/latest/tracing/struct.Span.html#in-asynchronous-code" }, 5 | ] 6 | -------------------------------------------------------------------------------- /install-system-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # vim:ts=2:sw=2:et: 3 | # Copyright (c) Meta Platforms, Inc. and affiliates. 4 | # 5 | # This source code is licensed under the MIT license found in the 6 | # LICENSE file in the root directory of this source tree. 7 | 8 | set -x 9 | python3 "$(dirname "$0")/build/fbcode_builder/getdeps.py" install-system-deps --recursive watchman 10 | -------------------------------------------------------------------------------- /run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # vim:ts=2:sw=2:et: 3 | # Copyright (c) Meta Platforms, Inc. and affiliates. 4 | # 5 | # This source code is licensed under the MIT license found in the 6 | # LICENSE file in the root directory of this source tree. 7 | 8 | set -x 9 | python3 "$(dirname "$0")/build/fbcode_builder/getdeps.py" test --allow-system-packages --no-testpilot watchman 10 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | # Get help on options with `rustfmt --help=config` 2 | # Please keep these in alphabetical order. 3 | edition = "2021" 4 | format_code_in_doc_comments = true 5 | group_imports = "StdExternalCrate" 6 | imports_granularity = "Item" 7 | merge_derives = false 8 | style_edition = "2024" 9 | use_field_init_shorthand = true 10 | -------------------------------------------------------------------------------- /watchman/.clang-tidy: -------------------------------------------------------------------------------- 1 | # NOTE there must be no spaces before the '-', so put the comma after. 2 | # When making changes, be sure to verify the output of the following command to ensure 3 | # the desired checks are enabled (run from the directory containing a .clang-tidy file): 4 | # `clang-tidy -- --dump-config` 5 | # NOTE: Please don't disable inheritance from the parent to make sure that common checks get propagated. 6 | --- 7 | InheritParentConfig: true 8 | Checks: ' 9 | facebook-hte-PortabilityInclude-gflags/gflags.h, 10 | -facebook-hte-RelativeInclude, 11 | ' 12 | ... 13 | -------------------------------------------------------------------------------- /watchman/.projectid: -------------------------------------------------------------------------------- 1 | watchman 2 | -------------------------------------------------------------------------------- /watchman/ClientContext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "eden/common/utils/ProcessInfoCache.h" 11 | 12 | namespace watchman { 13 | /** 14 | * A struct containing information about the client that is triggering some 15 | * action in watchman. Currently used for telemetry. 16 | */ 17 | struct ClientContext { 18 | pid_t clientPid; 19 | std::optional clientInfo; 20 | }; 21 | 22 | } // namespace watchman 23 | -------------------------------------------------------------------------------- /watchman/Connect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "watchman/Result.h" 12 | 13 | namespace watchman { 14 | class Stream; 15 | } 16 | 17 | /** 18 | * Connect to a running Watchman instance via unix socket or a named pipe. 19 | * 20 | * Returns a connected stream, or an errno upon error. 21 | */ 22 | watchman::ResultErrno> w_stm_connect( 23 | int timeoutms); 24 | -------------------------------------------------------------------------------- /watchman/Constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace watchman { 13 | 14 | inline constexpr uint32_t kIoBufSize = 1024 * 1024; 15 | inline constexpr uint32_t kBatchLimit = 16 * 1024; 16 | 17 | } // namespace watchman 18 | 19 | #define WATCHMAN_IO_BUF_SIZE (::watchman::kIoBufSize) 20 | #define WATCHMAN_BATCH_LIMIT (::watchman::kBatchLimit) 21 | -------------------------------------------------------------------------------- /watchman/Cookie.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "watchman/watchman_string.h" 12 | 13 | namespace watchman { 14 | 15 | inline constexpr std::string_view kCookiePrefix = ".watchman-cookie-"; 16 | 17 | /** 18 | * We need to guarantee that we never collapse a cookie notification 19 | * out of the pending list, because we absolutely must observe it coming 20 | * in via the kernel notification mechanism in order for synchronization 21 | * to be correct. 22 | * Since we don't have a Root available, we can't tell what the 23 | * precise cookie prefix is for the current pending list here, so 24 | * we do a substring match. Not the most elegant thing in the world. 25 | */ 26 | inline bool isPossiblyACookie(w_string_piece path) { 27 | return path.contains(kCookiePrefix); 28 | } 29 | 30 | } // namespace watchman 31 | -------------------------------------------------------------------------------- /watchman/FlagMap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/FlagMap.h" 9 | #include 10 | #include 11 | 12 | void w_expand_flags( 13 | const struct flag_map* fmap, 14 | uint32_t flags, 15 | char* buf, 16 | size_t len) { 17 | bool first = true; 18 | *buf = '\0'; 19 | while (fmap->label && len) { 20 | if ((flags & fmap->value) == fmap->value) { 21 | size_t space; 22 | 23 | if (!first) { 24 | *buf = ' '; 25 | buf++; 26 | len--; 27 | } else { 28 | first = false; 29 | } 30 | 31 | space = std::min(len, strlen(fmap->label) + 1); 32 | memcpy(buf, fmap->label, space); 33 | 34 | len -= space - 1; 35 | buf += space - 1; 36 | } 37 | fmap++; 38 | } 39 | } 40 | 41 | /* vim:ts=2:sw=2:et: 42 | */ 43 | -------------------------------------------------------------------------------- /watchman/FlagMap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | struct flag_map { 14 | uint32_t value; 15 | const char* label; 16 | }; 17 | 18 | /** 19 | * Given a flag map in `fmap`, and a set of flags in `flags`, 20 | * expand the flag bits that are set in `flags` into the corresponding 21 | * labels in `fmap` and print the result into the caller provided 22 | * buffer `buf` of size `len` bytes. 23 | */ 24 | void w_expand_flags( 25 | const struct flag_map* fmap, 26 | uint32_t flags, 27 | char* buf, 28 | size_t len); 29 | -------------------------------------------------------------------------------- /watchman/GroupLookup.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/GroupLookup.h" 9 | #include 10 | #include "watchman/Logging.h" 11 | 12 | #ifndef _WIN32 13 | #include 14 | #include 15 | #include 16 | #include 17 | #endif 18 | 19 | #ifndef _WIN32 20 | using namespace watchman; 21 | 22 | const struct group* w_get_group(const char* group_name) { 23 | // This explicit errno statement is necessary to distinguish between the 24 | // group not existing and an error. 25 | errno = 0; 26 | struct group* group = getgrnam(group_name); 27 | if (!group) { 28 | if (errno == 0) { 29 | logf(ERR, "group '{}' does not exist\n", group_name); 30 | } else { 31 | logf( 32 | ERR, 33 | "getting gid for '{}' failed: {}\n", 34 | group_name, 35 | folly::errnoStr(errno)); 36 | } 37 | return nullptr; 38 | } 39 | return group; 40 | } 41 | #endif // ndef _WIN32 42 | -------------------------------------------------------------------------------- /watchman/GroupLookup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #ifndef _WIN32 11 | 12 | #include 13 | /** 14 | * Gets the group struct for the given group name. The return value may point 15 | * to a static area so it should be used immediately and not passed to free(3). 16 | * 17 | * Returns null on failure. 18 | */ 19 | const struct group* w_get_group(const char* group_name); 20 | #endif // _WIN32 21 | -------------------------------------------------------------------------------- /watchman/LogConfig.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/LogConfig.h" 9 | #include "watchman/Logging.h" 10 | 11 | namespace watchman::logging { 12 | 13 | int log_level = LogLevel::ERR; 14 | std::string log_name; 15 | 16 | } // namespace watchman::logging 17 | -------------------------------------------------------------------------------- /watchman/LogConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace watchman::logging { 13 | 14 | extern int log_level; 15 | extern std::string log_name; 16 | 17 | } // namespace watchman::logging 18 | -------------------------------------------------------------------------------- /watchman/Poison.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | #include "watchman/watchman_string.h" 14 | 15 | namespace watchman { 16 | 17 | /** 18 | * Some error conditions will put us into a non-recoverable state where we 19 | * can't guarantee that we will be operating correctly. Rather than suffering 20 | * in silence and misleading our clients, we'll poison ourselves and advertise 21 | * that we have done so and provide some advice on how the user can cure us. 22 | */ 23 | extern folly::Synchronized poisoned_reason; 24 | 25 | void set_poison_state( 26 | w_string_piece dir, 27 | std::chrono::system_clock::time_point now, 28 | const char* syscall, 29 | const std::error_code& err); 30 | 31 | } // namespace watchman 32 | -------------------------------------------------------------------------------- /watchman/ProcessUtil.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/ProcessUtil.h" 9 | 10 | #include "eden/common/utils/ProcessInfoCache.h" 11 | 12 | namespace watchman { 13 | 14 | using namespace facebook::eden; 15 | 16 | namespace { 17 | ProcessInfoCache& getProcessInfoCache() { 18 | static auto* pic = new ProcessInfoCache; 19 | return *pic; 20 | } 21 | } // namespace 22 | 23 | ProcessInfoHandle lookupProcessInfo(pid_t pid) { 24 | return getProcessInfoCache().lookup(pid); 25 | } 26 | 27 | } // namespace watchman 28 | -------------------------------------------------------------------------------- /watchman/ProcessUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace facebook::eden { 13 | class ProcessInfoHandle; 14 | } 15 | 16 | namespace watchman { 17 | 18 | using ProcessInfoHandle = facebook::eden::ProcessInfoHandle; 19 | 20 | ProcessInfoHandle lookupProcessInfo(pid_t pid); 21 | 22 | } // namespace watchman 23 | -------------------------------------------------------------------------------- /watchman/SanityCheck.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace watchman { 11 | void startSanityCheckThread(); 12 | } 13 | -------------------------------------------------------------------------------- /watchman/Shutdown.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/Shutdown.h" 9 | #include 10 | #include 11 | #include "watchman/watchman_stream.h" 12 | 13 | namespace { 14 | 15 | static std::vector> listener_thread_events; 16 | static std::atomic stopping = false; 17 | 18 | } // namespace 19 | 20 | bool w_is_stopping() { 21 | return stopping.load(std::memory_order_relaxed); 22 | } 23 | 24 | void w_request_shutdown() { 25 | stopping.store(true, std::memory_order_relaxed); 26 | // Knock listener thread out of poll/accept 27 | for (auto& evt : listener_thread_events) { 28 | evt->notify(); 29 | } 30 | } 31 | 32 | void w_push_listener_thread_event(std::shared_ptr event) { 33 | listener_thread_events.push_back(std::move(event)); 34 | } 35 | -------------------------------------------------------------------------------- /watchman/Shutdown.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace watchman { 13 | class Event; 14 | } 15 | 16 | using watchman_event = watchman::Event; 17 | 18 | bool w_is_stopping(); 19 | void w_request_shutdown(); 20 | void w_push_listener_thread_event(std::shared_ptr event); 21 | -------------------------------------------------------------------------------- /watchman/SignalHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace watchman { 11 | 12 | void setup_signal_handlers(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /watchman/UserDir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace watchman { 13 | 14 | /** 15 | * Returns the username of the current user. 16 | */ 17 | std::string computeUserName(); 18 | 19 | /** 20 | * Returns a cached reference to the current user's temporary directory. 21 | */ 22 | const std::string& getTemporaryDirectory(); 23 | 24 | /** 25 | * Computes the Watchman state directory corresponding to the given user name. 26 | */ 27 | std::string computeWatchmanStateDirectory(const std::string& user); 28 | 29 | } // namespace watchman 30 | -------------------------------------------------------------------------------- /watchman/XattrUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace watchman { 11 | 12 | /** 13 | * Sets extended attributes for the given path to allow secondary group access. 14 | * This function avoids needing to use chmod which wont work if the user is not 15 | * a member of the secondary group. 16 | * 17 | * @param path The path to to set attributes on 18 | * @param secondary_group_name The name of the secondary group 19 | * @param read If the secondary group should be given read permissions 20 | * @param write If the secondary group should be given write permissions 21 | * @param execute If the secondary group should be given execute permissions 22 | * @return On Linux, true if the attributes were set successfully, false on 23 | * error. Always returns false on non-Linux 24 | */ 25 | bool setSecondaryGroupACL( 26 | const char* path, 27 | const char* secondary_group_name, 28 | bool read, 29 | bool write, 30 | bool execute); 31 | 32 | } // namespace watchman 33 | -------------------------------------------------------------------------------- /watchman/build/package/fedora-env/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG FEDORA_VERSION 2 | FROM fedora:$FEDORA_VERSION 3 | 4 | RUN dnf install -y gcc g++ git openssl-devel rpmdevtools 5 | 6 | RUN curl https://sh.rustup.rs -sSf | sh -s -- -y 7 | ENV PATH="/root/.cargo/bin:${PATH}" 8 | 9 | # Avoid build output from Watchman's build getting buffered in large 10 | # chunks, which makes debugging progress tough. 11 | ENV PYTHONUNBUFFERED=1 12 | -------------------------------------------------------------------------------- /watchman/build/package/make-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | cd "$(dirname "$0")" 8 | 9 | # buildkit truncates log output. 10 | # https://stackoverflow.com/questions/65819424/is-there-a-way-to-increase-the-log-size-in-docker-when-building-a-container 11 | export DOCKER_BUILDKIT=0 12 | 13 | DB="docker build --progress plain" 14 | 15 | UBUNTU_VERSIONS="18 20 22" 16 | 17 | # There may be an opportunity to run some of these in parallel. 18 | for uv in $UBUNTU_VERSIONS; do 19 | $DB --build-arg "UBUNTU_VERSION=$uv.04" -t "watchman-ubuntu-$uv-env" ubuntu-env 20 | 21 | $DB --build-arg "BASE_IMAGE=watchman-ubuntu-$uv-env" -t "watchman-ubuntu-$uv-build" watchman-build 22 | 23 | $DB --build-arg "BASE_IMAGE=watchman-ubuntu-$uv-build" -t "watchman-ubuntu-$uv-deb" watchman-deb 24 | 25 | mkdir -p "_debs/ubuntu-$uv" 26 | 27 | docker run --rm --mount "type=bind,source=$(pwd)/_debs,target=/_out" "watchman-ubuntu-$uv-deb" sh -c "cp /_debs/* /_out/ubuntu-$uv" 28 | done 29 | -------------------------------------------------------------------------------- /watchman/build/package/ubuntu-env/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG UBUNTU_VERSION 2 | FROM ubuntu:$UBUNTU_VERSION 3 | 4 | # https://serverfault.com/a/1016972 to ensure installing tzdata does 5 | # not result in a prompt that hangs forever. 6 | ENV DEBIAN_FRONTEND=noninteractive 7 | ENV TZ=Etc/UTC 8 | 9 | RUN apt-get -y update 10 | RUN apt-get -y install python3 gcc g++ libssl-dev curl sudo 11 | 12 | # Ubuntu 18.04 has an older version of Git, which causes actions/checkout@v3 13 | # to check out the repository with REST, breaking version number generation. 14 | RUN apt-get -y install software-properties-common 15 | RUN add-apt-repository -y ppa:git-core/ppa 16 | RUN apt-get -y install git 17 | 18 | RUN curl https://sh.rustup.rs -sSf | sh -s -- -y 19 | ENV PATH="/root/.cargo/bin:${PATH}" 20 | 21 | # Avoid build output from Watchman's build getting buffered in large 22 | # chunks, which makes debugging progress tough. 23 | ENV PYTHONUNBUFFERED=1 24 | -------------------------------------------------------------------------------- /watchman/build/package/watchman-build/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | WORKDIR /watchman 5 | RUN ./install-system-packages.sh 6 | 7 | # Clean up the temporary build artifacts so the image is smaller. 8 | RUN ./autogen.sh && rm -rf /tmp/fbcode_builder_getdeps* 9 | -------------------------------------------------------------------------------- /watchman/build/package/watchman-deb/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: watchman 2 | Version: %VERSION% 3 | Architecture: amd64 4 | Maintainer: Meta Platforms, Inc. 5 | Standards-Version: 4.6.1.1 6 | Description: A file watching service 7 | Depends: %DEPENDS% 8 | -------------------------------------------------------------------------------- /watchman/build/package/watchman-deb/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | case "$1" in 4 | configure) 5 | mkdir -p /usr/local/var/run/watchman 6 | chmod 2777 /usr/local/var/run/watchman 7 | ;; 8 | 9 | abort-upgrade|abort-remove|abort-deconfigure) 10 | ;; 11 | 12 | *) 13 | echo "postinst called with unknown argument \`$1'" >&2 14 | exit 1 15 | ;; 16 | esac 17 | 18 | # dh_installdeb will replace this with shell code automatically 19 | # generated by other debhelper scripts. 20 | 21 | #DEBHELPER# 22 | 23 | exit 0 24 | -------------------------------------------------------------------------------- /watchman/build/package/watchman-deb/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | WORKDIR /watchman 5 | 6 | ENV BUILT="/watchman/built" 7 | 8 | ADD make-deb.sh /watchman/build/make-deb.sh 9 | ADD DEBIAN /watchman/watchman/build/package/DEBIAN 10 | 11 | # TODO: make a debugsymbols package 12 | RUN strip built/bin/* 13 | 14 | RUN /watchman/build/make-deb.sh 15 | -------------------------------------------------------------------------------- /watchman/build/package/watchman.spec: -------------------------------------------------------------------------------- 1 | Name: watchman 2 | Version: %{version} 3 | Release: 1%{?dist} 4 | License: MIT 5 | Summary: A file watching service 6 | URL: https://facebook.github.io/watchman/ 7 | 8 | %description 9 | 10 | A file watching service. 11 | 12 | %build 13 | 14 | %install 15 | mkdir -p %{buildroot}%{prefix} 16 | cp -rvp %{image}/* %{buildroot}%{prefix} 17 | 18 | %files 19 | %defattr(-, root, root, -) 20 | %{prefix}bin/watchman 21 | %{prefix}bin/watchmanctl 22 | 23 | %post 24 | 25 | mkdir -p %{prefix}/var/run/watchman 26 | chmod 2777 %{prefix}/var/run/watchman 27 | -------------------------------------------------------------------------------- /watchman/build/vagrant/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant/ 2 | -------------------------------------------------------------------------------- /watchman/build/vagrant/README.md: -------------------------------------------------------------------------------- 1 | # Vagrant VMs for Validating Watchman Builds 2 | 3 | Watchman uses GitHub Actions for CI, but sometimes it's useful to have 4 | reproducible, bare environments representative of where people 5 | typically attempt to build Watchman. 6 | 7 | This Vagrantfile provides some provisioned VMs with the minimal set of 8 | dependencies required to build and run Watchman. 9 | 10 | None of the VMs will autostart, so they must be specified explicitly 11 | to `vagrant up`. When running `vagrant up` or `vagrant provision`, 12 | ensure the `WATCHMAN_SOURCE` environment variable contains a path to 13 | the Watchman source directory. 14 | -------------------------------------------------------------------------------- /watchman/cli/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | if (IS_FB_BUILD) 7 | rust_executable(watchmanctl FEATURES fb) 8 | else() 9 | rust_executable(watchmanctl) 10 | endif() 11 | 12 | install_rust_executable(watchmanctl) 13 | -------------------------------------------------------------------------------- /watchman/cmds/heapprof.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include "watchman/Client.h" 12 | #include "watchman/watchman_cmd.h" 13 | 14 | using namespace watchman; 15 | 16 | #if defined(FOLLY_USE_JEMALLOC) 17 | 18 | // This command is present to manually trigger a heap profile dump when 19 | // jemalloc is in use. 20 | static UntypedResponse cmd_debug_prof_dump(Client*, const json_ref&) { 21 | if (!folly::usingJEMalloc()) { 22 | throw std::runtime_error("jemalloc is not in use"); 23 | } 24 | 25 | auto result = mallctl("prof.dump", nullptr, nullptr, nullptr, 0); 26 | UntypedResponse resp; 27 | resp.set( 28 | "prof.dump", 29 | w_string_to_json( 30 | fmt::format("mallctl prof.dump returned: {}", folly::errnoStr(result)) 31 | .c_str())); 32 | return resp; 33 | } 34 | W_CMD_REG("debug-prof-dump", cmd_debug_prof_dump, CMD_DAEMON, nullptr); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /watchman/cppclient/WatchmanResponseError.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "WatchmanConnection.h" 9 | 10 | namespace watchman { 11 | 12 | using namespace folly; 13 | 14 | static const dynamic kError("error"); 15 | 16 | WatchmanResponseError::WatchmanResponseError(const folly::dynamic& response) 17 | : WatchmanError(response[kError].c_str()), response_(response) {} 18 | 19 | const folly::dynamic& WatchmanResponseError::getResponse() const { 20 | return response_; 21 | } 22 | } // namespace watchman 23 | -------------------------------------------------------------------------------- /watchman/cppclient/watchmanclient.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: watchmanclient 7 | Description: Watchman C++ client library 8 | Requires: libfolly 9 | Version: 0 10 | Libs: -L${libdir} -lwatchmanclient 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /watchman/fs/DirHandle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "watchman/fs/FileInformation.h" 12 | 13 | namespace watchman { 14 | 15 | struct DirEntry { 16 | bool has_stat; 17 | const char* d_name; 18 | FileInformation stat; 19 | }; 20 | 21 | class DirHandle { 22 | public: 23 | virtual ~DirHandle() = default; 24 | virtual const DirEntry* readDir() = 0; 25 | #ifndef _WIN32 26 | virtual int getFd() const = 0; 27 | #endif 28 | }; 29 | 30 | /** 31 | * Returns a dir handle to path. 32 | * Does not follow symlinks if strict == true. 33 | * Throws std::system_error if the dir could not be opened. 34 | */ 35 | std::unique_ptr openDir(const char* path, bool strict = true); 36 | 37 | } // namespace watchman 38 | -------------------------------------------------------------------------------- /watchman/fs/FSDetect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include "watchman/fs/FileDescriptor.h" 13 | #include "watchman/watchman_string.h" 14 | 15 | namespace watchman { 16 | 17 | /** Returns CaseSensitive or CaseInSensitive depending on the 18 | * case sensitivity of the input path. */ 19 | CaseSensitivity getCaseSensitivityForPath(const char* path); 20 | 21 | } // namespace watchman 22 | 23 | // Returns the name of the filesystem for the specified path 24 | w_string w_fstype(const char* path); 25 | std::optional find_fstype_in_linux_proc_mounts( 26 | std::string_view path, 27 | std::string_view procMountsData); 28 | -------------------------------------------------------------------------------- /watchman/fs/Pipe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | #include "watchman/fs/FileDescriptor.h" 10 | 11 | namespace watchman { 12 | 13 | // Convenience for constructing a Pipe 14 | class Pipe { 15 | public: 16 | FileDescriptor read; 17 | FileDescriptor write; 18 | 19 | // Construct a pipe, setting the close-on-exec and 20 | // non-blocking bits. 21 | Pipe(); 22 | }; 23 | 24 | // Convenience for constructing a SocketPair 25 | class SocketPair { 26 | public: 27 | FileDescriptor read; 28 | FileDescriptor write; 29 | 30 | // Construct a socketpair, setting the close-on-exec and 31 | // non-blocking bits. 32 | SocketPair(); 33 | }; 34 | 35 | } // namespace watchman 36 | -------------------------------------------------------------------------------- /watchman/fs/WindowsTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | namespace watchman { 14 | 15 | #ifdef _WIN32 16 | 17 | void FILETIME_to_timespec(const FILETIME* ft, timespec* ts); 18 | void FILETIME_LARGE_INTEGER_to_timespec(LARGE_INTEGER ft, timespec* ts); 19 | 20 | #endif 21 | 22 | } // namespace watchman 23 | -------------------------------------------------------------------------------- /watchman/fuzz/BserDecode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/bser.h" 9 | 10 | extern "C" int LLVMFuzzerTestOneInput(void const* data, size_t size) { 11 | auto* d = reinterpret_cast(data); 12 | try { 13 | bunser(d, d + size); 14 | } catch (const BserParseError&) { 15 | // Caught parse errors are okay. 16 | } 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /watchman/fuzz/JsonDecode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/thirdparty/jansson/jansson.h" 9 | 10 | extern "C" int LLVMFuzzerTestOneInput(void const* data, size_t size) { 11 | json_error_t err{}; 12 | auto* d = reinterpret_cast(data); 13 | try { 14 | json_loadb(d, size, JSON_DECODE_ANY, &err); 15 | } catch (std::exception&) { 16 | // Catchable exceptions are okay. 17 | } 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /watchman/fuzz/PyBserDecode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/python/pywatchman/bser.h" 9 | 10 | extern "C" int LLVMFuzzerTestOneInput(void const* data, size_t size) { 11 | // libfuzzer is not happy if Py_Initialize initializes signal handlers. 12 | Py_InitializeEx(0); 13 | 14 | auto* d = reinterpret_cast(data); 15 | unser_ctx_t ctx{}; 16 | ctx.is_mutable = false; 17 | ctx.value_encoding = nullptr; 18 | ctx.value_errors = nullptr; 19 | ctx.bser_version = 1; 20 | ctx.bser_capabilities = 0; 21 | 22 | PyObject* parsed = bser_loads_recursive(&d, d + size, &ctx); 23 | if (!parsed) { 24 | // Raised parse errors are okay. 25 | PyErr_Clear(); 26 | return 0; 27 | } 28 | Py_DECREF(parsed); 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /watchman/integration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/watchman/integration/__init__.py -------------------------------------------------------------------------------- /watchman/integration/cat.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | 8 | import sys 9 | 10 | 11 | args = sys.argv[1:] 12 | 13 | if not args: 14 | args = ["-"] 15 | 16 | for file_name in args: 17 | if file_name == "-": 18 | sys.stdout.write(sys.stdin.read()) 19 | else: 20 | with open(file_name, "rb") as f: 21 | sys.stdout.write(f.read()) 22 | -------------------------------------------------------------------------------- /watchman/integration/eden/BUCK: -------------------------------------------------------------------------------- 1 | load("@fbcode//eden:defs.bzl", "get_test_env_and_deps") 2 | load("@fbcode//watchman/integration:defs.bzl", "eden_integration_env") 3 | load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") 4 | 5 | oncall("scm_client_infra") 6 | 7 | artifacts = get_test_env_and_deps("-oss") 8 | 9 | python_unittest( 10 | name = "eden", 11 | srcs = glob(["test_eden*.py"]), 12 | compatible_with = [ 13 | "ovr_config//os:linux", 14 | ], 15 | env = eden_integration_env(artifacts["env"]), 16 | typing = True, 17 | deps = [ 18 | "//eden/fs/service:thrift-py-deprecated", 19 | "//eden/integration/lib:lib", 20 | "//watchman/integration/lib:lib", 21 | "//watchman/python/pywatchman:pywatchman", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /watchman/integration/eden/test_eden_shutdown.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # pyre-strict 7 | 8 | from eden.integration.lib import hgrepo 9 | from watchman.integration.lib import WatchmanEdenTestCase, WatchmanInstance 10 | 11 | 12 | class TestEdenShutdown(WatchmanEdenTestCase.WatchmanEdenTestCase): 13 | def test_shutdown_and_restart(self) -> None: 14 | def populate(repo: hgrepo.HgRepository) -> None: 15 | repo.write_file("hello", "hola\n") 16 | repo.commit("initial commit.") 17 | 18 | root = self.makeEdenMount(populate) 19 | 20 | inst = WatchmanInstance.Instance() 21 | _, stderr = inst.commandViaCLI(["watch", root]) 22 | self.assertEqual(stderr, b"") 23 | _, stderr = inst.commandViaCLI(["shutdown-server"]) 24 | self.assertEqual(stderr, b"") 25 | _, stderr = inst.commandViaCLI(["get-sockname"]) 26 | self.assertEqual(stderr, b"") 27 | -------------------------------------------------------------------------------- /watchman/integration/eden/test_eden_takeover.py: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sw=4:et: 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # pyre-unsafe 8 | 9 | from watchman.integration.lib import WatchmanEdenTestCase 10 | 11 | 12 | def populate(repo): 13 | repo.write_file(".watchmanconfig", '{"ignore_dirs":[".buckd"]}') 14 | repo.write_file("hello", "hola\n") 15 | repo.commit("initial commit.") 16 | 17 | 18 | class TestEdenTakeover(WatchmanEdenTestCase.WatchmanEdenTestCase): 19 | def test_eden_takeover(self) -> None: 20 | root = self.makeEdenMount(populate) 21 | self.eden.graceful_restart() 22 | 23 | self.watchmanCommand("watch", root) 24 | watch_list = self.getWatchList() 25 | self.assertEqual(len(watch_list), 1) 26 | self.assertEqual(watch_list[0], root) 27 | -------------------------------------------------------------------------------- /watchman/integration/eden/test_eden_watch_root.py: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sw=4:et: 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # pyre-unsafe 8 | 9 | 10 | import os 11 | 12 | import pywatchman 13 | from watchman.integration.lib import WatchmanEdenTestCase 14 | 15 | 16 | class TestEdenWatchRoot(WatchmanEdenTestCase.WatchmanEdenTestCase): 17 | def test_eden_watch_root(self) -> None: 18 | def populate(repo): 19 | repo.write_file("adir/file", "foo!\n") 20 | repo.commit("initial commit.") 21 | 22 | root = self.makeEdenMount(populate) 23 | 24 | with self.assertRaises(pywatchman.WatchmanError) as ctx: 25 | self.watchmanCommand("watch", os.path.join(root, "adir")) 26 | self.assertRegex( 27 | str(ctx.exception), 28 | ( 29 | "unable to resolve root .*: eden: you may only watch " 30 | + "from the root of an eden mount point." 31 | ), 32 | ) 33 | -------------------------------------------------------------------------------- /watchman/integration/facebook/BUCK: -------------------------------------------------------------------------------- 1 | load("@fbcode//watchman/integration:defs.bzl", "integration_env") 2 | load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") 3 | 4 | oncall("scm_client_infra") 5 | 6 | python_unittest( 7 | name = "integration", 8 | srcs = glob(["test_*.py"]), 9 | compatible_with = [ 10 | "ovr_config//os:linux", 11 | ], 12 | env = integration_env(), 13 | supports_static_listing = False, 14 | typing = True, 15 | deps = [ 16 | "//watchman/integration/lib:lib", 17 | "//watchman/python/pywatchman:pywatchman", 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /watchman/integration/lib/BUCK: -------------------------------------------------------------------------------- 1 | load("@fbcode_macros//build_defs:python_library.bzl", "python_library") 2 | 3 | oncall("scm_client_infra") 4 | 5 | python_library( 6 | name = "lib", 7 | srcs = glob(["*.py"]), 8 | typing = True, 9 | deps = [ 10 | "//eden/integration/lib:lib", 11 | "//watchman/python/pywatchman:pywatchman", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /watchman/integration/lib/Interrupt.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # pyre-unsafe 7 | 8 | 9 | interrupted = False 10 | 11 | 12 | def wasInterrupted() -> bool: 13 | global interrupted 14 | return interrupted 15 | 16 | 17 | def setInterrupted() -> None: 18 | global interrupted 19 | interrupted = True 20 | 21 | 22 | def checkInterrupt() -> None: 23 | """ 24 | If an interrupt was detected, raise it now. 25 | We use this to defer interrupt processing until we're 26 | in the right place to handle it. 27 | """ 28 | if wasInterrupted(): 29 | raise KeyboardInterrupt() 30 | -------------------------------------------------------------------------------- /watchman/integration/lib/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # pyre-unsafe 7 | 8 | import os.path 9 | 10 | if "WATCHMAN_INTEGRATION_HELPERS" in os.environ: 11 | HELPER_ROOT = os.path.join(os.environ["WATCHMAN_INTEGRATION_HELPERS"]) 12 | else: 13 | WATCHMAN_SRC_DIR: str = os.environ.get("WATCHMAN_SRC_DIR", os.getcwd()) 14 | HELPER_ROOT = os.path.join(WATCHMAN_SRC_DIR, "integration") 15 | -------------------------------------------------------------------------------- /watchman/integration/lib/node.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # pyre-unsafe 7 | 8 | import distutils.spawn 9 | import os 10 | import subprocess 11 | 12 | 13 | def _find_node(): 14 | return os.environ.get("NODE_BIN", distutils.spawn.find_executable("node")) 15 | 16 | 17 | def _find_yarn(): 18 | return os.environ.get("YARN_PATH", distutils.spawn.find_executable("yarn")) 19 | 20 | 21 | # To avoid CI environments that put broken yarn and node executables in PATH, 22 | # verify they at least run. 23 | def _ensure_can_run(binary_path) -> None: 24 | if binary_path is None: 25 | return None 26 | try: 27 | if 0 != subprocess.call([binary_path, "--version"], stdout=subprocess.DEVNULL): 28 | return None 29 | except OSError: 30 | return None 31 | return binary_path 32 | 33 | 34 | node_bin = _ensure_can_run(_find_node()) 35 | yarn_bin = _ensure_can_run(_find_yarn()) 36 | -------------------------------------------------------------------------------- /watchman/integration/node_basic.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | var assert = require('assert'); 9 | var watchman = require('fb-watchman'); 10 | var client = new watchman.Client(); 11 | 12 | var t = setTimeout(function () { 13 | assert.fail('timeout', null, 'timed out running test'); 14 | }, 10000); 15 | 16 | client.on('error', function(error) { 17 | assert.fail(error, null, 'unexpected error'); 18 | }); 19 | 20 | client.command(['version'], function(error, resp) { 21 | assert.equal(error, null, 'no errors'); 22 | console.log('Talking to watchman version', resp.version); 23 | client.end(); 24 | clearTimeout(t); 25 | }); 26 | 27 | -------------------------------------------------------------------------------- /watchman/integration/site_spawn.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # This is a simple script that spawns a watchman process in the background 8 | 9 | import os 10 | import subprocess 11 | import sys 12 | 13 | 14 | args = sys.argv[1:] 15 | args.insert(0, os.environ.get("WATCHMAN_BINARY", "watchman")) 16 | args.insert(1, "--foreground") 17 | subprocess.Popen(args) 18 | -------------------------------------------------------------------------------- /watchman/integration/site_spawn_fail.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # This is a simple script that fails to spawn a process in the background 8 | 9 | import sys 10 | 11 | 12 | print("failed to start") 13 | sys.stdout.flush() 14 | sys.exit(1) 15 | -------------------------------------------------------------------------------- /watchman/integration/test_clock.py: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sw=4:et: 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # pyre-unsafe 8 | 9 | 10 | from watchman.integration.lib import WatchmanTestCase 11 | 12 | 13 | @WatchmanTestCase.expand_matrix 14 | class TestClock(WatchmanTestCase.WatchmanTestCase): 15 | def test_clock(self) -> None: 16 | root = self.mkdtemp() 17 | self.watchmanCommand("watch", root) 18 | clock = self.watchmanCommand("clock", root) 19 | 20 | self.assertRegex(clock["clock"], "^c:\\d+:\\d+:\\d+:\\d+$") 21 | 22 | def test_clock_sync(self) -> None: 23 | root = self.mkdtemp() 24 | self.watchmanCommand("watch", root) 25 | clock1 = self.watchmanCommand("clock", root, {"sync_timeout": 5000}) 26 | self.assertRegex(clock1["clock"], "^c:\\d+:\\d+:\\d+:\\d+$") 27 | 28 | clock2 = self.watchmanCommand("clock", root, {"sync_timeout": 5000}) 29 | self.assertRegex(clock2["clock"], "^c:\\d+:\\d+:\\d+:\\d+$") 30 | 31 | self.assertNotEqual(clock1, clock2) 32 | -------------------------------------------------------------------------------- /watchman/integration/test_command.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # pyre-unsafe 7 | 8 | 9 | import json 10 | 11 | from watchman.integration.lib import WatchmanTestCase 12 | 13 | 14 | @WatchmanTestCase.expand_matrix 15 | class TestCommand(WatchmanTestCase.WatchmanTestCase): 16 | def test_unknown_commands_print_json_error(self) -> None: 17 | stdout, stderr = self.watchmanInstance().commandViaCLI( 18 | ["--pretty", "unknown-command"] 19 | ) 20 | self.assertEqual(b"", stderr) 21 | self.assertNotEqual(b"", stdout) 22 | error = json.loads(stdout) 23 | self.assertRegex( 24 | error["error"], 25 | ".*watchman::CommandValidationError: failed to validate command: unknown command unknown-command", 26 | ) 27 | -------------------------------------------------------------------------------- /watchman/integration/test_force_recrawl.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # pyre-unsafe 7 | 8 | 9 | import os 10 | 11 | from watchman.integration.lib import WatchmanTestCase 12 | 13 | 14 | @WatchmanTestCase.expand_matrix 15 | class TestForceRecrawl(WatchmanTestCase.WatchmanTestCase): 16 | def test_force_recrawl(self) -> None: 17 | root = self.mkdtemp() 18 | self.watchmanCommand("watch", root) 19 | 20 | os.mkdir(os.path.join(root, "foo")) 21 | filelist = ["foo"] 22 | 23 | self.assertFileList(root, filelist) 24 | 25 | self.suspendWatchman() 26 | 27 | filelist = ["foo"] 28 | for i in range(20000): 29 | self.touchRelative(root, "foo", str(i)) 30 | filelist.append(f"foo/{i}") 31 | 32 | self.resumeWatchman() 33 | 34 | self.assertFileList(root, filelist) 35 | -------------------------------------------------------------------------------- /watchman/integration/test_invalid_watchmanconfig.py: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sw=4:et: 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # pyre-unsafe 8 | 9 | 10 | import os 11 | 12 | from watchman.integration.lib import WatchmanTestCase 13 | 14 | 15 | @WatchmanTestCase.expand_matrix 16 | class TestWatchmanConfigValid(WatchmanTestCase.WatchmanTestCase): 17 | def test_trailing_comma(self) -> None: 18 | root = self.mkdtemp() 19 | with open(os.path.join(root, ".watchmanconfig"), "w") as f: 20 | f.write('{"ignore_dirs":["foo",],}') 21 | 22 | with self.assertRaises(Exception) as ctx: 23 | self.watchmanCommand("watch", root) 24 | self.assertIn("failed to parse json", str(ctx.exception)) 25 | -------------------------------------------------------------------------------- /watchman/integration/test_watch_del_all.py: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sw=4:et: 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # pyre-unsafe 8 | 9 | 10 | import os 11 | 12 | from watchman.integration.lib import WatchmanTestCase 13 | 14 | 15 | @WatchmanTestCase.expand_matrix 16 | class TestWatchDelAll(WatchmanTestCase.WatchmanTestCase): 17 | def test_watch_del_all(self) -> None: 18 | root = self.mkdtemp() 19 | 20 | dirs = [os.path.join(root, f) for f in ["a", "b", "c", "d"]] 21 | 22 | for d in dirs: 23 | os.mkdir(d) 24 | self.touchRelative(d, "foo") 25 | self.watchmanCommand("watch", d) 26 | self.assertFileList(d, files=["foo"]) 27 | 28 | self.watchmanCommand("watch-del-all") 29 | self.assertEqual(self.watchmanCommand("watch-list")["roots"], []) 30 | -------------------------------------------------------------------------------- /watchman/integration/touch.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # Portable simple implementation of `touch` 7 | 8 | 9 | import errno 10 | import os 11 | import sys 12 | 13 | 14 | fname = sys.argv[1] 15 | 16 | try: 17 | os.utime(fname, None) 18 | except OSError as e: 19 | if e.errno == errno.ENOENT: 20 | with open(fname, "a"): 21 | os.utime(fname, None) 22 | else: 23 | raise 24 | -------------------------------------------------------------------------------- /watchman/integration/trig-cwd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | 8 | import os 9 | 10 | 11 | os.environ["PWD"] = os.getcwd() 12 | 13 | for k, v in os.environ.items(): 14 | print("%s=%s" % (k, v)) 15 | -------------------------------------------------------------------------------- /watchman/integration/trig.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | 8 | import sys 9 | import time 10 | 11 | 12 | log_file_name = sys.argv[1] 13 | 14 | args = sys.argv[2:] 15 | 16 | with open(log_file_name, "a") as f: 17 | for arg in args: 18 | f.write("%s " % time.time()) 19 | f.write(arg) 20 | f.write("\n") 21 | 22 | print("WOOT from trig.sh") 23 | -------------------------------------------------------------------------------- /watchman/integration/trigjson.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | 8 | import sys 9 | 10 | 11 | log_file_name = sys.argv[1] 12 | 13 | # Copy json from stdin to the log file 14 | with open(log_file_name, "a") as f: 15 | print("trigjson.py: Copying STDIN to %s" % log_file_name) 16 | json_in = sys.stdin.read() 17 | print("stdin: %s" % json_in) 18 | f.write(json_in) 19 | -------------------------------------------------------------------------------- /watchman/java/.buckconfig: -------------------------------------------------------------------------------- 1 | [java] 2 | src_roots = java, test 3 | source_level = 6 4 | target_level = 6 5 | jar_spool_mode = direct_to_jar 6 | 7 | [project] 8 | ide = intellij 9 | allow_symlinks = forbid 10 | watchman_query_timeout_ms = 1000 11 | initial_targets = //watchman 12 | ignore = .git, .buckd, .idea, buck-out, buck-cache, \ 13 | **/.DS_Store, **/**.orig, \ 14 | *___jb_bak___*, \ 15 | *___jb_tmp___*, \ 16 | *___jb_old___*, \ 17 | **/*.swp, \ 18 | **/*~ 19 | parallel_parsing = true 20 | 21 | [build] 22 | thread_core_ratio = 0.75 23 | thread_core_ratio_min_threads = 1 24 | 25 | [cache] 26 | mode = dir 27 | dir = buck-cache 28 | dir_max_size = 100MB 29 | 30 | [test] 31 | timeout = 60000 32 | -------------------------------------------------------------------------------- /watchman/java/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore files used by the Buck build system 2 | /.buckd/ 3 | /buck-cache/ 4 | /buck-out/ 5 | -------------------------------------------------------------------------------- /watchman/java/.nobuckcheck: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/watchman/java/.nobuckcheck -------------------------------------------------------------------------------- /watchman/java/README.md: -------------------------------------------------------------------------------- 1 | Watchman Java Library 2 | ==== 3 | 4 | This provides Java bindings to the Watchman service. 5 | 6 | Building 7 | === 8 | 9 | Make sure that you have [buck](https://buckbuild.com/) installed. In this 10 | folder, run: 11 | 12 | ``` 13 | buck fetch :watchman 14 | buck build :watchman 15 | ``` 16 | 17 | The resulting JAR file is found in: 18 | `buck-out/gen/watchman.jar' 19 | 20 | To run the tests: 21 | 22 | ``` 23 | buck fetch :watchman-tests 24 | buck test :watchman-lib 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /watchman/java/sandcastle.ini: -------------------------------------------------------------------------------- 1 | oncall = tmp_t21891137 2 | -------------------------------------------------------------------------------- /watchman/java/src/com/facebook/watchman/Callback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | package com.facebook.watchman; 9 | 10 | import java.util.Map; 11 | 12 | public interface Callback { 13 | void call(Map message) throws Exception; 14 | } 15 | -------------------------------------------------------------------------------- /watchman/java/src/com/facebook/watchman/Deserializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | package com.facebook.watchman; 9 | 10 | import java.io.IOException; 11 | import java.io.InputStream; 12 | import java.util.Map; 13 | 14 | public interface Deserializer { 15 | 16 | /** 17 | * Reads the next object from the InputSteram, blocking until it becomes available. 18 | * @param stream the stream to read from 19 | * @return a deserialized object, read from the stream 20 | */ 21 | Map deserialize(InputStream stream) throws IOException; 22 | } 23 | -------------------------------------------------------------------------------- /watchman/java/src/com/facebook/watchman/WatchmanException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | package com.facebook.watchman; 9 | 10 | import java.util.Map; 11 | 12 | public class WatchmanException extends Exception { 13 | 14 | private final Map response; 15 | 16 | public WatchmanException() { 17 | super(); 18 | response = null; 19 | } 20 | 21 | public WatchmanException(String reason) { 22 | super(reason); 23 | response = null; 24 | } 25 | 26 | public WatchmanException(String error, Map response) { 27 | super(error); 28 | this.response = response; 29 | } 30 | 31 | public Map getResponse() { 32 | return response; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /watchman/java/src/com/facebook/watchman/WatchmanTransport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | package com.facebook.watchman; 9 | 10 | import java.io.Closeable; 11 | import java.io.InputStream; 12 | import java.io.OutputStream; 13 | 14 | public interface WatchmanTransport extends Closeable { 15 | InputStream getInputStream(); 16 | OutputStream getOutputStream(); 17 | } 18 | -------------------------------------------------------------------------------- /watchman/java/src/com/facebook/watchman/WatchmanTransportUnavailableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | package com.facebook.watchman; 9 | 10 | public class WatchmanTransportUnavailableException extends Exception { 11 | 12 | public WatchmanTransportUnavailableException() { 13 | super(); 14 | } 15 | 16 | public WatchmanTransportUnavailableException(String message) { 17 | super(message); 18 | } 19 | 20 | public WatchmanTransportUnavailableException(String message, Throwable cause) { 21 | super(message, cause); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /watchman/java/src/com/facebook/watchman/bser/BserConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | package com.facebook.watchman.bser; 9 | 10 | public class BserConstants { 11 | // Utility class, do not instantiate. 12 | private BserConstants() { } 13 | 14 | public static final byte BSER_ARRAY = 0x00; 15 | public static final byte BSER_OBJECT = 0x01; 16 | public static final byte BSER_STRING = 0x02; 17 | public static final byte BSER_INT8 = 0x03; 18 | public static final byte BSER_INT16 = 0x04; 19 | public static final byte BSER_INT32 = 0x05; 20 | public static final byte BSER_INT64 = 0x06; 21 | public static final byte BSER_REAL = 0x07; 22 | public static final byte BSER_TRUE = 0x08; 23 | public static final byte BSER_FALSE = 0x09; 24 | public static final byte BSER_NULL = 0x0a; 25 | public static final byte BSER_TEMPLATE = 0x0b; 26 | public static final byte BSER_SKIP = 0x0c; 27 | } 28 | -------------------------------------------------------------------------------- /watchman/java/third-party/guava/BUCK: -------------------------------------------------------------------------------- 1 | remote_file( 2 | name = "guava-jar", 3 | out = "guava-19.0.jar", 4 | sha1 = "6ce200f6b23222af3d8abb6b6459e6c44f4bb0e9", 5 | url = "http://central.maven.org/maven2/com/google/guava/guava/19.0/guava-19.0.jar", 6 | ) 7 | 8 | prebuilt_jar( 9 | name = "guava", 10 | binary_jar = ":guava-jar", 11 | visibility = ["PUBLIC"], 12 | ) 13 | -------------------------------------------------------------------------------- /watchman/java/third-party/guava/README: -------------------------------------------------------------------------------- 1 | README for Guava 2 | 3 | URL: https://github.com/google/guava 4 | Downloaded From: http://central.maven.org/maven2/com/google/guava/guava/19.0/guava-19.0.jar 5 | License: Apache 2.0 6 | -------------------------------------------------------------------------------- /watchman/java/third-party/hamcrest/BUCK: -------------------------------------------------------------------------------- 1 | remote_file( 2 | name = "java-hamcrest-2-jar", 3 | out = "java-hamcrest-2.0.0.0.jar", 4 | sha1 = "0221cf2b5aabedf8cd76534996caa21b283ea5d0", 5 | url = "http://central.maven.org/maven2/org/hamcrest/hamcrest-junit/2.0.0.0/hamcrest-junit-2.0.0.0.jar", 6 | ) 7 | 8 | remote_file( 9 | name = "hamcrest-junit-2-jar", 10 | out = "hamcrest-junit-2.0.0.0.jar", 11 | sha1 = "0f1c8853ade0ecf707f5a261c830e98893983813", 12 | url = "http://central.maven.org/maven2/org/hamcrest/java-hamcrest/2.0.0.0/java-hamcrest-2.0.0.0.jar", 13 | ) 14 | 15 | java_library( 16 | name = "hamcrest-2", 17 | visibility = ["PUBLIC"], 18 | deps = [], 19 | exported_deps = [ 20 | ":hamcrest-junit-2", 21 | ":java-hamcrest-2", 22 | ], 23 | ) 24 | 25 | prebuilt_jar( 26 | name = "java-hamcrest-2", 27 | binary_jar = ":java-hamcrest-2-jar", 28 | visibility = ["PUBLIC"], 29 | ) 30 | 31 | prebuilt_jar( 32 | name = "hamcrest-junit-2", 33 | binary_jar = ":hamcrest-junit-2-jar", 34 | visibility = ["PUBLIC"], 35 | deps = [ 36 | ":java-hamcrest-2", 37 | ], 38 | ) 39 | -------------------------------------------------------------------------------- /watchman/java/third-party/hamcrest/README: -------------------------------------------------------------------------------- 1 | README for Hamcrest-2 2 | 3 | URL: http://hamcrest.org/ 4 | Downloaded From: 5 | * http://central.maven.org/maven2/org/hamcrest/hamcrest-junit/2.0.0.0/hamcrest-junit-2.0.0.0.jar 6 | * http://central.maven.org/maven2/org/hamcrest/java-hamcrest/2.0.0.0/java-hamcrest-2.0.0.0.jar 7 | License: BSD 8 | -------------------------------------------------------------------------------- /watchman/java/third-party/immutables/README: -------------------------------------------------------------------------------- 1 | README for Immutables 2 | 3 | URL: https://github.com/immutables/immutables 4 | Downloaded From: 5 | * http://central.maven.org/maven2/org/immutables/generator/2.1.5/generator-2.1.5.jar 6 | * http://central.maven.org/maven2/org/immutables/value-processor/2.1.5/value-processor-2.1.5.jar 7 | * http://central.maven.org/maven2/org/immutables/value/2.1.5/value-2.1.5.jar 8 | 9 | License: Apache 2.0 10 | -------------------------------------------------------------------------------- /watchman/java/third-party/jna/BUCK: -------------------------------------------------------------------------------- 1 | remote_file( 2 | name = "jna-jar", 3 | out = "jna-4.2.0.jar", 4 | sha1 = "812b976ed15bb1b0b3fc059fae927b0f76b39585", 5 | url = "http://central.maven.org/maven2/net/java/dev/jna/jna/4.2.0/jna-4.2.0.jar", 6 | ) 7 | 8 | remote_file( 9 | name = "jna-platform-jar", 10 | out = "jna-platform-4.2.0.jar", 11 | sha1 = "4a04d34615d534f273f7b8bd30d75304efe4ab04", 12 | url = "http://central.maven.org/maven2/net/java/dev/jna/jna-platform/4.2.0/jna-platform-4.2.0.jar", 13 | ) 14 | 15 | prebuilt_jar( 16 | name = "jna", 17 | binary_jar = ":jna-jar", 18 | visibility = ["PUBLIC"], 19 | ) 20 | 21 | prebuilt_jar( 22 | name = "jna-platform", 23 | binary_jar = ":jna-platform-jar", 24 | visibility = ["PUBLIC"], 25 | ) 26 | -------------------------------------------------------------------------------- /watchman/java/third-party/jna/README: -------------------------------------------------------------------------------- 1 | README for JNA 2 | 3 | URL: https://github.com/java-native-access/jna 4 | Downloaded From: http://central.maven.org/maven2/net/java/dev/jna/jna/4.2.0/jna-4.2.0.jar 5 | License: Apache 2.0 and LPGL 2.1 dual license 6 | -------------------------------------------------------------------------------- /watchman/java/third-party/jsr-305/BUCK: -------------------------------------------------------------------------------- 1 | remote_file( 2 | name = "jsr-305-jar", 3 | out = "jsr305.jar", 4 | sha1 = "f7be08ec23c21485b9b5a1cf1654c2ec8c58168d", 5 | url = "http://central.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar", 6 | ) 7 | 8 | prebuilt_jar( 9 | name = "jsr-305", 10 | binary_jar = ":jsr-305-jar", 11 | visibility = [ 12 | "PUBLIC", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /watchman/java/third-party/jsr-305/README: -------------------------------------------------------------------------------- 1 | README for JSR-305 2 | 3 | URL: http://findbugs.sourceforge.net/ 4 | Downloaded From: http://central.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar 5 | License: Apache 2.0 6 | -------------------------------------------------------------------------------- /watchman/java/third-party/junit/BUCK: -------------------------------------------------------------------------------- 1 | remote_file( 2 | name = "junit-download", 3 | out = "junit-4.12.jar", 4 | sha1 = "2973d150c0dc1fefe998f834810d68f278ea58ec", 5 | url = "http://central.maven.org/maven2/junit/junit/4.12/junit-4.12.jar", 6 | ) 7 | 8 | prebuilt_jar( 9 | name = "junit-jar", 10 | binary_jar = ":junit-download", 11 | ) 12 | 13 | java_library( 14 | name = "junit", 15 | visibility = ["PUBLIC"], 16 | exported_deps = [ 17 | ":junit-jar", 18 | "//third-party/hamcrest:hamcrest-2", 19 | ], 20 | ) 21 | -------------------------------------------------------------------------------- /watchman/java/third-party/junit/README: -------------------------------------------------------------------------------- 1 | README for Junit 2 | 3 | URL: https://github.com/junit-team/junit4 4 | Downloaded From: http://central.maven.org/maven2/junit/junit/4.12/junit-4.12.jar 5 | License: Apache 2.0 6 | -------------------------------------------------------------------------------- /watchman/java/third-party/mockito/BUCK: -------------------------------------------------------------------------------- 1 | remote_file( 2 | name = "mockito-jar", 3 | out = "mockito-core-1.9.5.jar", 4 | sha1 = "c3264abeea62c4d2f367e21484fbb40c7e256393", 5 | url = "http://central.maven.org/maven2/org/mockito/mockito-core/1.9.5/mockito-core-1.9.5.jar", 6 | ) 7 | 8 | prebuilt_jar( 9 | name = "mockito", 10 | binary_jar = ":mockito-jar", 11 | visibility = ["PUBLIC"], 12 | deps = [ 13 | "//third-party/hamcrest:hamcrest-2", 14 | "//third-party/objenesis:objenesis", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /watchman/java/third-party/mockito/README: -------------------------------------------------------------------------------- 1 | README for Mockito 2 | 3 | URL: http://mockito.org/ 4 | Downloaded From: http://central.maven.org/maven2/org/mockito/mockito-core/1.9.5/mockito-core-1.9.5.jar 5 | License: MIT 6 | -------------------------------------------------------------------------------- /watchman/java/third-party/nuprocess/BUCK: -------------------------------------------------------------------------------- 1 | remote_file( 2 | name = "nuprocess-jar", 3 | out = "nuprocess-1.1.0.jar", 4 | sha1 = "9479382344b61b36dd3ca1ec1b10aaa91295d632", 5 | url = "http://central.maven.org/maven2/com/zaxxer/nuprocess/1.1.0/nuprocess-1.1.0.jar", 6 | ) 7 | 8 | prebuilt_jar( 9 | name = "nuprocess", 10 | binary_jar = ":nuprocess-jar", 11 | visibility = ["PUBLIC"], 12 | deps = [ 13 | "//third-party/jna:jna", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /watchman/java/third-party/nuprocess/README: -------------------------------------------------------------------------------- 1 | README for NuProcess 2 | 3 | URL: https://github.com/brettwooldridge/NuProcess 4 | Downloaded from: http://central.maven.org/maven2/com/zaxxer/nuprocess/1.1.0/nuprocess-1.1.0.jar 5 | License: Apache 2.0 license 6 | -------------------------------------------------------------------------------- /watchman/java/third-party/objenesis/BUCK: -------------------------------------------------------------------------------- 1 | remote_file( 2 | name = "objenesis-jar", 3 | out = "objenesis-1.3.jar", 4 | sha1 = "dc13ae4faca6df981fc7aeb5a522d9db446d5d50", 5 | url = "http://central.maven.org/maven2/org/objenesis/objenesis/1.3/objenesis-1.3.jar", 6 | ) 7 | 8 | prebuilt_jar( 9 | name = "objenesis", 10 | binary_jar = ":objenesis-jar", 11 | visibility = ["PUBLIC"], 12 | ) 13 | -------------------------------------------------------------------------------- /watchman/java/third-party/objenesis/README: -------------------------------------------------------------------------------- 1 | README for Objenesis 2 | 3 | URL: http://objenesis.org/ 4 | Downloaded From: http://central.maven.org/maven2/org/objenesis/objenesis/1.3/objenesis-1.3.jar 5 | License: MIT 6 | -------------------------------------------------------------------------------- /watchman/listener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "watchman/fs/FileDescriptor.h" 11 | 12 | void w_listener_prep_inetd(); 13 | bool w_start_listener(); 14 | -------------------------------------------------------------------------------- /watchman/node/.flowconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/watchman/node/.flowconfig -------------------------------------------------------------------------------- /watchman/node/bser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | add_fb_python_unittest(bser_js 7 | SOURCES 8 | test_bser.py 9 | 10 | DEPENDS 11 | integration_lib 12 | 13 | WORKING_DIRECTORY 14 | ${CMAKE_BINARY_DIR} 15 | 16 | ENV 17 | "YARN_PATH=${YARN}" 18 | "NODE_BIN=${NODE}" 19 | "WATCHMAN_SRC_DIR=${CMAKE_SOURCE_DIR}/watchman" 20 | ) 21 | -------------------------------------------------------------------------------- /watchman/node/bser/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bser", 3 | "version": "2.1.1", 4 | "description": "JavaScript implementation of the BSER Binary Serialization", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "node test/bser.js" 11 | }, 12 | "files": [ 13 | "index.js" 14 | ], 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/facebook/watchman" 18 | }, 19 | "keywords": [ 20 | "bser", 21 | "binary", 22 | "protocol" 23 | ], 24 | "author": "Wez Furlong (http://wezfurlong.org)", 25 | "license": "MIT", 26 | "bugs": { 27 | "url": "https://github.com/facebook/watchman/issues" 28 | }, 29 | "homepage": "https://facebook.github.io/watchman/docs/bser.html", 30 | "dependencies": { 31 | "node-int64": "^0.4.0" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /watchman/node/bser/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | node-int64@^0.4.0: 6 | version "0.4.0" 7 | resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" 8 | integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= 9 | -------------------------------------------------------------------------------- /watchman/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fb-watchman", 3 | "version": "2.0.2", 4 | "description": "Bindings for the Watchman file watching service", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git@github.com:facebook/watchman.git" 9 | }, 10 | "keywords": [ 11 | "facebook", 12 | "watchman", 13 | "file", 14 | "watch", 15 | "watcher", 16 | "watching", 17 | "fs.watch", 18 | "fswatcher", 19 | "fs", 20 | "glob", 21 | "utility" 22 | ], 23 | "author": "Wez Furlong (http://wezfurlong.org)", 24 | "license": "MIT", 25 | "bugs": { 26 | "url": "https://github.com/facebook/watchman/issues" 27 | }, 28 | "homepage": "https://facebook.github.io/watchman/", 29 | "files": [ 30 | "index.js" 31 | ], 32 | "dependencies": { 33 | "bser": "2.1.1" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /watchman/node/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | bser@^2.1.0: 6 | version "2.1.1" 7 | resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" 8 | integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== 9 | dependencies: 10 | node-int64 "^0.4.0" 11 | 12 | node-int64@^0.4.0: 13 | version "0.4.0" 14 | resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" 15 | integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= 16 | -------------------------------------------------------------------------------- /watchman/portability/Backtrace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #ifdef _WIN32 11 | 12 | #define HAVE_BACKTRACE 13 | #define HAVE_BACKTRACE_SYMBOLS 14 | 15 | extern "C" { 16 | 17 | typedef struct _EXCEPTION_POINTERS* LPEXCEPTION_POINTERS; 18 | 19 | size_t backtrace(void** frames, size_t n_frames); 20 | char** backtrace_symbols(void** array, size_t n_frames); 21 | size_t backtrace_from_exception( 22 | LPEXCEPTION_POINTERS exception, 23 | void** frames, 24 | size_t n_frames); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /watchman/portability/GetOpt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #ifdef _WIN32 11 | 12 | #include "watchman/thirdparty/getopt/GetOpt.h" // @manual 13 | 14 | #else 15 | 16 | #include 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /watchman/portability/WinError.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #ifdef _WIN32 13 | 14 | // DWORD = uint32_t 15 | 16 | const char* win32_strerror(uint32_t err); 17 | int map_win32_err(uint32_t err); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /watchman/python/.gitignore: -------------------------------------------------------------------------------- 1 | instroot 2 | -------------------------------------------------------------------------------- /watchman/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | add_subdirectory(pywatchman) 7 | 8 | add_fb_python_executable(watchman-diag 9 | SOURCES 10 | bin/watchman-diag=__main__.py 11 | DEPENDS 12 | pywatchman 13 | ) 14 | install_fb_python_executable(watchman-diag) 15 | 16 | add_fb_python_executable(watchman-make 17 | SOURCES 18 | bin/watchman-make=__main__.py 19 | DEPENDS 20 | pywatchman 21 | ) 22 | install_fb_python_executable(watchman-make) 23 | 24 | add_fb_python_executable(watchman-replicate-subscription 25 | SOURCES 26 | bin/watchman-replicate-subscription=__main__.py 27 | DEPENDS 28 | pywatchman 29 | ) 30 | install_fb_python_executable(watchman-replicate-subscription) 31 | 32 | add_fb_python_executable(watchman-wait 33 | SOURCES 34 | bin/watchman-wait=__main__.py 35 | DEPENDS 36 | pywatchman 37 | ) 38 | install_fb_python_executable(watchman-wait) 39 | -------------------------------------------------------------------------------- /watchman/python/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pywatchman/bser.h 2 | -------------------------------------------------------------------------------- /watchman/python/README.md: -------------------------------------------------------------------------------- 1 | # Watchman client for Python 2 | 3 | This directory contains the Watchman client for Python. 4 | 5 | ## Build 6 | 7 | ```sh 8 | python -m build 9 | ``` 10 | -------------------------------------------------------------------------------- /watchman/python/publish-pypi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # 8 | # =============================== 9 | # pywatchman pypi publishing tool 10 | # =============================== 11 | # 12 | # this publishes the watchman python module to the pypi project 13 | # index located at https://pypi.python.org/pypi/pywatchman. the 14 | # metadata used for this process comes directly from setup.py. 15 | # 16 | # this requires write access to the pywatchman project on pypi 17 | # as well as a ~/.pypirc of the following form: 18 | # 19 | # [distutils] 20 | # index-servers = pypi 21 | # 22 | # [pypi] 23 | # repository: https://pypi.python.org/pypi 24 | # username: 25 | # password: 26 | # 27 | 28 | python setup.py sdist bdist_wheel upload -r pypi 29 | -------------------------------------------------------------------------------- /watchman/python/pywatchman/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | add_fb_python_library(pywatchman 7 | SOURCES 8 | __init__.py 9 | capabilities.py 10 | encoding.py 11 | load.py 12 | pybser.py 13 | windows.py 14 | NAMESPACE pywatchman 15 | ) 16 | -------------------------------------------------------------------------------- /watchman/python/pywatchman/encoding.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | # pyre-unsafe 7 | 8 | 9 | import sys 10 | 11 | 12 | """Module to deal with filename encoding on the local system, as returned by 13 | Watchman.""" 14 | 15 | 16 | default_local_errors = "surrogateescape" 17 | 18 | 19 | def get_local_encoding() -> str: 20 | if sys.platform == "win32": 21 | # Watchman always returns UTF-8 encoded strings on Windows. 22 | return "utf-8" 23 | # On the Python 3 versions we support, sys.getfilesystemencoding never 24 | # returns None. 25 | return sys.getfilesystemencoding() 26 | 27 | 28 | def encode_local(s): 29 | return s.encode(get_local_encoding(), default_local_errors) 30 | 31 | 32 | def decode_local(bs): 33 | return bs.decode(get_local_encoding(), default_local_errors) 34 | -------------------------------------------------------------------------------- /watchman/python/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # vim:ts=4:sw=4:et: 3 | # Copyright (c) Meta Platforms, Inc. and affiliates. 4 | # 5 | # This source code is licensed under the MIT license found in the 6 | # LICENSE file in the root directory of this source tree. 7 | 8 | 9 | from setuptools import Extension, setup 10 | 11 | setup( 12 | packages=["pywatchman"], 13 | ext_modules=[ 14 | Extension( 15 | "pywatchman.bser", 16 | sources=["pywatchman/bsermodule.c", "pywatchman/bser.c"], 17 | include_dirs=["./pywatchman"], 18 | ) 19 | ], 20 | zip_safe=True, 21 | scripts=[ 22 | "bin/watchman-make", 23 | "bin/watchman-wait", 24 | "bin/watchman-replicate-subscription", 25 | ], 26 | test_suite="tests", 27 | ) 28 | -------------------------------------------------------------------------------- /watchman/python/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/watchman/python/tests/__init__.py -------------------------------------------------------------------------------- /watchman/query/FileResult.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/query/FileResult.h" 9 | 10 | namespace watchman { 11 | 12 | FileResult::~FileResult() {} 13 | 14 | std::optional FileResult::dtype() { 15 | auto statInfo = stat(); 16 | if (!statInfo.has_value()) { 17 | return std::nullopt; 18 | } 19 | return statInfo->dtype(); 20 | } 21 | 22 | } // namespace watchman 23 | -------------------------------------------------------------------------------- /watchman/query/GlobEscaping.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/query/GlobEscaping.h" 9 | #include 10 | 11 | namespace watchman { 12 | w_string convertLiteralPathToGlob(w_string_piece literal) { 13 | std::string pattern; 14 | pattern.reserve(literal.size()); 15 | for (auto ch : literal.view()) { 16 | switch (ch) { 17 | case '\\': 18 | case '*': 19 | case '[': 20 | case '?': 21 | pattern.push_back('\\'); 22 | break; 23 | } 24 | pattern.push_back(ch); 25 | } 26 | return w_string{pattern}; 27 | } 28 | 29 | w_string convertNoEscapeGlobToGlob(w_string_piece noescapePattern) { 30 | std::string pattern; 31 | pattern.reserve(noescapePattern.size()); 32 | for (auto ch : noescapePattern.view()) { 33 | switch (ch) { 34 | case '\\': 35 | pattern.push_back('\\'); 36 | break; 37 | } 38 | pattern.push_back(ch); 39 | } 40 | return w_string{pattern}; 41 | } 42 | } // namespace watchman 43 | -------------------------------------------------------------------------------- /watchman/query/GlobEscaping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "watchman/watchman_string.h" 11 | 12 | namespace watchman { 13 | /** 14 | * Convert a path to a glob pattern that matches that path literally. 15 | * NOTE: `/` is the only allowed separator. `\` is treated as a literal 16 | * character and NOT a separator, and is therefore escaped. 17 | */ 18 | w_string convertLiteralPathToGlob(w_string_piece literal); 19 | 20 | /** 21 | * Convert a glob pattern written for `noescape: true` to a glob pattern that 22 | * can be used without the `noescape` flag. 23 | */ 24 | w_string convertNoEscapeGlobToGlob(w_string_piece noescapePattern); 25 | } // namespace watchman 26 | -------------------------------------------------------------------------------- /watchman/query/Query.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/query/Query.h" 9 | #include "watchman/query/GlobTree.h" 10 | #include "watchman/query/QueryExpr.h" 11 | 12 | namespace watchman { 13 | 14 | Query::~Query() = default; 15 | 16 | bool Query::isFieldRequested(w_string_piece name) const { 17 | for (auto& f : fieldList) { 18 | if (f->name.piece() == name) { 19 | return true; 20 | } 21 | } 22 | return false; 23 | } 24 | 25 | } // namespace watchman 26 | -------------------------------------------------------------------------------- /watchman/query/QueryResult.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/query/QueryResult.h" 9 | 10 | namespace watchman { 11 | 12 | json_ref RenderResult::toJson() && { 13 | auto arr = json_array(std::move(results)); 14 | if (templ) { 15 | json_array_set_template_new(arr, std::move(*templ)); 16 | } 17 | return arr; 18 | } 19 | 20 | json_ref QueryDebugInfo::render() const { 21 | std::vector arr; 22 | for (auto& fn : cookieFileNames) { 23 | arr.push_back(w_string_to_json(fn)); 24 | } 25 | return json_object({ 26 | {"cookie_files", json_array(std::move(arr))}, 27 | }); 28 | } 29 | 30 | } // namespace watchman 31 | -------------------------------------------------------------------------------- /watchman/query/QueryResult.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include "watchman/Clock.h" 13 | #include "watchman/thirdparty/jansson/jansson.h" 14 | #include "watchman/watchman_string.h" 15 | 16 | namespace watchman { 17 | 18 | struct QueryDebugInfo { 19 | std::vector cookieFileNames; 20 | 21 | json_ref render() const; 22 | }; 23 | 24 | struct RenderResult { 25 | std::vector results; 26 | std::optional templ; 27 | 28 | json_ref toJson() &&; 29 | }; 30 | 31 | struct QueryResult { 32 | bool isFreshInstance; 33 | RenderResult resultsArray; 34 | // Only populated if the query was set to dedup_results 35 | std::unordered_set dedupedFileNames; 36 | ClockSpec clockAtStartOfQuery; 37 | uint32_t stateTransCountAtStartOfQuery; 38 | std::optional savedStateInfo; 39 | QueryDebugInfo debugInfo; 40 | }; 41 | 42 | } // namespace watchman 43 | -------------------------------------------------------------------------------- /watchman/query/intcompare.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "watchman/thirdparty/jansson/jansson.h" 11 | 12 | namespace watchman { 13 | 14 | enum w_query_icmp_op { 15 | W_QUERY_ICMP_EQ, 16 | W_QUERY_ICMP_NE, 17 | W_QUERY_ICMP_GT, 18 | W_QUERY_ICMP_GE, 19 | W_QUERY_ICMP_LT, 20 | W_QUERY_ICMP_LE, 21 | }; 22 | struct w_query_int_compare { 23 | enum w_query_icmp_op op; 24 | json_int_t operand; 25 | }; 26 | void parse_int_compare(const json_ref& term, struct w_query_int_compare* comp); 27 | bool eval_int_compare(json_int_t ival, struct w_query_int_compare* comp); 28 | 29 | } // namespace watchman 30 | -------------------------------------------------------------------------------- /watchman/root/resolve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace watchman { 13 | class Root; 14 | } 15 | 16 | std::shared_ptr w_root_resolve( 17 | const char* path, 18 | bool auto_watch); 19 | 20 | std::shared_ptr w_root_resolve_for_client_mode( 21 | const char* filename); 22 | 23 | std::shared_ptr 24 | root_resolve(const char* filename, bool auto_watch, bool* created); 25 | -------------------------------------------------------------------------------- /watchman/root/test/RootTest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/root/Root.h" 9 | #include 10 | #include 11 | 12 | namespace { 13 | 14 | using namespace watchman; 15 | 16 | TEST(RootTest, IgnoreSet_includes_ignore_vcs_if_no_ignore_dirs) { 17 | json_ref val = json_object({ 18 | {"ignore_vcs", json_array({w_string_to_json(".hg")})}, 19 | }); 20 | Configuration config(val); 21 | 22 | auto ignores = computeIgnoreSet(w_string{"root"}, config); 23 | EXPECT_TRUE(ignores.isIgnoreVCS(w_string{"root/.hg"})); 24 | } 25 | 26 | } // namespace 27 | -------------------------------------------------------------------------------- /watchman/root/warnerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include "watchman/watchman_string.h" 13 | 14 | struct watchman_dir; 15 | 16 | namespace watchman { 17 | 18 | class Root; 19 | 20 | void handle_open_errno( 21 | Root& root, 22 | w_string_piece dirName, 23 | std::chrono::system_clock::time_point now, 24 | const char* syscall, 25 | const std::error_code& err); 26 | 27 | } // namespace watchman 28 | -------------------------------------------------------------------------------- /watchman/ruby/ruby-watchman/.gitignore: -------------------------------------------------------------------------------- 1 | *.bundle 2 | *.gem 3 | *.so 4 | Gemfile.lock 5 | mkmf.log 6 | vendor 7 | -------------------------------------------------------------------------------- /watchman/ruby/ruby-watchman/.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | -------------------------------------------------------------------------------- /watchman/ruby/ruby-watchman/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | -------------------------------------------------------------------------------- /watchman/ruby/ruby-watchman/ext/ruby-watchman/depend: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. All Rights Reserved. 2 | 3 | CFLAGS += -Wall -Wextra -Wno-unused-parameter 4 | 5 | watchman.o: watchman.c watchman.h 6 | -------------------------------------------------------------------------------- /watchman/ruby/ruby-watchman/ext/ruby-watchman/extconf.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | require 'mkmf' 7 | 8 | def header(item) 9 | unless find_header(item) 10 | puts "couldn't find #{item} (required)" 11 | exit 1 12 | end 13 | end 14 | 15 | # mandatory headers 16 | header('ruby.h') 17 | header('fcntl.h') 18 | header('sys/errno.h') 19 | header('sys/socket.h') 20 | 21 | # variable headers 22 | have_header('ruby/st.h') # >= 1.9; sets HAVE_RUBY_ST_H 23 | have_header('st.h') # 1.8; sets HAVE_ST_H 24 | 25 | RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC'] 26 | 27 | create_makefile('ruby-watchman/ext') 28 | -------------------------------------------------------------------------------- /watchman/ruby/ruby-watchman/lib/ruby-watchman.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | require 'ruby-watchman/ext' 7 | -------------------------------------------------------------------------------- /watchman/ruby/ruby-watchman/lib/ruby-watchman/version.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | module RubyWatchman 7 | VERSION = '0.0.2' 8 | end 9 | -------------------------------------------------------------------------------- /watchman/ruby/ruby-watchman/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) 7 | $LOAD_PATH.unshift File.expand_path('../../ext', __FILE__) 8 | require 'ruby-watchman' 9 | -------------------------------------------------------------------------------- /watchman/rust/.gitignore: -------------------------------------------------------------------------------- 1 | */Cargo.lock 2 | */target/ 3 | -------------------------------------------------------------------------------- /watchman/rust/serde_bser/BUCK: -------------------------------------------------------------------------------- 1 | load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") 2 | 3 | oncall("scm_client_infra") 4 | 5 | rust_library( 6 | name = "serde_bser", 7 | srcs = glob(["src/**/*.rs"]), 8 | preferred_linkage = "static", 9 | test_deps = [ 10 | "fbsource//third-party/rust:maplit", 11 | ], 12 | deps = [ 13 | "fbsource//third-party/rust:anyhow", 14 | "fbsource//third-party/rust:byteorder", 15 | "fbsource//third-party/rust:bytes", 16 | "fbsource//third-party/rust:serde", 17 | "fbsource//third-party/rust:serde_bytes", 18 | "fbsource//third-party/rust:thiserror", 19 | ], 20 | ) 21 | -------------------------------------------------------------------------------- /watchman/rust/serde_bser/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "serde_bser" 3 | version = "0.4.0" 4 | authors = ["Rain ", "Wez Furlong"] 5 | edition = "2021" 6 | description = "Implements the Watchman BSER encoding for serde. https://facebook.github.io/watchman/docs/bser.html" 7 | documentation = "https://docs.rs/serde_bser" 8 | repository = "https://github.com/facebook/watchman/" 9 | license = "MIT" 10 | 11 | [dependencies] 12 | anyhow = "1.0" 13 | byteorder = "1.3" 14 | bytes = { version = "1.0", features = ["serde"] } 15 | serde = { version = "1.0.126", features = ["derive", "rc"] } 16 | serde_bytes = "0.11" 17 | thiserror = "1.0" 18 | 19 | [dev-dependencies] 20 | maplit = "1.0" 21 | 22 | [features] 23 | debug_bytes = [] 24 | default = [] 25 | 26 | [lints.rust] 27 | unexpected_cfgs = { level = "warn", check-cfg = ["cfg(fbcode_build)"] } 28 | -------------------------------------------------------------------------------- /watchman/rust/serde_bser/README.md: -------------------------------------------------------------------------------- 1 | # Work in Progress! 2 | 3 | This is work in progress on a BSER implementation that is compatible 4 | with serde. It is not complete! If you're reading this and want 5 | to help move it closer to completion, please don't be afraid to 6 | work up a pull request! 7 | -------------------------------------------------------------------------------- /watchman/rust/serde_bser/src/lib.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #![cfg_attr(fbcode_build, deny(warnings, rust_2018_idioms))] 9 | 10 | pub mod bytestring; 11 | pub mod de; 12 | mod errors; 13 | mod header; 14 | pub mod ser; 15 | pub mod value; 16 | 17 | pub use crate::de::from_reader; 18 | pub use crate::de::from_slice; 19 | -------------------------------------------------------------------------------- /watchman/rust/serde_bser/src/ser/count_write.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | use std::io; 9 | use std::io::Write; 10 | 11 | /// A writer that counts how many bytes were written. 12 | pub struct CountWrite { 13 | count: usize, 14 | } 15 | 16 | impl CountWrite { 17 | pub fn new() -> Self { 18 | CountWrite { count: 0 } 19 | } 20 | 21 | #[inline] 22 | pub fn count(&self) -> usize { 23 | self.count 24 | } 25 | } 26 | 27 | impl Write for CountWrite { 28 | #[inline] 29 | fn write(&mut self, buf: &[u8]) -> io::Result { 30 | self.count += buf.len(); 31 | Ok(buf.len()) 32 | } 33 | 34 | #[inline] 35 | fn flush(&mut self) -> io::Result<()> { 36 | Ok(()) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /watchman/rust/watchman_client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "watchman_client" 3 | version = "0.9.0" 4 | authors = ["Wez Furlong"] 5 | edition = "2021" 6 | description = "a client for the Watchman file watching service" 7 | documentation = "https://docs.rs/watchman_client" 8 | repository = "https://github.com/facebook/watchman/" 9 | license = "MIT" 10 | exclude = ["examples/*"] 11 | 12 | [dependencies] 13 | anyhow = "1.0" 14 | bytes = { version = "1.0", features = ["serde"] } 15 | futures = { version = "0.3.13", features = ["async-await", "compat"] } 16 | maplit = "1.0" 17 | serde = { version = "1.0.126", features = ["derive", "rc"] } 18 | serde_bser = { version = "0.4", path = "../serde_bser" } 19 | thiserror = "1.0" 20 | tokio = { version = "1.7.1", features = ["full", "test-util"] } 21 | tokio-util = { version = "0.6", features = ["full"] } 22 | 23 | [target.'cfg(windows)'.dependencies] 24 | winapi = { version = "0.3", features = ["fileapi", "handleapi", "winbase", "winuser"] } 25 | 26 | [dev-dependencies] 27 | clap = { version = "4.5.7", features = ["derive"] } 28 | 29 | [lints.rust] 30 | unexpected_cfgs = { level = "warn", check-cfg = ["cfg(fbcode_build)"] } 31 | -------------------------------------------------------------------------------- /watchman/sockname.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/Options.h" 9 | 10 | using namespace watchman; 11 | 12 | namespace watchman { 13 | 14 | bool disable_unix_socket = false; 15 | bool disable_named_pipe = false; 16 | 17 | const char* get_sock_name_legacy() { 18 | #ifdef _WIN32 19 | return flags.named_pipe_path.c_str(); 20 | #else 21 | return flags.unix_sock_name.c_str(); 22 | #endif 23 | } 24 | 25 | const std::string& get_unix_sock_name() { 26 | return flags.unix_sock_name; 27 | } 28 | 29 | const std::string& get_named_pipe_sock_path() { 30 | return flags.named_pipe_path; 31 | } 32 | 33 | } // namespace watchman 34 | -------------------------------------------------------------------------------- /watchman/sockname.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace watchman { 13 | 14 | /** Returns the legacy socket name. 15 | * It is legacy because its meaning is system dependent and 16 | * a little confusing, but needs to be retained for backwards 17 | * compatibility reasons as it is exported into the environment 18 | * in a number of scenarios. 19 | * You should prefer to use get_unix_sock_name() or 20 | * get_named_pipe_sock_path() instead 21 | */ 22 | const char* get_sock_name_legacy(); 23 | 24 | /** Returns the configured unix domain socket path. */ 25 | const std::string& get_unix_sock_name(); 26 | 27 | /** Returns the configured named pipe socket path */ 28 | const std::string& get_named_pipe_sock_path(); 29 | 30 | extern bool disable_unix_socket; 31 | extern bool disable_named_pipe; 32 | 33 | } // namespace watchman 34 | -------------------------------------------------------------------------------- /watchman/state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "watchman/thirdparty/jansson/jansson.h" 11 | 12 | void w_state_shutdown(); 13 | void w_state_save(); 14 | bool w_state_load(); 15 | 16 | bool w_root_save_state(json_ref& state); 17 | bool w_root_load_state(const json_ref& state); 18 | -------------------------------------------------------------------------------- /watchman/telemetry/LogEvent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include 9 | 10 | #include "watchman/WatchmanConfig.h" 11 | #include "watchman/telemetry/LogEvent.h" 12 | 13 | namespace watchman { 14 | 15 | std::pair getLogEventCounters(const LogEventType& type) { 16 | static std::unordered_map eventCounters; 17 | static int64_t samplingRate = cfg_get_int("scribe-sampling-rate", 100); 18 | 19 | // Find event counter or add if missing - init to 0; 20 | auto it = eventCounters.find(type); 21 | if (it == eventCounters.end()) { 22 | it = eventCounters.emplace(type, 0).first; 23 | } 24 | 25 | // Return sampling rate and event count 26 | auto& eventCounter = it->second; 27 | auto eventCount = ++eventCounter % samplingRate; 28 | return std::make_pair(samplingRate, eventCount ? eventCount : samplingRate); 29 | } 30 | 31 | } // namespace watchman 32 | -------------------------------------------------------------------------------- /watchman/telemetry/WatchmanStats.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/telemetry/WatchmanStats.h" 9 | 10 | #include 11 | 12 | namespace watchman { 13 | 14 | void WatchmanStats::flush() { 15 | // This method is only really useful while testing to ensure that the service 16 | // data singleton instance has the latest stats. Since all our stats are now 17 | // quantile stat based, flushing the quantile stat map is sufficient for that 18 | // use case. 19 | facebook::fb303::ServiceData::get()->getQuantileStatMap()->flushAll(); 20 | } 21 | 22 | WatchmanStatsPtr getWatchmanStats() { 23 | // A running Watchman daemon only needs a single WatchmanStats instance. Avoid 24 | // atomic reference counts with RefPtr::singleton. We could use 25 | // folly::Singleton but that makes unit testing harder. 26 | static WatchmanStats* gWatchmanStats = new WatchmanStats; 27 | return WatchmanStatsPtr::singleton(*gWatchmanStats); 28 | } 29 | 30 | } // namespace watchman 31 | -------------------------------------------------------------------------------- /watchman/test/LogTest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include 9 | #include "watchman/Logging.h" 10 | 11 | using namespace watchman; 12 | 13 | void w_request_shutdown(void) {} 14 | 15 | TEST(Log, logging) { 16 | char huge[8192]; 17 | bool logged = false; 18 | 19 | auto sub = watchman::getLog().subscribe( 20 | watchman::DBG, [&logged]() { logged = true; }); 21 | 22 | memset(huge, 'X', sizeof(huge)); 23 | huge[sizeof(huge) - 1] = '\0'; 24 | 25 | logf(DBG, "test {}", huge); 26 | 27 | std::vector> pending; 28 | sub->getPending(pending); 29 | EXPECT_FALSE(pending.empty()) << "got an item from our subscription"; 30 | EXPECT_TRUE(logged); 31 | } 32 | 33 | /* vim:ts=2:sw=2:et: 34 | */ 35 | -------------------------------------------------------------------------------- /watchman/test/MercurialTest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/scm/Mercurial.h" 9 | #include 10 | 11 | using namespace std::chrono; 12 | 13 | TEST(Mercurial, convertCommitDate) { 14 | auto date = watchman::Mercurial::convertCommitDate("1529420960.025200"); 15 | auto result = duration_cast(date.time_since_epoch()).count(); 16 | auto expected = 1529420960; 17 | EXPECT_EQ(result, expected); 18 | } 19 | -------------------------------------------------------------------------------- /watchman/test/RingBufferTest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include 9 | 10 | #include "watchman/RingBuffer.h" 11 | 12 | using namespace watchman; 13 | 14 | TEST(RingBufferTest, writes_can_be_read) { 15 | RingBuffer rb{2}; 16 | rb.write(10); 17 | rb.write(11); 18 | auto result = rb.readAll(); 19 | EXPECT_EQ(2, result.size()); 20 | EXPECT_EQ(10, result[0]); 21 | EXPECT_EQ(11, result[1]); 22 | 23 | rb.write(12); 24 | result = rb.readAll(); 25 | EXPECT_EQ(11, result[0]); 26 | EXPECT_EQ(12, result[1]); 27 | } 28 | 29 | TEST(RingBufferTest, writes_can_be_cleared) { 30 | RingBuffer rb{10}; 31 | rb.write(3); 32 | rb.write(4); 33 | auto result = rb.readAll(); 34 | EXPECT_EQ(2, result.size()); 35 | EXPECT_EQ(3, result[0]); 36 | EXPECT_EQ(4, result[1]); 37 | rb.clear(); 38 | rb.write(5); 39 | result = rb.readAll(); 40 | EXPECT_EQ(1, result.size()); 41 | EXPECT_EQ(5, result[0]); 42 | } 43 | -------------------------------------------------------------------------------- /watchman/test/lib/FakeWatcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "watchman/watcher/Watcher.h" 11 | 12 | namespace watchman { 13 | 14 | class FileSystem; 15 | 16 | class FakeWatcher : public Watcher { 17 | public: 18 | explicit FakeWatcher(FileSystem& fileSystem, bool failsToStart = false); 19 | 20 | bool start(const std::shared_ptr& root) override; 21 | 22 | std::unique_ptr startWatchDir( 23 | const std::shared_ptr& root, 24 | const char* path) override; 25 | 26 | bool waitNotify(int timeoutms) override; 27 | ConsumeNotifyRet consumeNotify( 28 | const std::shared_ptr& root, 29 | PendingChanges& coll) override; 30 | 31 | private: 32 | FileSystem& fileSystem_; 33 | bool failsToStart_; 34 | }; 35 | 36 | } // namespace watchman 37 | -------------------------------------------------------------------------------- /watchman/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # This is a dumb wrapper to satisfy the buck_sh_test rule 8 | exec "$@" 9 | -------------------------------------------------------------------------------- /watchman/thirdparty/deelevate_binding/.gitignore: -------------------------------------------------------------------------------- 1 | .*.sw* 2 | /target 3 | Cargo.lock -------------------------------------------------------------------------------- /watchman/thirdparty/deelevate_binding/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(NOT WIN32) 2 | message( FATAL_ERROR "deelevate cannot be used on platforms other than Windows" ) 3 | endif() 4 | 5 | find_package(Python COMPONENTS Interpreter) 6 | 7 | rust_executable(deelevate BINARY_NAME eledo-pty-bridge) 8 | 9 | rust_static_library(rust_deelevate CRATE deelevate) 10 | install_rust_static_library( 11 | rust_deelevate 12 | INSTALL_DIR thirdparty 13 | ) 14 | 15 | add_library(libdeelevate INTERFACE) 16 | target_include_directories(libdeelevate INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include) 17 | target_link_libraries( 18 | libdeelevate 19 | INTERFACE 20 | rust_deelevate 21 | userenv.lib 22 | bcrypt.lib 23 | ntdll.lib 24 | ) 25 | 26 | install( 27 | TARGETS libdeelevate 28 | ) 29 | -------------------------------------------------------------------------------- /watchman/thirdparty/deelevate_binding/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "deelevate_binding" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | crate-type = ["staticlib", "lib"] 8 | 9 | [dependencies] 10 | deelevate = "0.1" 11 | -------------------------------------------------------------------------------- /watchman/thirdparty/deelevate_binding/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/watchman/thirdparty/deelevate_binding/src/lib.rs -------------------------------------------------------------------------------- /watchman/thirdparty/getopt/GetOpt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Portions Copyright (c) 1987, 1993, 1994 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Portions Copyright (c) 2003-2010, PostgreSQL Global Development Group 6 | */ 7 | 8 | #pragma once 9 | 10 | #ifdef _WIN32 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | extern int opterr; 17 | extern int optind; 18 | extern int optopt; 19 | extern char* optarg; 20 | 21 | struct option { 22 | const char* name; 23 | int has_arg; 24 | int* flag; 25 | int val; 26 | }; 27 | 28 | #define no_argument 0 29 | #define required_argument 1 30 | 31 | extern int getopt_long( 32 | int argc, 33 | char* const argv[], 34 | const char* optstring, 35 | const struct option* longopts, 36 | int* longindex); 37 | 38 | int getopt(int nargc, char* const nargv[], const char* ostr); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /watchman/thirdparty/libart/tests/runner.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "test_art.c" 5 | 6 | int main(void) 7 | { 8 | setlogmask(LOG_UPTO(LOG_DEBUG)); 9 | 10 | Suite *s1 = suite_create("art"); 11 | TCase *tc1 = tcase_create("art"); 12 | SRunner *sr = srunner_create(s1); 13 | int nf; 14 | 15 | // Add the art tests 16 | suite_add_tcase(s1, tc1); 17 | tcase_add_test(tc1, test_art_init_and_destroy); 18 | tcase_add_test(tc1, test_art_insert); 19 | tcase_add_test(tc1, test_art_insert_verylong); 20 | tcase_add_test(tc1, test_art_insert_search); 21 | tcase_add_test(tc1, test_art_insert_delete); 22 | tcase_add_test(tc1, test_art_insert_iter); 23 | tcase_add_test(tc1, test_art_iter_prefix); 24 | tcase_add_test(tc1, test_art_long_prefix); 25 | tcase_add_test(tc1, test_art_insert_search_uuid); 26 | 27 | srunner_run_all(sr, CK_ENV); 28 | nf = srunner_ntests_failed(sr); 29 | srunner_free(sr); 30 | return nf == 0 ? 0 : 1; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /watchman/thirdparty/wildmatch/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode . ((c-basic-offset . 8) 2 | (indent-tabs-mode . t) 3 | (tab-width . 8) 4 | (fill-column . 80)))) 5 | -------------------------------------------------------------------------------- /watchman/thirdparty/wildmatch/wildmatch.h: -------------------------------------------------------------------------------- 1 | /* Copyright 1986-present, Rich $alz, Wayne Davison, and Duy Nguyen. 2 | * Licensed under the Apache License, Version 2.0 */ 3 | 4 | #ifndef WILDMATCH_H 5 | #define WILDMATCH_H 6 | 7 | #define WM_CASEFOLD 1 8 | #define WM_PATHNAME 2 9 | #define WM_PERIOD 4 10 | #define WM_NOESCAPE 8 11 | 12 | #define WM_ABORT_MALFORMED 2 13 | #define WM_NOMATCH 1 14 | #define WM_MATCH 0 15 | #define WM_ABORT_ALL -1 16 | #define WM_ABORT_TO_STARSTAR -2 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | struct wildopts; 23 | 24 | int wildmatch(const char *pattern, const char *text, 25 | unsigned int flags, 26 | struct wildopts *wo); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /watchman/watcher/Watcher.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #include "watchman/watcher/Watcher.h" 9 | 10 | namespace watchman { 11 | 12 | Watcher::Watcher(const char* name, unsigned flags) : name(name), flags(flags) {} 13 | 14 | Watcher::~Watcher() {} 15 | 16 | bool Watcher::startWatchFile(watchman_file*) { 17 | return true; 18 | } 19 | 20 | bool Watcher::start(const std::shared_ptr&) { 21 | return true; 22 | } 23 | 24 | } // namespace watchman 25 | -------------------------------------------------------------------------------- /watchman/watchman_preprocessor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #pragma once 9 | 10 | // Helpers for pasting __LINE__ for symbol generation 11 | #define w_paste2(pre, post) pre##post 12 | #define w_paste1(pre, post) w_paste2(pre, post) 13 | #define w_gen_symbol(pre) w_paste1(pre, __LINE__) 14 | 15 | #if _MSC_VER >= 1400 16 | #include // @manual 17 | #if _MSC_VER > 1400 18 | #define WATCHMAN_FMT_STRING(x) _Printf_format_string_ x 19 | #else 20 | #define WATCHMAN_FMT_STRING(x) __format_string x 21 | #endif 22 | #else 23 | #define WATCHMAN_FMT_STRING(x) x 24 | #endif 25 | 26 | #ifdef __GNUC__ 27 | #define WATCHMAN_FMT_ATTR(fmt_param_no, dots_param_no) \ 28 | __attribute__((__format__(__printf__, fmt_param_no, dots_param_no))) 29 | #endif 30 | 31 | #ifndef WATCHMAN_FMT_ATTR 32 | #define WATCHMAN_FMT_ATTR(fmt_param_no, dots_param_no) /* nothing */ 33 | #endif 34 | -------------------------------------------------------------------------------- /website/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /website/.npmrc: -------------------------------------------------------------------------------- 1 | # Stop people use npm instead of yarn by accident 2 | engine-strict = true 3 | -------------------------------------------------------------------------------- /website/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | .docusaurus 4 | -------------------------------------------------------------------------------- /website/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "bracketSameLine": true, 4 | "bracketSpacing": false, 5 | "printWidth": 80, 6 | "proseWrap": "never", 7 | "singleQuote": true, 8 | "trailingComma": "all", 9 | "overrides": [ 10 | { 11 | "files": "*.md", 12 | "options": { 13 | "proseWrap": "always", 14 | "embeddedLanguageFormatting": "off" 15 | } 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /website/.stylelintrc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | module.exports = { 9 | plugins: ['stylelint-copyright'], 10 | rules: { 11 | 'docusaurus/copyright-header': true, 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /website/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | -------------------------------------------------------------------------------- /website/babel.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | module.exports = { 9 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 10 | }; 11 | -------------------------------------------------------------------------------- /website/docs/cmd/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Commands" 3 | } 4 | -------------------------------------------------------------------------------- /website/docs/cmd/clock.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: clock 3 | category: Commands 4 | --- 5 | 6 | Returns the current clock value for a watched root. 7 | 8 | _Since 3.9._ 9 | 10 | _The [capability](capabilities.md) name associated with this enhanced 11 | functionality is `clock-sync-timeout`._ 12 | 13 | `sync_timeout` specifies the number of milliseconds that you want to wait to 14 | observe a synchronization cookie. The synchronization cookie is created at the 15 | start of your clock call and, once the cookie is observed, means that the clock 16 | value returned by this command is at least as current as the time of your clock 17 | call. 18 | 19 | If no `sync_timeout` is specified, the returned clock value is the instantaneous 20 | value of the clock associated with the watched root, and may be almost 21 | immediately invalidated if there are any filesystem notifications that are yet 22 | to be processed. 23 | 24 | ```bash 25 | $ watchman clock /path/to/dir 26 | ``` 27 | 28 | JSON: 29 | 30 | Note the third options argument is optional. 31 | 32 | ```json 33 | ["clock", "/path/to/dir", {"sync_timeout": 100}] 34 | ``` 35 | -------------------------------------------------------------------------------- /website/docs/cmd/find.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: find 3 | category: Commands 4 | --- 5 | 6 | Finds all files that match the optional list of patterns under the specified 7 | dir. If no patterns were specified, all files are returned. 8 | 9 | ```bash 10 | $ watchman find /path/to/dir [patterns] 11 | ``` 12 | -------------------------------------------------------------------------------- /website/docs/cmd/get-config.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: get-config 3 | category: Commands 4 | --- 5 | 6 | The `get-config` command returns the `.watchmanconfig` for the root. If there is 7 | no `.watchmanconfig`, it returns an empty configuration field: 8 | 9 | ```bash 10 | $ watchman get-config . 11 | { 12 | "version": "2.9.9", 13 | "config": {} 14 | } 15 | ``` 16 | 17 | ```bash 18 | $ watchman get-config /path/to/root 19 | { 20 | "version": "2.9.9", 21 | "config": { 22 | "ignore_dirs": [ 23 | "buck-out" 24 | ] 25 | } 26 | } 27 | ``` 28 | 29 | Note that watchman only reads the `.watchmanconfig` file when the watch is 30 | established. If changes are made after that point, the `get-config` response 31 | will not reflect them. 32 | 33 | See [Configuration Options](../config.md#configuration-options) for details on 34 | valid contents of the `config` field. Note that the values returned by 35 | `get-config` are passed straight through from the `.watchmanconfig` file, and 36 | thus may contain fields that are not strictly legal. 37 | 38 | This command is available since watchman version 2.9.9. 39 | -------------------------------------------------------------------------------- /website/docs/cmd/get-sockname.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: get-sockname 3 | category: Commands 4 | --- 5 | 6 | If you're integrating against watchman using the unix socket and either the JSON 7 | or BSER protocol, you may need to discover the correct socket path. Rather than 8 | hard-coding the path or replicating the logic discussed in 9 | [Command Line](cli-options.md), you can simply execute the CLI to determine the 10 | path. This has the side effect of spawning the service for your user if it was 11 | not already running--bonus! 12 | 13 | ```bash 14 | $ watchman get-sockname 15 | { 16 | "version": "2.5", 17 | "sockname": "/tmp/.watchman.wez" 18 | } 19 | ``` 20 | -------------------------------------------------------------------------------- /website/docs/cmd/list-capabilities.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: list-capabilities 3 | category: Commands 4 | --- 5 | 6 | _Since 3.8._ 7 | 8 | This command returns the full list of supported [capabilities](capabilities.md) 9 | offered by the watchman server. The intention is that client applications will 10 | use the [expanded version command](version.md) to check compatibility rather 11 | than interrogating the full list. 12 | 13 | Here's some example output. The actual capabilities list is in unspecified order 14 | and is much longer than is reproduced here: 15 | 16 | ```bash 17 | $ watchman list-capabilities 18 | { 19 | "version": "3.8.0", 20 | "capabilities": [ 21 | "field-mode", 22 | "term-allof", 23 | "cmd-trigger" 24 | ] 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /website/docs/cmd/log-level.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: log-level 3 | category: Commands 4 | --- 5 | 6 | Changes the log level of your connection to the watchman service. 7 | 8 | From the command line: 9 | 10 | ```bash 11 | $ watchman --server-encoding=json --persistent log-level debug 12 | ``` 13 | 14 | JSON: 15 | 16 | ```json 17 | ["log-level", "debug"] 18 | ``` 19 | 20 | This command changes the log level of your client session. Whenever watchman 21 | writes to its log, it walks the list of client sessions and also sends a log 22 | packet to any that have their log level set to match the current log event. 23 | 24 | Valid log levels are: 25 | 26 | - `debug` - receive all log events 27 | - `error` - receive only important log events 28 | - `off` - receive no log events 29 | 30 | Note that you cannot tap into the output of triggered processes using this 31 | mechanism. 32 | 33 | Log events are sent unilaterally by the server as they happen, and have the 34 | following structure: 35 | 36 | ```json 37 | { 38 | "version": "1.0", 39 | "log": "log this please" 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /website/docs/cmd/log.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: log 3 | category: Commands 4 | --- 5 | 6 | Generates a log line in the watchman log. 7 | 8 | ```bash 9 | $ watchman log debug "log this please" 10 | ``` 11 | -------------------------------------------------------------------------------- /website/docs/cmd/shutdown-server.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: shutdown-server 3 | category: Commands 4 | --- 5 | 6 | This command causes your watchman service to exit with a normal status code. 7 | 8 | ```bash 9 | $ watchman shutdown-server 10 | ``` 11 | -------------------------------------------------------------------------------- /website/docs/cmd/trigger-del.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: trigger-del 3 | category: Commands 4 | --- 5 | 6 | Deletes a named trigger from the list of registered triggers. This disables and 7 | removes the trigger from both the in-memory and the saved state lists. 8 | 9 | ```bash 10 | $ watchman trigger-del /root triggername 11 | ``` 12 | -------------------------------------------------------------------------------- /website/docs/cmd/trigger-list.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: trigger-list 3 | category: Commands 4 | --- 5 | 6 | Returns the set of registered triggers associated with a root directory. 7 | 8 | ```bash 9 | $ watchman trigger-list /root 10 | ``` 11 | 12 | Note that the format of the output from `trigger-list` changed in Watchman 13 | version 2.9.7. It will now output a list of trigger objects as defined by the 14 | `trigger` command. 15 | -------------------------------------------------------------------------------- /website/docs/cmd/unsubscribe.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: unsubscribe 3 | category: Commands 4 | --- 5 | 6 | Available starting in version 1.6 7 | 8 | Cancels a named subscription against the specified root. The server side will no 9 | longer generate subscription packets for the specified subscription. 10 | 11 | ```json 12 | ["unsubscribe", "/path/to/root", "mysubscriptionname"] 13 | ``` 14 | -------------------------------------------------------------------------------- /website/docs/cmd/watch-del-all.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: watch-del-all 3 | category: Commands 4 | --- 5 | 6 | Available since version 3.1.1. 7 | 8 | Removes all watches and associated triggers. 9 | 10 | From the command line: 11 | 12 | ```bash 13 | $ watchman watch-del-all 14 | ``` 15 | 16 | JSON: 17 | 18 | ```json 19 | ["watch-del-all"] 20 | ``` 21 | 22 | Analogous to the `watch-del` this command will remove all watches and associated 23 | triggers from the running process, and the state file ( unless watchman service 24 | was started with 25 | [--no-save-state server option](cli-options.md#server-options)). 26 | -------------------------------------------------------------------------------- /website/docs/cmd/watch-del.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: watch-del 3 | category: Commands 4 | --- 5 | 6 | Removes a watch and any associated triggers. 7 | 8 | From the command line: 9 | 10 | ```bash 11 | $ watchman watch-del /path/to/dir 12 | ``` 13 | 14 | JSON: 15 | 16 | ```json 17 | ["watch-del", "/path/to/dir"] 18 | ``` 19 | 20 | The removed watch and any associated triggers will be removed from the state 21 | file and will not be automatically watched if/when watchman is restarted. 22 | 23 | However, if `--no-save-state` was used to start the watchman service, the watch 24 | and triggers will be deleted from the running process but no changes will be 25 | made to the state file. If this same directory is listed in the state file, the 26 | watch will be re-established if/when the service is restarted. 27 | -------------------------------------------------------------------------------- /website/docs/cmd/watch-list.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: watch-list 3 | category: Commands 4 | --- 5 | 6 | Returns a list of watched dirs. 7 | 8 | From the command line: 9 | 10 | ```bash 11 | $ watchman watch-list 12 | ``` 13 | 14 | JSON: 15 | 16 | ```json 17 | ["watch-list"] 18 | ``` 19 | 20 | Result: 21 | 22 | ```json 23 | { 24 | "version": "1.9", 25 | "roots": [ 26 | "/home/wez/watchman" 27 | ] 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /website/docs/expr/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Expression Terms" 3 | } 4 | -------------------------------------------------------------------------------- /website/docs/expr/allof.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: allof 3 | category: Expression Terms 4 | --- 5 | 6 | The `allof` expression term evaluates as true if all of the grouped expressions 7 | also evaluated as true. For example, this expression matches only files whose 8 | name ends with `.txt` and that are not empty files: 9 | 10 | ["allof", ["match", "*.txt"], ["not", "empty"]] 11 | 12 | Each array element after the term name is evaluated as an expression of its own: 13 | 14 | ["allof", expr1, expr2, ... exprN] 15 | 16 | Evaluation of the subexpressions stops at the first one that returns false. 17 | -------------------------------------------------------------------------------- /website/docs/expr/anyof.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: anyof 3 | category: Expression Terms 4 | --- 5 | 6 | The `anyof` expression term evaluates as true if any of the grouped expressions 7 | also evaluated as true. The following expression matches files whose name ends 8 | with either `.txt` or `.md`: 9 | 10 | ["anyof", ["match", "*.txt"], ["match", "*.md"]] 11 | 12 | Each array element after the term name is evaluated as an expression of its own: 13 | 14 | ["anyof", expr1, expr2, ... exprN] 15 | 16 | Evaluation of the subexpressions stops at the first one that returns true. 17 | -------------------------------------------------------------------------------- /website/docs/expr/empty.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: empty 3 | category: Expression Terms 4 | --- 5 | 6 | Evaluates as true if the file exists, has size 0 and is a regular file or 7 | directory. 8 | 9 | "empty" 10 | ["empty"] 11 | -------------------------------------------------------------------------------- /website/docs/expr/exists.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: exists 3 | category: Expression Terms 4 | --- 5 | 6 | Evaluates as true if the file exists 7 | 8 | "exists" 9 | ["exists"] 10 | -------------------------------------------------------------------------------- /website/docs/expr/false.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "false" 3 | section: Expression Terms 4 | --- 5 | 6 | The `false` expression always evaluates as false. 7 | 8 | "false" 9 | ["false"] 10 | -------------------------------------------------------------------------------- /website/docs/expr/not.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: not 3 | category: Expression Terms 4 | --- 5 | 6 | The `not` expression inverts the result of the subexpression argument: 7 | 8 | ["not", "empty"] 9 | -------------------------------------------------------------------------------- /website/docs/expr/pcre.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: pcre & ipcre 3 | category: Expression Terms 4 | --- 5 | 6 | _To use this feature, you must configure watchman `--with-pcre`!_ 7 | 8 | The `pcre` expression performs a Perl Compatible Regular Expression match 9 | against the basename of the file. This pattern matches `test_plan.php` but not 10 | `mytest_plan`: 11 | 12 | ["pcre", "^test_"] 13 | 14 | You may optionally provide a third argument to change the scope of the match 15 | from the basename to the wholename of the file. 16 | 17 | ["pcre", "txt", "basename"] 18 | ["pcre", "txt", "wholename"] 19 | 20 | `pcre` is case sensitive; for case insensitive matching use `ipcre` instead; it 21 | behaves identically to `pcre` except that the match is performed ignoring case. 22 | 23 | _Since 2.9.9._ 24 | 25 | Starting in version 2.9.9, on macOS systems where the watched root is a case 26 | insensitive filesystem (this is the common case for macOS), `pcre` is equivalent 27 | to `ipcre`. 28 | 29 | _Since 4.7._ 30 | 31 | You can override the case sensitivity of all name matching operations used in 32 | the query by setting the `case_sensitive` field in your query. 33 | -------------------------------------------------------------------------------- /website/docs/expr/suffix.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: suffix 3 | category: Expression Terms 4 | --- 5 | 6 | The `suffix` expression evaluates true if the file suffix matches the second 7 | argument. This matches files name `foo.php` and `foo.PHP` but not `foophp`: 8 | 9 | ["suffix", "php"] 10 | 11 | Suffix expression matches are case insensitive. 12 | 13 | ## suffix-set 14 | 15 | _Since 5.0_ 16 | 17 | You may specify multiple suffixes to match against by setting the second 18 | argument to an array: 19 | 20 | ["suffix", ["php", "css", "html"]] 21 | 22 | This second form can be accelerated and is preferred over an `anyof` 23 | construction. In the following example the two terms are functionally equivalent 24 | but the set form has a more efficient and thus faster runtime: 25 | 26 | ["anyof", ["suffix", "php"], ["suffix", "html"]] 27 | 28 | ["suffix", ["php", "html"]] 29 | 30 | The [capability](capabilities.md) name associated with this enhanced 31 | functionality is `suffix-set`. 32 | -------------------------------------------------------------------------------- /website/docs/expr/true.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "true" 3 | section: Expression Terms 4 | --- 5 | 6 | The `true` expression always evaluates as true. 7 | 8 | "true" 9 | ["true"] 10 | -------------------------------------------------------------------------------- /website/docs/expr/type.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: type 3 | category: Expression Terms 4 | --- 5 | 6 | Evaluates as true if the type of the file matches that specified by the second 7 | argument; this matches regular files: 8 | 9 | ["type", "f"] 10 | 11 | Possible types are: 12 | 13 | - **b**: block special file 14 | - **c**: character special file 15 | - **d**: directory 16 | - **f**: regular file 17 | - **p**: named pipe (fifo) 18 | - **l**: symbolic link 19 | - **s**: socket 20 | - **D**: Solaris Door 21 | - **?**: An unknown file type 22 | -------------------------------------------------------------------------------- /website/sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /** 9 | * Creating a sidebar enables you to: 10 | - create an ordered group of docs 11 | - render a sidebar for each doc of that group 12 | - provide next/previous navigation 13 | 14 | The sidebars can be generated from the filesystem, or explicitly defined here. 15 | 16 | Create as many sidebars as you want. 17 | */ 18 | 19 | module.exports = { 20 | // By default, Docusaurus generates a sidebar from the docs folder structure 21 | tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], 22 | 23 | // But you can create a sidebar manually 24 | /* 25 | tutorialSidebar: [ 26 | { 27 | type: 'category', 28 | label: 'Tutorial', 29 | items: ['hello'], 30 | }, 31 | ], 32 | */ 33 | }; 34 | -------------------------------------------------------------------------------- /website/src/pages/styles.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | * 7 | * @format 8 | */ 9 | 10 | /** 11 | * CSS files with the .module.css suffix will be treated as CSS modules 12 | * and scoped locally. 13 | */ 14 | 15 | .heroBanner { 16 | padding: 4rem 0; 17 | text-align: center; 18 | position: relative; 19 | overflow: hidden; 20 | } 21 | 22 | @media screen and (max-width: 996px) { 23 | .heroBanner { 24 | padding: 2rem; 25 | } 26 | } 27 | 28 | .buttons { 29 | display: flex; 30 | align-items: center; 31 | justify-content: center; 32 | } 33 | 34 | .features { 35 | display: flex; 36 | align-items: center; 37 | padding: 2rem 0; 38 | width: 100%; 39 | } 40 | 41 | .featureImage { 42 | height: 200px; 43 | width: 200px; 44 | } 45 | -------------------------------------------------------------------------------- /website/src/pages/support.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Need help? 3 | --- 4 | 5 | # Need help? 6 | 7 | If you're having trouble or otherwise have questions about Watchman, and 8 | [the troubleshooting guide](./docs/troubleshooting) didn't resolve 9 | your issue, you can try reaching out to the maintainers in one of the following 10 | ways: 11 | 12 | ## Stack Overflow 13 | 14 | We'd like to encourage discussing and answering Watchman related questions on 15 | Stack Overflow. [Look at the recent Watchman questions on Stack Overflow]( 16 | http://stackoverflow.com/questions/tagged/watchman?sort=newest) and if you 17 | can't find what you're looking for, [ask your question on Stack Overflow]( 18 | http://stackoverflow.com/questions/ask?tags=watchman) 19 | 20 | ## Bugs? 21 | 22 | If you've found a bug, or haven't had any success in reaching out through the 23 | channels above, please [file an issue in our tracker]( 24 | https://github.com/facebook/watchman/issues/new) 25 | -------------------------------------------------------------------------------- /website/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/website/static/.nojekyll -------------------------------------------------------------------------------- /website/static/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/website/static/img/favicon.png -------------------------------------------------------------------------------- /website/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/website/static/img/logo.png -------------------------------------------------------------------------------- /website/static/img/watchman-social-card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/watchman/626dd1aa4dee8fe9664f2fdaf6a3f8d86fda94ee/website/static/img/watchman-social-card.png --------------------------------------------------------------------------------