From eac59ec4c843df0f7461b9945ec7c1ae7273bd80 Mon Sep 17 00:00:00 2001 From: Yuchen Dai Date: Mon, 11 Feb 2019 11:32:25 -0800 Subject: [PATCH] add instruction of compiling wasm_example filter Including - Set up enscripten environment - With a valid enscripten, build out new .wasm file --- examples/wasm/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/examples/wasm/README.md b/examples/wasm/README.md index 777ed0bc7892..a947c2d008b9 100644 --- a/examples/wasm/README.md +++ b/examples/wasm/README.md @@ -63,3 +63,24 @@ Curl output should include our headers: * Connection #0 to host localhost left intact } ``` + +# Build WASM Binary +## prerequisite +1. [Download and install `emscripten`](https://emscripten.org/docs/getting_started/downloads.html#installation-instructions) +2. Activate emsdk archived version 1.38.25 (Note: by 02/11/2019 the latest build is broken for envoy-wasm) + +``` +# in emsdk directory +./emsdk install sdk-1.38.25-64bit +./emsdk activate sdk-1.38.25-64bit +source emsdk_env.sh +# verify +em++ -v 2>&1 |grep Emscripten ## should output 1.38.25 +``` +3. Build wasm filter in envoy directory + +```shell +envoy/examples/wasm$ source /emsdk_env.sh # Only needed if in another shell session +envoy/examples/wasm$ touch envoy_filter_http_wasm_example.cc && make +``` +