Skip to content

Commit e869310

Browse files
jayantkJayant Krishnamurthy
and
Jayant Krishnamurthy
authored
Update docs for m1 mac build (#110)
* update docs for m1 build * update docs based on feedback Co-authored-by: Jayant Krishnamurthy <[email protected]>
1 parent ea94228 commit e869310

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,30 @@ apt install libzstd-dev
1717
apt install cmake
1818
1919
# default is release build
20-
mkdir build
21-
cd build
22-
cmake ..
23-
make
20+
./scripts/build.sh
21+
```
22+
23+
You may want to build this repository inside a linux docker container for various reasons, e.g., if building on an M1 mac, or to run BPF binaries.
24+
You can run the following command to open a shell in a linux docker container with the pyth-client directory mounted:
2425

25-
# run unit tests
26-
ctest
2726
```
27+
export PYTH_REPO=/path/to/host/pyth-client
28+
export IMAGE="docker.io/pythfoundation/pyth-client:devnet-v2.8.1"
29+
30+
docker run -it \
31+
--volume "${HOME}:/home/pyth/home" \
32+
--volume "${HOME}/.config:/home/pyth/.config" \
33+
--mount "type=bind,src=${PYTH_REPO},target=/home/pyth/pyth-client" \
34+
--userns=host \
35+
--user="$( id -ur ):$( id -gr )" \
36+
--platform linux/amd64 \
37+
$IMAGE \
38+
/bin/bash -l
39+
```
40+
41+
This command runs a recent pyth-client docker image that already has the necessary dependencies installed.
42+
Therefore, once the container is running, all you have to do is run `cd pyth-client && ./scripts/build.sh`.
43+
Note that updates to the `pyth-client` directory made inside the docker container will be persisted to the host filesystem (which is probably desirable).
2844

2945
### Fuzzing
3046

0 commit comments

Comments
 (0)