mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
26403df852
Summary: This changes the way that Eden is built and deployed. * To build the binary that must be run as `root` (but quickly drops privileges), run `buck build eden-daemon`. * To build the CLI that communicates with the daemon (and does not require privileges), run `buck build eden-cli`. * To build both, run `buck build eden`. There is an example of how to build the various parts of Eden using Buck and how to package them up in the `install` script introduced by this revision. While here, I also cleaned up some of our build files and changed them to be parameterized between internal and external use. In both cases, the user gets the "unadorned" version of their primary build targets. This ensures that shortcuts such as: ``` buck test eden/fs/integration ``` do the right thing by default. Finally, I also made `find_default_config_dir()` and `find_default_daemon_binary()` lazy whereas `find_default_config_dir()` was previously eager. Reviewed By: simpkins Differential Revision: D3436245 fbshipit-source-id: 4dfbd59ed0d198620324f0705c462334bb5a7daf
36 lines
1.2 KiB
Plaintext
36 lines
1.2 KiB
Plaintext
# This file contains macros that are shared across Eden.
|
|
|
|
|
|
def is_facebook_internal():
|
|
return read_config('codebase', 'mode') != 'public'
|
|
|
|
|
|
def get_fb_suffix():
|
|
'''Build rule suffix to use for Facebook-specific build targets.'''
|
|
# Internally at Facebook, it is convenient for the canonical version of an
|
|
# Eden build target to have no special suffix so that it can match the
|
|
# directory in which it is defined.
|
|
return '' if is_facebook_internal() else '-fb'
|
|
|
|
|
|
def get_oss_suffix():
|
|
'''Build rule suffix to use for open-source-specific build targets.'''
|
|
# Outside of Facebook, it is convenient for the canonical version of an
|
|
# Eden build target to have no special suffix so that it can match the
|
|
# directory in which it is defined.
|
|
return '-oss' if is_facebook_internal() else ''
|
|
|
|
|
|
def get_daemon_versions():
|
|
'''List of configurations to aid in creating dual build rules.
|
|
|
|
Returns:
|
|
An array of tuples where the first member is a build target for the
|
|
daemon and the second member is the suffix to use for other templated
|
|
build target names.
|
|
'''
|
|
return [
|
|
('//eden/fs/service:edenfs%s' % suffix, suffix)
|
|
for suffix in [get_fb_suffix(), get_oss_suffix()]
|
|
]
|