Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
casimiro committed Sep 11, 2023
1 parent c45aef5 commit 52ee467
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cc: [clang-15, gcc-12]
# cc: [clang-15, gcc-12]
cc: [clang-15]
ngx: [1.25.2]
runtime: [wasmtime, wasmer, v8]
# runtime: [wasmtime, wasmer, v8]
runtime: [wasmer]
wasmtime: [12.0.1]
wasmer: [3.1.1]
v8: [11.4.183.23]
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/job-build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ jobs:
#if: ${{ false }}
runs-on: ${{ inputs.os }}
steps:
- name: 'Setup deps - apt-get gcc'
if: ${{ !env.ACT && contains(inputs.cc, 'gcc') }}
run: sudo apt-get update && sudo apt-get install -y ${CC} libstdc++-${CC#*-}-dev lcov

- name: 'Setup deps - apt-get clang'
if: ${{ !env.ACT && contains(inputs.cc, 'clang') }}
run: sudo apt-get update && sudo apt-get install -y ${CC} lcov

- uses: actions/checkout@v3
- name: 'Setup cache - work/ dir'
uses: actions/cache@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/job-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ jobs:
id: lcov
if: ${{ !env.ACT && inputs.coverage }}
run: |
lcov --capture --directory work/buildroot --output-file lcov.info
lcov --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info
lcov --extract lcov.info "*/ngx_wasm_module/src/*" --output-file lcov.info
lcov --gcov-tool gcov-${CC#*-} --capture --directory work/buildroot --output-file lcov.info
lcov --gcov-tool gcov-${CC#*-} --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info
lcov --gcov-tool gcov-${CC#*-} --extract lcov.info "*/ngx_wasm_module/src/*" --output-file lcov.info
name="unit"
if [ -n "${{ inputs.openresty }}" ]; then
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ todo:
.PHONY: act-build
act-build:
@docker build \
--load \
-t wasmx-build-ubuntu \
-f ./assets/release/Dockerfiles/Dockerfile.ubuntu-22.04 \
./assets/release/Dockerfiles
Expand Down
4 changes: 3 additions & 1 deletion assets/release/Dockerfiles/Dockerfile.ubuntu-22.04
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN apt-get update && \
git \
pkg-config \
libglib2.0-dev \
clang \
clang-15 \
curl \
binfmt-support \
qemu-user-static
Expand All @@ -26,6 +26,7 @@ ENV PATH $CARGO_HOME/bin:$PATH
RUN mkdir -p "$CARGO_HOME" && mkdir -p "$RUSTUP_HOME" && \
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \
chmod -R a=rwX $CARGO_HOME $RUSTUP_HOME
RUN rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown

RUN /bin/bash -c 'echo $(uname -m) > /TG_ARCH || : ; \
[[ $(cat /TG_ARCH) == "x86_64" ]] && echo "amd64" > /TG_ARCH || : ; \
Expand All @@ -43,6 +44,7 @@ RUN apt-get install -y \
valgrind \
nodejs \
gcovr \
lcov \
unzip \
sudo && \
curl -sLO https://golang.google.cn/dl/go${GOLANG_VERSION}.linux-$(cat /TG_ARCH).tar.gz && \
Expand Down
2 changes: 1 addition & 1 deletion src/wasm/ngx_wasm_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ngx_wasm_ops_plan_load(ngx_wasm_ops_plan_t *plan, ngx_log_t *log)
ngx_uint_t *fid;
ngx_array_t *ids;
ngx_wasm_op_t *op;
ngx_wasm_ops_pipeline_t *pipeline;
ngx_wasm_ops_pipeline_t *pipeline = NULL;

dd("enter");

Expand Down
6 changes: 6 additions & 0 deletions src/wasm/wrt/ngx_wrt_wasmer.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ ngx_wasmer_init_instance(ngx_wrt_instance_t *instance, ngx_wrt_store_t *store,
ngx_wrt_module_t *module, ngx_pool_t *pool, ngx_wrt_err_t *err)
{
size_t i, j;
#if (NGX_DEBUG)
ngx_uint_t nimports = 0;
#endif
ngx_wrt_import_t *import;
ngx_wasmer_hfunc_ctx_t *hctx, *hctxs = NULL;
wasm_func_t *func;
Expand Down Expand Up @@ -558,7 +560,9 @@ ngx_wasmer_init_instance(ngx_wrt_instance_t *instance, ngx_wrt_store_t *store,
instance->env.data[i] = (wasm_extern_t *)
wasmer_named_extern_unwrap(
instance->wasi_imports.data[j]);
#if (NGX_DEBUG)
nimports++;
#endif
break;
}
}
Expand All @@ -576,7 +580,9 @@ ngx_wasmer_init_instance(ngx_wrt_instance_t *instance, ngx_wrt_store_t *store,
hctx, NULL);

instance->env.data[i] = wasm_func_as_extern(func);
#if (NGX_DEBUG)
nimports++;
#endif
break;

default:
Expand Down

0 comments on commit 52ee467

Please sign in to comment.