sapling/install
Michael Bolin 26403df852 Exclude the cpp_binary for the daemon from the python_binary for the CLI.
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
2016-06-15 17:07:58 -07:00

19 lines
440 B
Bash

#!/bin/bash
set -e
cd `git rev-parse --show-toplevel`
buck build eden-cli eden-daemon
OUTPUT_DIR=buck-out/eden
mkdir -p $OUTPUT_DIR
EDEN_CLI=`buck targets --show-output eden-cli | awk '{print $2}'`
EDEN_DAEMON=`buck targets --show-output eden-daemon | awk '{print $2}'`
cp "$EDEN_CLI" "$OUTPUT_DIR/eden"
cp "$EDEN_DAEMON" "$OUTPUT_DIR/daemon"
sudo chmod 4755 "$OUTPUT_DIR/daemon"
echo "Eden executable available in $OUTPUT_DIR/eden."