{"id":22885015,"url":"https://github.com/mark8s/wasm-extensions-cpp","last_synced_at":"2026-05-01T09:32:08.596Z","repository":{"id":112108148,"uuid":"489237928","full_name":"mark8s/wasm-extensions-cpp","owner":"mark8s","description":"use c++ build  envoy wasm","archived":false,"fork":false,"pushed_at":"2022-05-09T03:31:34.000Z","size":334,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T17:59:40.687Z","etag":null,"topics":["cpp","wasm"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mark8s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-06T06:13:23.000Z","updated_at":"2022-05-27T03:25:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"d4e533d2-050b-48c5-af60-6a7235bd2ff6","html_url":"https://github.com/mark8s/wasm-extensions-cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mark8s/wasm-extensions-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark8s%2Fwasm-extensions-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark8s%2Fwasm-extensions-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark8s%2Fwasm-extensions-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark8s%2Fwasm-extensions-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mark8s","download_url":"https://codeload.github.com/mark8s/wasm-extensions-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark8s%2Fwasm-extensions-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32492154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","wasm"],"created_at":"2024-12-13T19:30:36.748Z","updated_at":"2026-05-01T09:32:08.580Z","avatar_url":"https://github.com/mark8s.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wasm-extensions-cpp\n记录使用c++ 编写Envoy wasm的过程。\n\n## Installation\nOn Linux, run the following commands:\n\nInstall `Bazelisk` as Bazel\n```shell\nsudo wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64\nsudo chmod +x /usr/local/bin/bazel\n```\nInstalling Minimum Dependencies.On Ubuntu, run the following command:\n```shell\nsudo apt-get install gcc curl python3\n```\n\n## Develop a Wasm extension with C++\n这部分的内容参考 [Develop a Wasm extension with C++](https://github.com/istio-ecosystem/wasm-extensions/blob/master/doc/write-a-wasm-extension-with-cpp.md)\n，需要了解`Bazel`相关的知识。\n\n`Bazel`是一种编译工具, 类似Maven, [istio-ecosystem/wasm-extensions/extensions](https://github.com/istio-ecosystem/wasm-extensions/tree/master/extensions) 。 目前的例子都是使用它去编译得到`.wasm`文件的。\n\n简单开发一个C++的wasm extensions过程：copy例子中的WORKSPACE与BUILD文件，然后修改plugins.cc与plugins.h文件的logic，使用`Bazel`编译成wasm文件，最后由EnvoyFilter引用到sidecar中。\n\n## 问题解决\n\n1. bazel could not resolve the version 'latest'\n\n报错详情： \n``` shell\nroot@13:~/wasm-extensions/example# bazel build //:example.wasm\n2022/05/06 02:48:58 could not resolve the version 'latest' to an actual version number: unable to determine latest version: could not list Bazel versions in GCS bucket: could not list GCS objects at https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/: could not fetch https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/: Get \"https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/\": read tcp 10.10.13.47:33302-\u003e172.217.160.106:443: read: connection reset by peer\n```\n解决办法：在当前目录下执行一下命令\n```shell\necho \"USE_BAZEL_VERSION=4.1.0\" \u003e .bazeliskrc\n```\n完事后，执行以下命令校验\n\n```shell\nroot@13:~/wasm-extensions/example# bazel version\nBazelisk version: v1.11.0\nBuild label: 4.1.0\nBuild target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar\nBuild time: Fri May 21 11:11:34 2021 (1621595494)\nBuild timestamp: 1621595494\nBuild timestamp as int: 1621595494\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark8s%2Fwasm-extensions-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark8s%2Fwasm-extensions-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark8s%2Fwasm-extensions-cpp/lists"}