From 89bc1d6b04beaf84fcffe9d6f16ea4f4a30f6365 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 20 May 2019 19:23:34 -0700 Subject: [PATCH] watchman: fixup FB internal mac packaging Summary: with the reshuffling around getdeps.py, and changes in folly/thrift/wangle, our internal package stopped building. This diff brings it back to life. It is a little bit interwined: * Introduce a `--facebook-internal` switch to getdeps that causes `fb` in the build context to be set to `on` rather than `off`. This allows specifying options in the manifest that are FB specific. * Introduce cmake options to control the WATCHMAN_STATE_DIR and whether cmake should attempt to create WATCHMAN_STATE_DIR when it is installed. * For FB specific builds on macOS, set the state dir to match our existing location and disable creation of WATCHMAN_STATE_DIR because that will ultimately be handling during package installation and we don't have privs for that on the machine generating the package. * Adjust Facebook CI scripts to use getdeps for building and testing watchman Reviewed By: simpkins Differential Revision: D15337970 fbshipit-source-id: 8ab3c1f810decf5f0b16337dc1cbe6dc73d26426 --- build/fbcode_builder/getdeps.py | 10 ++++++++-- build/fbcode_builder/getdeps/platform.py | 3 ++- build/fbcode_builder/manifests/watchman | 7 +++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index 5953338b0..74a553288 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -213,7 +213,7 @@ class BuildCmd(SubCmd): manifest = load_project(opts, args.project) - ctx = context_from_host_tuple() + ctx = context_from_host_tuple(facebook_internal=args.facebook_internal) print("Building on %s" % ctx) projects = manifests_in_dependency_order(opts, manifest, ctx) manifests_by_name = {m.name: m for m in projects} @@ -313,7 +313,7 @@ class TestCmd(SubCmd): opts = setup_build_options(args) manifest = load_project(opts, args.project) - ctx = context_from_host_tuple() + ctx = context_from_host_tuple(facebook_internal=args.facebook_internal) ctx["test"] = "on" projects = manifests_in_dependency_order(opts, manifest, ctx) manifests_by_name = {m.name: m for m in projects} @@ -388,6 +388,12 @@ def build_argparser(): action="store_true", default=False, ) + common_args.add_argument( + "--facebook-internal", + help="Setup the build context as an FB internal build", + action="store_true", + default=False, + ) ap = argparse.ArgumentParser( description="Get and build dependencies and projects", parents=[common_args] diff --git a/build/fbcode_builder/getdeps/platform.py b/build/fbcode_builder/getdeps/platform.py index c52bc0fc6..d3368c2c4 100644 --- a/build/fbcode_builder/getdeps/platform.py +++ b/build/fbcode_builder/getdeps/platform.py @@ -98,7 +98,7 @@ class HostType(object): ) -def context_from_host_tuple(host_tuple=None): +def context_from_host_tuple(host_tuple=None, facebook_internal=False): """ Given an optional host tuple, construct a context appropriate for passing to the boolean expression evaluator so that conditional sections in manifests can be resolved. """ @@ -113,4 +113,5 @@ def context_from_host_tuple(host_tuple=None): "os": host_type.ostype, "distro": host_type.distro, "distro_vers": host_type.distrovers, + "fb": "on" if facebook_internal else "off", } diff --git a/build/fbcode_builder/manifests/watchman b/build/fbcode_builder/manifests/watchman index 81e3d6559..5405331be 100644 --- a/build/fbcode_builder/manifests/watchman +++ b/build/fbcode_builder/manifests/watchman @@ -26,3 +26,10 @@ fbcode/eden/fs/service = eden/fs/service [cmake.defines] ENABLE_EDEN_SUPPORT=ON + +# FB macos specific settings +[cmake.defines.all(fb=on,os=darwin)] +# this path is coupled with the FB internal watchman-osx.spec +WATCHMAN_STATE_DIR=/opt/facebook/watchman/var/run/watchman +# tell cmake not to try to create /opt/facebook/... +INSTALL_WATCHMAN_STATE_DIR=OFF