Skip to content
Open
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
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
# enables improved Bazel C++ toolchain resolution method that became the
# default in newer Bazel version and does not cause problems, we keep it.
build --incompatible_enable_cc_toolchain_resolution
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me, thanks for the PR!

Pardon my ignorance, one question: please confirm this setting isn't contagious and that the change is compatible with non-bzlmod projects. What I mean is: projects like Envoy can still depend on cpp-sdk without immediately enabling bzlmod?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .bazelrc only impact the current project not those depending on it.
Having MODULE.bazel and WORKSPACE allow to support both modes during the migration.

I'm actually trying to migrate envoy to bzlmod but the more dependencies are still using WORKSPACE, the harder it is , see envoyproxy/envoy#40692

2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.6.1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/bazel-*
MODULE.bazel.lock
3 changes: 2 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library")
load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

licenses(["notice"]) # Apache 2
Expand Down
36 changes: 36 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module(
name = "proxy-wasm-cpp-sdk",
version = "0.0.0",
repo_name = "proxy_wasm_cpp_sdk",
)

bazel_dep(
name = "emsdk",
version = "4.0.13",
)
bazel_dep(
name = "platforms",
version = "1.0.0",
)
bazel_dep(
name = "protobuf",
version = "29.3",
repo_name = "com_google_protobuf",
)
bazel_dep(
name = "re2",
version = "2024-07-02.bcr.1",
repo_name = "com_google_re2",
)
bazel_dep(
name = "rules_cc",
version = "0.2.0",
)
bazel_dep(
name = "rules_proto",
version = "7.1.0",
)
bazel_dep(
name = "rules_python",
version = "1.4.1",
)
1 change: 1 addition & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workspace(name = "proxy_wasm_cpp_sdk")