Skip to content

Phase 0: project foundations - #3

Merged
aaylward merged 2 commits into
mainfrom
claude/smithy-cpp-generator-plan-fpeqzt
Jul 6, 2026
Merged

aaylward merged 2 commits into
mainfrom
claude/smithy-cpp-generator-plan-fpeqzt

Conversation

@aaylward

@aaylward aaylward commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What

Implements Phase 0 of docs/PLAN.md: the foundations every later phase builds on.

  • Bazel 9 workspace (bzlmod-only): MODULE.bazel (+ committed lockfile) with rules_cc and googletest; .bazelrc sets the C++20 baseline per platform, asan/ubsan configs, and the Bazel 9 --incompatible_autoload_externally shim for third-party BUILD files that predate the native C++ rule removal (our own BUILD files load() from @rules_cc explicitly). .bazelversion tracks 9.x.
  • Hello-world runtime target: //runtime:core (smithy::Version()) with a GoogleTest test, establishing the runtime/include/smithy/<module> header layout from PLAN §3.1.
  • Codegen Gradle skeleton (codegen/): smithy-cpp-codegen module against smithy-codegen-core/smithy-build 1.53.0, reserving the cpp-codegen plugin name with ServiceLoader registration, unit tests (JUnit 5), and Spotless/google-java-format.
  • CI (GitHub Actions): Bazel build+test matrix (Linux gcc + clang, macOS, Windows MSVC), an ASan+UBSan job, a Gradle job (build spotlessCheck), and a lint job (clang-format, clang-tidy, buildifier).
  • ADRs 0001–0004: JVM DirectedCodegen generator; restJson1 + rpcv2Cbor from the start; Outcome-based error handling with the C++20 compiler floor; Bazel 9 as the only supported build system.
  • Fixture model corpus: examples/weather (restJson1: resources, HTTP bindings, pagination, modeled 404) and examples/cafe (rpcv2Cbor: enums, unions, idempotency token, client/server errors) — the models that drive tests in Phases 2–5.
  • Repo hygiene: Apache-2.0 license, CONTRIBUTING.md, docs/development.md, .clang-format/.clang-tidy/.editorconfig/.gitignore, issue + PR templates, README status table.

Testing

Validated locally with the same commands CI runs:

  • bazel test //... --config=ci — passes (Bazel 9.1.1, Linux)
  • bazel test //... --config=ci --config=asan --config=ubsan — passes
  • (cd codegen && gradle build spotlessCheck) — passes (JDK 21 targeting release 17, Gradle 8.14.3)
  • clang-format --dry-run --Werror, clang-tidy, and buildifier --mode=check -r . — clean

The macOS/Windows legs of the matrix run for the first time in this PR's CI.

Checklist

  • Tests added/updated for the change
  • bazel test //... and (cd codegen && gradle build spotlessCheck) pass locally
  • Formatting clean (clang-format, buildifier, spotless)
  • Architectural decisions recorded as an ADR (ADRs 0001–0004)

🤖 Generated with Claude Code

https://claude.ai/code/session_01WjaNFwBZxoHdqagvq8ycQf


Generated by Claude Code

claude added 2 commits July 6, 2026 03:40
- Bazel 9 workspace (bzlmod): MODULE.bazel + lockfile, .bazelrc with C++20
  baseline and asan/ubsan configs, hello-world runtime target
  (//runtime:core) with a GoogleTest test.
- Codegen Gradle skeleton: smithy-cpp-codegen module reserving the
  cpp-codegen smithy-build plugin name, with ServiceLoader registration,
  unit tests, and Spotless (google-java-format).
- CI: Bazel matrix (Linux gcc/clang, macOS, Windows MSVC), sanitizer job,
  Gradle job, lint job (clang-format, clang-tidy, buildifier).
- ADRs 0001-0004: JVM DirectedCodegen generator, restJson1 + rpcv2Cbor
  from the start, Outcome-based error handling, Bazel 9 only.
- Fixture models: examples/weather (restJson1 REST) and examples/cafe
  (rpcv2Cbor RPC with enums/unions/errors).
- Repo hygiene: Apache-2.0 LICENSE, CONTRIBUTING, development guide,
  clang-format/clang-tidy/editorconfig, issue and PR templates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WjaNFwBZxoHdqagvq8ycQf
The sanitizer job links through Bazel's C driver, which leaves out the
UBSan C++ runtime pieces (__ubsan_vptr_type_cache) that vptr checks need;
-fsanitize-link-c++-runtime pulls them in. The lint job's global npm
install needed root on hosted runners, so use npx instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WjaNFwBZxoHdqagvq8ycQf
@aaylward
aaylward merged commit d1cdd92 into main Jul 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants