diff --git a/.gitignore b/.gitignore index 7007287644b..0beba261bba 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ docker/envoy *.iml *.test /artifacts +**/plugin.wasm diff --git a/Makefile.core.mk b/Makefile.core.mk index 16240bbfc19..c462a5af700 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -60,6 +60,9 @@ build: build_envoy: export PATH=$(PATH) CC=$(CC) CXX=$(CXX) && bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) $(BAZEL_CONFIG_REL) //src/envoy:envoy +build_wasm: + $(foreach file, $(shell find extensions -name build_wasm.sh), cd $(TOP)/$(shell dirname $(file)) && bash ./build_wasm.sh &&) true + clean: @bazel clean diff --git a/extensions/common/node_info_cache.cc b/extensions/common/node_info_cache.cc index b2b95f44862..d5059abeeb9 100644 --- a/extensions/common/node_info_cache.cc +++ b/extensions/common/node_info_cache.cc @@ -15,7 +15,11 @@ #include "extensions/common/node_info_cache.h" +#include "absl/strings/str_cat.h" #include "extensions/common/context.h" +#include "google/protobuf/util/json_util.h" + +using google::protobuf::util::Status; #ifdef NULL_PLUGIN @@ -23,7 +27,6 @@ using Envoy::Extensions::Common::Wasm::Null::Plugin::getStringValue; using Envoy::Extensions::Common::Wasm::Null::Plugin::getStructValue; using Envoy::Extensions::Common::Wasm::Null::Plugin::logDebug; using Envoy::Extensions::Common::Wasm::Null::Plugin::logInfo; -using google::protobuf::util::Status; #endif // NULL_PLUGIN diff --git a/extensions/metadata_exchange/build_wasm.sh b/extensions/metadata_exchange/build_wasm.sh index a717b9f68cd..d4f0d2c00b9 100755 --- a/extensions/metadata_exchange/build_wasm.sh +++ b/extensions/metadata_exchange/build_wasm.sh @@ -14,5 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -e + docker run -e uid="$(id -u)" -e gid="$(id -g)" -v $PWD:/work -w /work -v $(realpath $PWD/../../extensions):/work/extensions gcr.io/istio-testing/wasmsdk:v2 bash /build_wasm.sh rmdir extensions diff --git a/extensions/metadata_exchange/plugin.h b/extensions/metadata_exchange/plugin.h index 1a03ef7c897..df54b4c101a 100644 --- a/extensions/metadata_exchange/plugin.h +++ b/extensions/metadata_exchange/plugin.h @@ -15,6 +15,8 @@ #pragma once +#include "extensions/common/context.h" + #ifndef NULL_PLUGIN #include @@ -26,7 +28,6 @@ static const std::string EMPTY_STRING; #else -#include "extensions/common/context.h" #include "extensions/common/wasm/null/null_plugin.h" namespace Envoy { diff --git a/extensions/stats/Makefile b/extensions/stats/Makefile index b5f1792337e..7834865cbc2 100644 --- a/extensions/stats/Makefile +++ b/extensions/stats/Makefile @@ -5,7 +5,7 @@ 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 PROTO_SRCS = extensions/common/node_info.pb.cc config.pb.cc -COMMON_SRCS = extensions/common/context.cc +COMMON_SRCS = extensions/common/context.cc extensions/common/node_info_cache.cc extensions/common/util.cc all: plugin.wasm diff --git a/extensions/stats/build_wasm.sh b/extensions/stats/build_wasm.sh index a717b9f68cd..d4f0d2c00b9 100755 --- a/extensions/stats/build_wasm.sh +++ b/extensions/stats/build_wasm.sh @@ -14,5 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -e + docker run -e uid="$(id -u)" -e gid="$(id -g)" -v $PWD:/work -w /work -v $(realpath $PWD/../../extensions):/work/extensions gcr.io/istio-testing/wasmsdk:v2 bash /build_wasm.sh rmdir extensions diff --git a/extensions/stats/plugin.wasm b/extensions/stats/plugin.wasm deleted file mode 100644 index e3209e1862e..00000000000 Binary files a/extensions/stats/plugin.wasm and /dev/null differ