-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathsetup_devshell.sh
More file actions
39 lines (30 loc) · 1.47 KB
/
setup_devshell.sh
File metadata and controls
39 lines (30 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Posix SH compatible source script
esc=$(printf '\033')
red="${esc}[0;31m"
clr="${esc}[0m"
export PROBE_ROOT="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
printf "PROBE_ROOT = %s\n" "$PROBE_ROOT"
# Rust CLI uses PROBE_LIB to find libprobe binary
export PROBE_LIB="$PROBE_ROOT/libprobe/.build"
# Ensure libprobe.so gets made
if [ ! -f "$PROBE_LIB/libprobe.so" ]; then
printf "%sPlease run 'just compile-lib' to compile libprobe%s\n" "$red" "$clr"
fi
# Rust code uses PYGEN_OUTFILE to determine where to write this file.
export PYGEN_OUTFILE="$PROBE_ROOT/probe_py/probe_py/ops.py"
# Rust code uses CBINDGEN_OUTFILE to determine where to write this file.
export CBINDGEN_OUTFILE="$PROBE_ROOT/libprobe/generated/headers.h"
export JSONSCHEMA_OUTFILE="$PROBE_ROOT/libprobe/generated/headers.json"
export PYTHON_HEADER_OUTFILE="$PROBE_ROOT/probe_py/probe_py/headers.py"
export SIZE_CHECK_OUTFILE="$PROBE_ROOT/libprobe/generated/size_checks.h"
# Ensure PROBE CLI gets built
if [ ! -f "$PROBE_ROOT/cli-wrapper/target/release/probe" ]; then
printf "%sPlease run 'just compile-cli' to compile probe binary%s\n" "$red" "$clr"
fi
# Add PROBE CLI to path
export PATH="$PROBE_ROOT/cli-wrapper/target/debug:$PATH"
# Add probe_py to the Python path
# PYTHONPATH gets consumed by Python tooling
# PROBE_PYTHONPATH gets consumed by `probe py` (works in situations where the environment needs a different `PYTHONPATH`)
export PYTHONPATH="$PROBE_ROOT/probe_py/:$PYTHONPATH"
export PROBE_PYTHONPATH="$PYTHONPATH"