Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ The docker image can be used for compiling wasm files.
Create a directory with your source files and a Makefile:

```
DOCKER_SDK=/sdk
PROXY_WASM_CPP_SDK=/sdk

all: myproject.wasm

include ${DOCKER_SDK}/Makefile.base_lite
include ${PROXY_WASM_CPP_SDK}/Makefile.base_lite
```

Source file (myproject.cc):
Expand Down Expand Up @@ -82,11 +82,11 @@ To use a newer/specific version of the SDK (e.g. from the version of Enovy you a
Here is an example Makefile referencing the SDK at ../envoy/api/wasm/cpp and mounted as 'sdk' in the /work directory:

```
DOCKER_SDK=/work/sdk
PROXY_WASM_CPP_SDK=/work/sdk

all: myproject.wasm

include ${DOCKER_SDK}/Makefile.base_lite
include ${PROXY_WASM_CPP_SDK}/Makefile.base_lite
```

Run docker pointing to Envoy sources in a directory parallel (at the same level) as your project directory:
Expand All @@ -100,8 +100,8 @@ docker run -v $PWD:/work -v $PWD/../envoy/api/wasm/cpp:/work/sdk -w /work wasms
Abseil (optionally) is built in /root/abseil and can be used. Note that the abseil containers (e.g. absl::flat\_hash\_set) exercise many syscalls which are not supported. Consequantally individual files should be pulled in which are relatively self contained (e.g. strings). Example customized Makefile:

```
DOCKER_SDK=/sdk
CPP_API:=${DOCKER_SDK}
PROXY_WASM_CPP_SDK=/sdk
CPP_API:=${PROXY_WASM_CPP_SDK}
CPP_CONTEXT_LIB = ${CPP_API}/proxy_wasm_intrinsics.cc
ABSL = /root/abseil-cpp
ABSL_CPP = ${ABSL}/absl/strings/str_cat.cc ${ABSL}/absl/strings/str_split.cc ${ABSL}/absl/strings/numbers.cc ${ABSL}/absl/strings/ascii.cc
Expand All @@ -116,8 +116,8 @@ all: plugin.wasm
Precompiled abseil libraries are also available, so the above can also be done as:

```
DOCKER_SDK=/sdk
CPP_API:=${DOCKER_SDK}
PROXY_WASM_CPP_SDK=/sdk
CPP_API:=${PROXY_WASM_CPP_SDK}
CPP_CONTEXT_LIB = ${CPP_API}/proxy_wasm_intrinsics.cc
ABSL = /root/abseil-cpp
ABSL_LIBS = ${ABSL}/absl/strings/libabsl_strings.a ${ABSL}/absl/strings/libabsl_strings_internal.a ${ABSL}/absl/strings/libabsl_str_format_internal.a
Expand All @@ -134,12 +134,12 @@ all: plugin.wasm
The compiled files may be owned by root. To chown them add the follow lines to the Makefile and docker invocation:

```
DOCKER_SDK=/sdk
PROXY_WASM_CPP_SDK=/sdk

all: myproject.wasm
chown ${uid}.${gid} $^

include ${DOCKER_SDK}/Makefile.base_lite
include ${PROXY_WASM_CPP_SDK}/Makefile.base_lite
```

Invocation file (e.g. build.sh):
Expand Down