Skip to content
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
3 changes: 3 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The out-of-tree consumer example is its own Bazel module (CI builds it
# standalone); keep it out of this workspace's target graph.
examples/bazel-consumer
12 changes: 7 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Platform-specific configs (build:linux / build:macos / build:windows) apply automatically.
common --enable_platform_specific_config

# Bazel 9 removed the native C++ rules; autoload them from rules_cc for third-party
# BUILD files (e.g. googletest) that don't load() them yet. Our own BUILD files
# always load from @rules_cc explicitly.
common --incompatible_autoload_externally=+cc_library,+cc_binary,+cc_test,+cc_import

# C++20 everywhere (ADR-0003 baseline; see docs/PLAN.md §2).
build:linux --cxxopt=-std=c++20 --host_cxxopt=-std=c++20
build:macos --cxxopt=-std=c++20 --host_cxxopt=-std=c++20
Expand Down Expand Up @@ -36,3 +31,10 @@ build:ci --announce_rc --verbose_failures

# Personal overrides stay out of version control.
try-import %workspace%/.bazelrc.user

# The code generator is Java 17 (matching the Gradle toolchain); rules_java
# compiles and runs it on a hermetic remote JDK.
common --java_language_version=17
common --tool_java_language_version=17
common --java_runtime_version=remotejdk_17
common --tool_java_runtime_version=remotejdk_17
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ jobs:
CXX: clang++
run: bazelisk test //... --config=ci --config=asan --config=ubsan

consumer:
name: bazel consumer (quick start)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# The quick-start acceptance test (docs/quickstart.md): a standalone
# out-of-tree Bazel module consumes smithy_cpp via the rules in
# bazel/defs.bzl — generation runs inside the consumer's build graph.
- name: bazel test (out-of-tree module)
working-directory: examples/bazel-consumer
run: bazelisk test //... --verbose_failures

codegen:
name: codegen (gradle)
runs-on: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Bazel
bazel-*
/bazel-*
/.bazelrc.user

# Gradle / JVM
Expand Down
2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Root package: hosts the rules_jvm_external lock file (//:maven_install.json).
exports_files(["maven_install.json"])
35 changes: 33 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,38 @@ module(

bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "googletest", version = "1.17.0.bcr.1")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "boost.asio", version = "1.87.0.bcr.1")
bazel_dep(name = "boost.beast", version = "1.87.0")
bazel_dep(name = "nlohmann_json", version = "3.12.0")
bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.1")

# boost.container 1.87's registry overlay calls native.cc_test without a
# load(), the one stale file in the boost 1.87 graph (audited); patch it
# rather than moving to boost 1.90, which drags in boringssl toolchains.
single_version_override(
module_name = "boost.container",
patch_strip = 1,
patches = ["//third_party:boost_container_cc_test_load.patch"],
)

bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)

# The code generator runs inside the build graph as a hermetic Java action
# (bazel/defs.bzl); rules_jvm_external pins its Smithy dependencies.
bazel_dep(name = "rules_java", version = "8.16.1")
bazel_dep(name = "rules_jvm_external", version = "6.7")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "smithy_cpp_codegen_maven",
artifacts = [
"software.amazon.smithy:smithy-aws-traits:1.53.0",
"software.amazon.smithy:smithy-build:1.53.0",
"software.amazon.smithy:smithy-codegen-core:1.53.0",
"software.amazon.smithy:smithy-protocol-test-traits:1.53.0",
"software.amazon.smithy:smithy-protocol-traits:1.53.0",
],
lock_file = "//:maven_install.json",
repositories = ["https://repo1.maven.org/maven2"],
)
use_repo(maven, "smithy_cpp_codegen_maven")
23 changes: 19 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ See [`docs/PLAN.md`](docs/PLAN.md) for the full phased plan and
| 3 | Client generation (restJson1 + rpcv2Cbor) | ✅ Done — serde + clients for both protocols with typed errors ([docs/generated-types.md](docs/generated-types.md)); ~240 official protocol conformance cases green (documented exclusions) |
| 4 | Server generation (restJson1 + rpcv2Cbor) | ✅ Done — handlers, routing, serde, all HTTP bindings incl. `@httpPayload`/`@httpPrefixHeaders`, constraint validation, parser strictness, content negotiation; ~1,175 official conformance cases green ([docs/server-guide.md](docs/server-guide.md)) |
| 5 | Generated-client ↔ generated-server integration harness | ✅ Done — every fixture ships a generated integration suite: seeded random round-trips over loopback and real sockets, per-error mapping, unknown-member tolerance, mutation-checked ([docs/design/integration-testing.md](docs/design/integration-testing.md)) |
| 6 | Bazel rules, CLI, packaging (BCR + Maven Central), docs site | Not started |
| 6 | Bazel rules, CLI, packaging (BCR + Maven Central), docs site | 🔨 In progress — `smithy_cpp_{types,client,server}_library` rules run the generator hermetically inside the build graph, out-of-tree consumer module tested in CI, CLI via `bazel run //codegen:generator` ([docs/quickstart.md](docs/quickstart.md)); BCR/Maven publishing deferred until production validation; docs site pending |
| 7 | Hardening, fuzzing, v0.1.0 | Not started |
| 8 | Bidirectional streaming (event streams, WebSockets) | Not started |

Expand Down
2 changes: 2 additions & 0 deletions bazel/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Consumer-facing Bazel rules (defs.bzl); see docs/quickstart.md.
exports_files(["defs.bzl"])
Loading
Loading