-
Notifications
You must be signed in to change notification settings - Fork 81
bzlmod: Add MODULE.bazel #490
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
Draft
leonm1
wants to merge
15
commits into
proxy-wasm:main
Choose a base branch
from
leonm1:bzlmod-module
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ff2fc7c
bzlmod: Add MODULE.bazel
phlax 454d7a6
bazel: update to 8.5.1
leonm1 5d26819
bzlmod: use --enable_bzlmod by default
leonm1 10ae611
bzlmod: format
leonm1 b316730
wasmsign: use vendored crates and update rules_rust format
leonm1 20fa66d
emsdk: use bcr for emsdk
leonm1 56f772c
bzlmod: add aspect_rules_lint
leonm1 cdc7a8d
bzlmod: update lockfile
leonm1 2dfc5ba
bzlmod: run rules_rust format on wasmtime
leonm1 dbe853e
bzlmod: fix wamr-jit build
leonm1 3ccbd1e
bzlmod: remove bazel query for rules_rust deps
leonm1 3e95b20
bzlmod: format
leonm1 af2d813
bzlmod: patch v8 to allow for bazel_dep usage
leonm1 9fccaa9
bzlmod: specify dev dependencies
leonm1 fb2ee5b
bzlmod: update wasmedge to 0.16.1
leonm1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 7.7.1 | ||
| 8.5.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,139 @@ | ||||||
| # Copyright 2025 Google LLC | ||||||
| # | ||||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
| # you may not use this file except in compliance with the License. | ||||||
| # You may obtain a copy of the License at | ||||||
| # | ||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||
| # | ||||||
| # Unless required by applicable law or agreed to in writing, software | ||||||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
| # See the License for the specific language governing permissions and | ||||||
| # limitations under the License. | ||||||
|
|
||||||
| module( | ||||||
| name = "proxy_wasm_cpp_host", | ||||||
| version = "0.0.0", | ||||||
| ) | ||||||
|
|
||||||
| bazel_dep(name = "abseil-cpp", version = "20250814.1", repo_name = "com_google_absl") | ||||||
| bazel_dep(name = "bazel_features", version = "1.38.0") | ||||||
| bazel_dep(name = "bazel_skylib", version = "1.8.2") | ||||||
| bazel_dep(name = "boringssl", version = "0.20251124.0") | ||||||
| bazel_dep(name = "emsdk", version = "4.0.17") | ||||||
| bazel_dep(name = "platforms", version = "1.0.0") | ||||||
| bazel_dep(name = "protobuf", version = "33.2", repo_name = "com_google_protobuf") | ||||||
| bazel_dep(name = "proxy-wasm-cpp-sdk", version = "0.0.0", repo_name = "proxy_wasm_cpp_sdk") | ||||||
| bazel_dep(name = "rules_cc", version = "0.2.14") | ||||||
| bazel_dep(name = "rules_foreign_cc", version = "0.15.1") | ||||||
| bazel_dep(name = "rules_license", version = "1.0.0") | ||||||
| bazel_dep(name = "rules_python", version = "1.7.0") | ||||||
| bazel_dep(name = "rules_rust", version = "0.68.1") | ||||||
| bazel_dep(name = "toolchains_llvm", version = "1.6.0") | ||||||
|
|
||||||
| bazel_dep(name = "aspect_rules_lint", version = "1.13.0", dev_dependency = True) | ||||||
| bazel_dep(name = "rules_fuzzing", version = "0.6.0", dev_dependency = True) | ||||||
| bazel_dep(name = "googletest", version = "1.17.0.bcr.2", dev_dependency = True, repo_name = "com_google_googletest") | ||||||
|
|
||||||
| archive_override( | ||||||
| module_name = "rules_rust", | ||||||
| integrity = "sha256-yKqAbPYGZnmsI0YyQe6ArWkiZdrQRl9RERy74wuJA1I=", | ||||||
| patch_strip = 1, | ||||||
| patches = ["@proxy_wasm_cpp_host//bazel/external:rules_rust.patch"], | ||||||
| urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.68.1/rules_rust-0.68.1.tar.gz"], | ||||||
| ) | ||||||
|
|
||||||
| emscripten_deps = use_extension( | ||||||
| "@emsdk//:emscripten_deps.bzl", | ||||||
| "emscripten_deps", | ||||||
| ) | ||||||
| emscripten_deps.config(version = "4.0.17") | ||||||
|
|
||||||
| archive_override( | ||||||
| module_name = "proxy-wasm-cpp-sdk", | ||||||
| integrity = "sha256-tWCh2ieg06s3RSfpx9+k/mSTiHKZlFvidioFGM41Vw4=", | ||||||
| strip_prefix = "proxy-wasm-cpp-sdk-e5256b0c5463ea9961965ad5de3e379e00486640", | ||||||
| urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/e5256b0c5463ea9961965ad5de3e379e00486640.tar.gz"], | ||||||
| ) | ||||||
|
|
||||||
| # Configure and register the toolchain. | ||||||
| llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
See https://github.com/bazel-contrib/toolchains_llvm?tab=readme-ov-file#customizations |
||||||
| llvm.toolchain(llvm_version = "19.1.0") | ||||||
| use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm") | ||||||
|
|
||||||
| register_toolchains("@llvm_toolchain//:all") | ||||||
|
|
||||||
| rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") | ||||||
| rust.toolchain( | ||||||
| edition = "2021", | ||||||
| versions = ["1.91.0"], | ||||||
| ) | ||||||
| use_repo(rust, "rust_toolchains") | ||||||
|
|
||||||
| register_toolchains("@rust_toolchains//:all") | ||||||
|
|
||||||
| wasmsign_crates = use_extension("//bazel:extensions.bzl", "wasmsign_crates") | ||||||
| use_repo( | ||||||
| wasmsign_crates, | ||||||
| "ws", | ||||||
| "ws__wasmsign2-cli-0.2.6", | ||||||
| ) | ||||||
|
|
||||||
| # Wasmtime and its dependencies | ||||||
| wasmtime_crates = use_extension("//bazel:extensions.bzl", "wasmtime_crates") | ||||||
| use_repo( | ||||||
| wasmtime_crates, | ||||||
| "cu", | ||||||
| "cu__anyhow-1.0.86", | ||||||
| "cu__env_logger-0.10.2", | ||||||
| "cu__log-0.4.22", | ||||||
| "cu__once_cell-1.19.0", | ||||||
| "cu__tracing-0.1.40", | ||||||
| "cu__wasmtime-24.0.0", | ||||||
| "cu__wasmtime-c-api-macros-24.0.0", | ||||||
| ) | ||||||
|
|
||||||
| wasmtime = use_extension("//bazel:extensions.bzl", "wasmtime") | ||||||
| use_repo(wasmtime, "com_github_bytecodealliance_wasmtime") | ||||||
|
|
||||||
| # WAMR runtime | ||||||
| wamr = use_extension("//bazel:extensions.bzl", "wamr") | ||||||
| use_repo(wamr, "com_github_bytecodealliance_wasm_micro_runtime") | ||||||
|
|
||||||
| wamr_jit_deps = use_extension("//bazel:extensions.bzl", "wamr_jit_deps") | ||||||
| use_repo(wamr_jit_deps, "llvm-raw", "llvm_zlib", "llvm_zstd") | ||||||
|
|
||||||
| llvm_configure = use_repo_rule("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure") | ||||||
|
|
||||||
| llvm_configure( | ||||||
| name = "llvm-project", | ||||||
| targets = [ | ||||||
| "X86", | ||||||
| "AArch64", | ||||||
| ], | ||||||
| ) | ||||||
|
|
||||||
| # V8 runtime and its dependencies | ||||||
| bazel_dep(name = "v8", version = "0.0.0") | ||||||
| archive_override( | ||||||
| module_name = "v8", | ||||||
| integrity = "sha256-igwEEi6kcb2q7EodzjJasjCx/6LRMiFTVWfDKcNB+Xw=", | ||||||
| patch_cmds = [ | ||||||
| "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/simdutf/simdutf.h\"!#include \"simdutf.h\"!' {} \\;", | ||||||
| "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/fp16/src/include/fp16.h\"!#include \"fp16.h\"!' {} \\;", | ||||||
| "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/dragonbox/src/include/dragonbox/dragonbox.h\"!#include \"dragonbox/dragonbox.h\"!' {} \\;", | ||||||
| "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/fast_float/src/include/fast_float/!#include \"fast_float/!' {} \\;", | ||||||
| ], | ||||||
| patch_strip = 1, | ||||||
| patches = [ | ||||||
| "@proxy_wasm_cpp_host//bazel/external:v8.patch", | ||||||
| "@proxy_wasm_cpp_host//bazel/external:v8_module_bazel.patch", | ||||||
| ], | ||||||
| strip_prefix = "v8-14.4.258.16", | ||||||
| urls = ["https://github.com/v8/v8/archive/refs/tags/14.4.258.16.tar.gz"], | ||||||
| ) | ||||||
|
|
||||||
| # WasmEdge runtime | ||||||
| wasmedge = use_extension("//bazel:extensions.bzl", "wasmedge") | ||||||
| use_repo(wasmedge, "com_github_wasmedge_wasmedge") | ||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The archive override is local and will need to be also done by dependent first one envoy.
proxy-wasm-cpp-sdk shall be published in BCR.
I wish proxy-wasm/proxy-wasm-cpp-sdk#190 was merged first then a first version can be manually published in the BCR and ready to be used here