Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm: Remove wavm #32872

Merged
merged 6 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 1 addition & 6 deletions api/envoy/extensions/wasm/v3/wasm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ message VmConfig {
string vm_id = 1;

// The Wasm runtime type, defaults to the first available Wasm engine used at Envoy build-time.
// The priority to search for the available engine is: v8 -> wasmtime -> wamr -> wavm.
// The priority to search for the available engine is: v8 -> wasmtime -> wamr.
// Available Wasm runtime types are registered as extensions. The following runtimes are included
// in Envoy code base:
//
Expand All @@ -68,11 +68,6 @@ message VmConfig {
// **envoy.wasm.runtime.wamr**: `WAMR <https://github.com/bytecodealliance/wasm-micro-runtime/>`_-based WebAssembly runtime.
// This runtime is not enabled in the official build.
//
// .. _extension_envoy.wasm.runtime.wavm:
//
// **envoy.wasm.runtime.wavm**: `WAVM <https://wavm.github.io/>`_-based WebAssembly runtime.
// This runtime is not enabled in the official build.
//
// .. _extension_envoy.wasm.runtime.wasmtime:
//
// **envoy.wasm.runtime.wasmtime**: `Wasmtime <https://wasmtime.dev/>`_-based WebAssembly runtime.
Expand Down
6 changes: 0 additions & 6 deletions bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,6 @@ config_setting(
values = {"define": "zlib=ng"},
)

# TODO: consider converting WAVM VM support to an extension (https://github.com/envoyproxy/envoy/issues/12574)
config_setting(
name = "wasm_wavm",
values = {"define": "wasm=wavm"},
)

config_setting(
name = "wasm_v8",
values = {"define": "wasm=v8"},
Expand Down
1 change: 0 additions & 1 deletion bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,6 @@ To enable a specific WebAssembly (Wasm) engine, you'll need to pass `--define wa
* `v8` (the default included engine)
* `wamr`
* `wasmtime`
* `wavm`

If you're building from a custom build repository, the parameters need to prefixed with `@envoy`, for example
`--@envoy//source/extensions/filters/http/kill_request:enabled`.
Expand Down
2 changes: 0 additions & 2 deletions bazel/envoy_build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ load(
_envoy_select_wasm_v8 = "envoy_select_wasm_v8",
_envoy_select_wasm_wamr = "envoy_select_wasm_wamr",
_envoy_select_wasm_wasmtime = "envoy_select_wasm_wasmtime",
_envoy_select_wasm_wavm = "envoy_select_wasm_wavm",
)
load(
":envoy_test.bzl",
Expand Down Expand Up @@ -252,7 +251,6 @@ envoy_select_wasm_cpp_tests = _envoy_select_wasm_cpp_tests
envoy_select_wasm_rust_tests = _envoy_select_wasm_rust_tests
envoy_select_wasm_v8 = _envoy_select_wasm_v8
envoy_select_wasm_wamr = _envoy_select_wasm_wamr
envoy_select_wasm_wavm = _envoy_select_wasm_wavm
envoy_select_wasm_wasmtime = _envoy_select_wasm_wasmtime
envoy_select_linkstatic = _envoy_linkstatic

Expand Down
9 changes: 0 additions & 9 deletions bazel/envoy_select.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def envoy_select_wasm_v8(xs):
"@envoy//bazel:wasm_v8": xs,
"@envoy//bazel:wasm_wamr": [],
"@envoy//bazel:wasm_wasmtime": [],
"@envoy//bazel:wasm_wavm": [],
"@envoy//bazel:wasm_disabled": [],
# TODO(phlax): re-enable once issues with llvm profiler are resolved
# (see https://github.com/envoyproxy/envoy/issues/24164)
Expand All @@ -168,7 +167,6 @@ def envoy_select_wasm_v8_bool():
"@envoy//bazel:wasm_v8": True,
"@envoy//bazel:wasm_wamr": False,
"@envoy//bazel:wasm_wasmtime": False,
"@envoy//bazel:wasm_wavm": False,
"@envoy//bazel:wasm_disabled": False,
# TODO(phlax): re-enable once issues with llvm profiler are resolved
# (see https://github.com/envoyproxy/envoy/issues/24164)
Expand All @@ -183,13 +181,6 @@ def envoy_select_wasm_wamr(xs):
"//conditions:default": [],
})

# Selects the given values depending on the Wasm runtimes enabled in the current build.
def envoy_select_wasm_wavm(xs):
return select({
"@envoy//bazel:wasm_wavm": xs,
"//conditions:default": [],
})

# Selects the given values depending on the Wasm runtimes enabled in the current build.
def envoy_select_wasm_wasmtime(xs):
return select({
Expand Down
157 changes: 0 additions & 157 deletions bazel/foreign_cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -349,133 +349,6 @@ envoy_cmake(
}),
)

envoy_cmake(
name = "llvm",
cache_entries = {
# Disable both: BUILD and INCLUDE, since some of the INCLUDE
# targets build code instead of only generating build files.
"LLVM_BUILD_BENCHMARKS": "off",
"LLVM_INCLUDE_BENCHMARKS": "off",
"LLVM_BUILD_DOCS": "off",
"LLVM_INCLUDE_DOCS": "off",
"LLVM_BUILD_EXAMPLES": "off",
"LLVM_INCLUDE_EXAMPLES": "off",
"LLVM_BUILD_RUNTIME": "off",
"LLVM_BUILD_RUNTIMES": "off",
"LLVM_INCLUDE_RUNTIMES": "off",
"LLVM_BUILD_TESTS": "off",
"LLVM_INCLUDE_TESTS": "off",
"LLVM_BUILD_TOOLS": "off",
"LLVM_INCLUDE_TOOLS": "off",
"LLVM_BUILD_UTILS": "off",
"LLVM_INCLUDE_UTILS": "off",
"LLVM_ENABLE_IDE": "off",
"LLVM_ENABLE_LIBEDIT": "off",
"LLVM_ENABLE_LIBXML2": "off",
"LLVM_ENABLE_TERMINFO": "off",
"LLVM_ENABLE_ZLIB": "off",
"LLVM_TARGETS_TO_BUILD": "X86",
"CMAKE_CXX_COMPILER_FORCED": "on",
# Workaround for the issue with statically linked libstdc++
# using -l:libstdc++.a.
"CMAKE_CXX_FLAGS": "-lstdc++",
},
env = {
# Workaround for the -DDEBUG flag added in fastbuild on macOS,
# which conflicts with DEBUG macro used in LLVM.
"CFLAGS": "-UDEBUG",
"CXXFLAGS": "-UDEBUG",
"ASMFLAGS": "-UDEBUG",
},
lib_source = "@org_llvm_llvm//:all",
out_static_libs = select({
"//conditions:default": [
# This list must be updated when the bazel llvm version is updated
# (in `bazel/repository_locations.bzl`)
#
# The list can be regenerated by compiling the correct/updated llvm version
# from sources and running:
#
# `llvm-config --libnames`
#
"libLLVMWindowsManifest.a",
"libLLVMXRay.a",
"libLLVMLibDriver.a",
"libLLVMDlltoolDriver.a",
"libLLVMCoverage.a",
"libLLVMLineEditor.a",
"libLLVMX86Disassembler.a",
"libLLVMX86AsmParser.a",
"libLLVMX86CodeGen.a",
"libLLVMX86Desc.a",
"libLLVMX86Info.a",
"libLLVMOrcJIT.a",
"libLLVMMCJIT.a",
"libLLVMJITLink.a",
"libLLVMOrcTargetProcess.a",
"libLLVMOrcShared.a",
"libLLVMInterpreter.a",
"libLLVMExecutionEngine.a",
"libLLVMRuntimeDyld.a",
"libLLVMSymbolize.a",
"libLLVMDebugInfoPDB.a",
"libLLVMDebugInfoGSYM.a",
"libLLVMOption.a",
"libLLVMObjectYAML.a",
"libLLVMMCA.a",
"libLLVMMCDisassembler.a",
"libLLVMLTO.a",
"libLLVMPasses.a",
"libLLVMCFGuard.a",
"libLLVMCoroutines.a",
"libLLVMObjCARCOpts.a",
"libLLVMHelloNew.a",
"libLLVMipo.a",
"libLLVMVectorize.a",
"libLLVMLinker.a",
"libLLVMInstrumentation.a",
"libLLVMFrontendOpenMP.a",
"libLLVMFrontendOpenACC.a",
"libLLVMExtensions.a",
"libLLVMDWARFLinker.a",
"libLLVMGlobalISel.a",
"libLLVMMIRParser.a",
"libLLVMAsmPrinter.a",
"libLLVMDebugInfoDWARF.a",
"libLLVMSelectionDAG.a",
"libLLVMCodeGen.a",
"libLLVMIRReader.a",
"libLLVMAsmParser.a",
"libLLVMInterfaceStub.a",
"libLLVMFileCheck.a",
"libLLVMFuzzMutate.a",
"libLLVMTarget.a",
"libLLVMScalarOpts.a",
"libLLVMInstCombine.a",
"libLLVMAggressiveInstCombine.a",
"libLLVMTransformUtils.a",
"libLLVMBitWriter.a",
"libLLVMAnalysis.a",
"libLLVMProfileData.a",
"libLLVMObject.a",
"libLLVMTextAPI.a",
"libLLVMMCParser.a",
"libLLVMMC.a",
"libLLVMDebugInfoCodeView.a",
"libLLVMDebugInfoMSF.a",
"libLLVMBitReader.a",
"libLLVMCore.a",
"libLLVMRemarks.a",
"libLLVMBitstreamReader.a",
"libLLVMBinaryFormat.a",
"libLLVMSupport.a",
"libLLVMDemangle.a",
],
}),
tags = ["skip_on_windows"],
alwayslink = True,
)

envoy_cmake(
name = "nghttp2",
cache_entries = {
Expand Down Expand Up @@ -522,36 +395,6 @@ envoy_cmake(
tags = ["skip_on_windows"],
)

envoy_cmake(
name = "wavm",
cache_entries = {
"LLVM_DIR": "$EXT_BUILD_DEPS/copy_llvm/llvm/lib/cmake/llvm",
"WAVM_ENABLE_STATIC_LINKING": "on",
"WAVM_ENABLE_RELEASE_ASSERTS": "on",
"WAVM_ENABLE_UNWIND": "on",
# Workaround for the issue with statically linked libstdc++
# using -l:libstdc++.a.
"CMAKE_CXX_FLAGS": "-lstdc++ -Wno-unused-command-line-argument",
},
env = {
# Workaround for the -DDEBUG flag added in fastbuild on macOS,
# which conflicts with DEBUG macro used in LLVM.
"CFLAGS": "-UDEBUG",
"CXXFLAGS": "-UDEBUG -Wno-error=unused-but-set-variable",
"ASMFLAGS": "-UDEBUG",
},
lib_source = "@com_github_wavm_wavm//:all",
out_binaries = ["wavm"],
out_static_libs = select({
"//conditions:default": [
"libWAVM.a",
"libWAVMUnwind.a",
],
}),
tags = ["skip_on_windows"],
deps = [":llvm"],
)

envoy_cmake(
name = "zlib",
cache_entries = {
Expand Down
25 changes: 0 additions & 25 deletions bazel/foreign_cc/llvm.patch

This file was deleted.

24 changes: 0 additions & 24 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,7 @@ def envoy_dependencies(skip_targets = []):
_rust_deps()
_kafka_deps()

_org_llvm_llvm()
_com_github_wamr()
_com_github_wavm_wavm()
_com_github_wasmtime()
_com_github_wasm_c_api()

Expand Down Expand Up @@ -1359,18 +1357,6 @@ def _com_github_gperftools_gperftools():
actual = "@envoy//bazel/foreign_cc:gperftools",
)

def _org_llvm_llvm():
external_http_archive(
name = "org_llvm_llvm",
build_file_content = BUILD_ALL_CONTENT,
patch_args = ["-p1"],
patches = ["@envoy//bazel/foreign_cc:llvm.patch"],
)
native.bind(
name = "llvm",
actual = "@envoy//bazel/foreign_cc:llvm",
)

def _com_github_wamr():
external_http_archive(
name = "com_github_wamr",
Expand All @@ -1381,16 +1367,6 @@ def _com_github_wamr():
actual = "@envoy//bazel/foreign_cc:wamr",
)

def _com_github_wavm_wavm():
external_http_archive(
name = "com_github_wavm_wavm",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "wavm",
actual = "@envoy//bazel/foreign_cc:wavm",
)

def _com_github_wasmtime():
external_http_archive(
name = "com_github_wasmtime",
Expand Down
35 changes: 0 additions & 35 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1059,26 +1059,6 @@ REPOSITORY_LOCATIONS_SPEC = dict(
license = "Apache-2.0",
license_url = "https://github.com/bazelbuild/rules_pkg/blob/{version}/LICENSE",
),
org_llvm_llvm = dict(
# When changing this, you must re-generate the list of llvm libs
# see `bazel/foreign_cc/BUILD` for further information.
project_name = "LLVM",
project_desc = "LLVM Compiler Infrastructure",
project_url = "https://llvm.org",
version = "12.0.1",
sha256 = "7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf",
strip_prefix = "llvm-{version}.src",
urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/llvm-{version}.src.tar.xz"],
release_date = "2021-07-09",
use_category = ["dataplane_ext"],
extensions = [
"envoy.wasm.runtime.wamr",
"envoy.wasm.runtime.wavm",
],
cpe = "cpe:2.3:a:llvm:*:*",
license = "Apache-2.0",
license_url = "https://github.com/llvm/llvm-project/blob/llvmorg-{version}/llvm/LICENSE.TXT",
),
com_github_wamr = dict(
project_name = "Webassembly Micro Runtime",
project_desc = "A standalone runtime with a small footprint for WebAssembly",
Expand All @@ -1094,19 +1074,6 @@ REPOSITORY_LOCATIONS_SPEC = dict(
license = "Apache-2.0",
license_url = "https://github.com/bytecodealliance/wasm-micro-runtime/blob/{version}/LICENSE",
),
com_github_wavm_wavm = dict(
project_name = "WAVM",
project_desc = "WebAssembly Virtual Machine",
project_url = "https://wavm.github.io",
version = "3f9a150cac7faf28eab357a2c5b83d2ec740c7d9",
sha256 = "82e05ade03fdac60cf863972d3e7420a771ef4a18afad26ac442554ab0be1207",
strip_prefix = "WAVM-{version}",
urls = ["https://github.com/WAVM/WAVM/archive/{version}.tar.gz"],
release_date = "2022-05-14",
use_category = ["dataplane_ext"],
extensions = ["envoy.wasm.runtime.wavm"],
cpe = "cpe:2.3:a:webassembly_virtual_machine_project:webassembly_virtual_machine:*",
),
com_github_wasmtime = dict(
project_name = "wasmtime",
project_desc = "A standalone runtime for WebAssembly",
Expand Down Expand Up @@ -1417,7 +1384,6 @@ REPOSITORY_LOCATIONS_SPEC = dict(
"envoy.wasm.runtime.null",
"envoy.wasm.runtime.v8",
"envoy.wasm.runtime.wamr",
"envoy.wasm.runtime.wavm",
"envoy.wasm.runtime.wasmtime",
],
release_date = "2023-05-01",
Expand All @@ -1443,7 +1409,6 @@ REPOSITORY_LOCATIONS_SPEC = dict(
"envoy.wasm.runtime.null",
"envoy.wasm.runtime.v8",
"envoy.wasm.runtime.wamr",
"envoy.wasm.runtime.wavm",
"envoy.wasm.runtime.wasmtime",
],
release_date = "2023-12-19",
Expand Down
Loading
Loading