From 54c2f072d03a58eee3c51003683222184b1e1500 Mon Sep 17 00:00:00 2001 From: Mingshen Sun Date: Wed, 2 Feb 2022 17:09:33 -0800 Subject: [PATCH 1/2] Export TVM_HOME env var for prebuilt tvm-sys (#607) --- examples/python/wasm_tvm_mnist_payload/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/python/wasm_tvm_mnist_payload/Makefile b/examples/python/wasm_tvm_mnist_payload/Makefile index ef1a3940e..bc2f0395a 100644 --- a/examples/python/wasm_tvm_mnist_payload/Makefile +++ b/examples/python/wasm_tvm_mnist_payload/Makefile @@ -15,7 +15,8 @@ # specific language governing permissions and limitations # under the License. -TVM_HOME ?= /tvm +# export TVM_HOME to prebuilt tvm-sys, don't change +export TVM_HOME = /tvm export PYTHONPATH = $(shell printenv PYTHONPATH):${TVM_HOME}/python all: From fcd47167ba9f511ec16f8a0a22654b75e7e7bb0c Mon Sep 17 00:00:00 2001 From: Yu Ding Date: Wed, 2 Feb 2022 15:15:25 -0800 Subject: [PATCH 2/2] fix: code coverage report generation --- cmake/scripts/gen_cov.sh | 2 +- docker/build.ubuntu-1804.sgx-2.14.Dockerfile | 7 +++++++ docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile | 7 +++++++ docker/build.ubuntu-2004.sgx-2.15.1.Dockerfile | 7 +++++++ docker/build.ubuntu-2004.sgx-dcap-1.12.1.Dockerfile | 7 +++++++ third_party/crates-sgx | 2 +- 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/cmake/scripts/gen_cov.sh b/cmake/scripts/gen_cov.sh index 64aaad90e..6102d5b78 100755 --- a/cmake/scripts/gen_cov.sh +++ b/cmake/scripts/gen_cov.sh @@ -49,7 +49,7 @@ cd ${TEACLAVE_OUT_DIR} && ${LCOV} ${LCOVOPT} $(for tag in \ `find ${TEACLAVE_PROJECT_ROOT} -name sgx_cov*.gcda | cut -d'.' -f2`; \ do echo "--add modules_$tag.info"; done) \ --add modules.info -o merged.info -cd ${TEACLAVE_OUT_DIR} && python ${LCOV_REALPATH} merged.info > merged_realpath.info +cd ${TEACLAVE_OUT_DIR} && python3 ${LCOV_REALPATH} merged.info > merged_realpath.info ${LCOV} ${LCOVOPT} --extract ${TEACLAVE_OUT_DIR}/merged_realpath.info \ `find ${TEACLAVE_PROJECT_ROOT} -path ${TEACLAVE_PROJECT_ROOT}/third_party -prune -o \ -path ${TEACLAVE_PROJECT_ROOT}/build -prune -o \ diff --git a/docker/build.ubuntu-1804.sgx-2.14.Dockerfile b/docker/build.ubuntu-1804.sgx-2.14.Dockerfile index f1b070ac9..434afa404 100644 --- a/docker/build.ubuntu-1804.sgx-2.14.Dockerfile +++ b/docker/build.ubuntu-1804.sgx-2.14.Dockerfile @@ -130,6 +130,13 @@ RUN git clone https://github.com/apache/tvm /tvm && \ cmake -DUSE_LLVM=ON .. && \ make -j$(nproc) +# Install llvm-cov version 11 from llvm-11 +RUN wget https://apt.llvm.org/llvm.sh && \ + chmod +x llvm.sh && \ + ./llvm.sh 11 && \ + update-alternatives --install /usr/bin/llvm-cov llvm-cov-11 /usr/bin/llvm-cov-11 11 && \ + rm ./llvm.sh + # clean up apt caches RUN apt-get clean && \ diff --git a/docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile b/docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile index d5ce810c0..377465bd6 100644 --- a/docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile +++ b/docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile @@ -138,6 +138,13 @@ RUN git clone https://github.com/apache/tvm /tvm && \ cmake -DUSE_LLVM=ON .. && \ make -j$(nproc) +# Install llvm-cov version 11 from llvm-11 +RUN wget https://apt.llvm.org/llvm.sh && \ + chmod +x llvm.sh && \ + ./llvm.sh 11 && \ + update-alternatives --install /usr/bin/llvm-cov llvm-cov-11 /usr/bin/llvm-cov-11 11 && \ + rm ./llvm.sh + # clean up apt caches RUN apt-get clean && \ diff --git a/docker/build.ubuntu-2004.sgx-2.15.1.Dockerfile b/docker/build.ubuntu-2004.sgx-2.15.1.Dockerfile index 7c4c3416a..b1baf2e28 100644 --- a/docker/build.ubuntu-2004.sgx-2.15.1.Dockerfile +++ b/docker/build.ubuntu-2004.sgx-2.15.1.Dockerfile @@ -130,6 +130,13 @@ RUN git clone https://github.com/apache/tvm /tvm && \ cmake -DUSE_LLVM=ON .. && \ make -j$(nproc) +# Install llvm-cov version 11 from llvm-11 +RUN wget https://apt.llvm.org/llvm.sh && \ + chmod +x llvm.sh && \ + ./llvm.sh 11 && \ + update-alternatives --install /usr/bin/llvm-cov llvm-cov-11 /usr/bin/llvm-cov-11 11 && \ + rm ./llvm.sh + # clean up apt caches RUN apt-get clean && \ diff --git a/docker/build.ubuntu-2004.sgx-dcap-1.12.1.Dockerfile b/docker/build.ubuntu-2004.sgx-dcap-1.12.1.Dockerfile index 6a2f00d68..e346e0c16 100644 --- a/docker/build.ubuntu-2004.sgx-dcap-1.12.1.Dockerfile +++ b/docker/build.ubuntu-2004.sgx-dcap-1.12.1.Dockerfile @@ -138,6 +138,13 @@ RUN git clone https://github.com/apache/tvm /tvm && \ cmake -DUSE_LLVM=ON .. && \ make -j$(nproc) +# Install llvm-cov version 11 from llvm-11 +RUN wget https://apt.llvm.org/llvm.sh && \ + chmod +x llvm.sh && \ + ./llvm.sh 11 && \ + update-alternatives --install /usr/bin/llvm-cov llvm-cov-11 /usr/bin/llvm-cov-11 11 && \ + rm ./llvm.sh + # clean up apt caches RUN apt-get clean && \ diff --git a/third_party/crates-sgx b/third_party/crates-sgx index 7b5fdc60d..51ec87b2f 160000 --- a/third_party/crates-sgx +++ b/third_party/crates-sgx @@ -1 +1 @@ -Subproject commit 7b5fdc60d567134009143de5d362db82d46165eb +Subproject commit 51ec87b2f61a0324f2698d6dda858e4d2758a78a