From d4ac6672cbe52c9b89de126b357cf648036b1fe5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 12:11:52 +0000 Subject: [PATCH 1/2] Rename the Bazel module from smithy_cpp to opal_cpp (#201, ADR-0024) Surface 3 of 3; closes the issue. The module is opal_cpp, runtime labels are @opal_cpp//runtime:..., the codegen plugin's default runtimeTarget follows, and the copts constant is OPAL_COPTS. The out-of-tree consumer module carries the migration: bazel_dep and local_path_override renamed, labels substituted, nothing else. The smithy_cpp_*_library rules keep their names: they take a Smithy model as input. Closes #201 --- .github/workflows/ci.yml | 4 +- CHANGELOG.md | 21 ++- MODULE.bazel | 2 +- bazel/copts.bzl | 4 +- bazel/defs.bzl | 4 +- bazel/tests/BUILD.bazel | 4 +- benchmarks/BUILD.bazel | 8 +- codegen/compile-tests/BUILD.bazel | 6 +- .../smithycpp/codegen/CppCodegenRunner.java | 2 +- .../io/smithycpp/codegen/CppSettings.java | 6 +- .../codegen/BuildFileGeneratorTest.java | 2 +- .../io/smithycpp/codegen/CppSettingsTest.java | 2 +- docs/PLAN.md | 6 +- docs/adr/0004-bazel-only.md | 2 +- docs/design/codegen-architecture.md | 2 +- docs/model-evolution.md | 4 +- docs/quickstart.md | 16 +- .../plans/2026-07-08-server-middleware.md | 8 +- examples/bazel-consumer/.bazelrc | 4 +- examples/bazel-consumer/BUILD.bazel | 170 +++++++++--------- examples/bazel-consumer/MODULE.bazel | 10 +- .../boringssl-resolution-check.sh | 18 +- .../eventstream_consumer_test.cc | 2 +- examples/cafe/BUILD.bazel | 6 +- examples/chat/BUILD.bazel | 16 +- examples/jsonrpc2/BUILD.bazel | 8 +- examples/roundtrip/rest/BUILD.bazel | 8 +- examples/roundtrip/rpc/BUILD.bazel | 4 +- examples/simplerestjson/BUILD.bazel | 4 +- examples/weather/BUILD.bazel | 14 +- fuzz/BUILD.bazel | 6 +- protocol-tests/jsonrpc2/BUILD.bazel | 4 +- .../rpcv2cbor/malformed/BUILD.bazel | 4 +- .../simplerestjson/malformed/BUILD.bazel | 6 +- protocol-tests/unions/BUILD.bazel | 12 +- renovate.json | 4 +- runtime/BUILD.bazel | 2 +- 37 files changed, 209 insertions(+), 196 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac57b8b8..38bac9e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,7 +170,7 @@ jobs: repository-cache: true disk-cache: consumer # The quick-start acceptance test (docs/quickstart.md): a standalone - # out-of-tree Bazel module consumes smithy_cpp via the rules in + # out-of-tree Bazel module consumes opal_cpp via the rules in # bazel/defs.bzl — generation runs inside the consumer's build graph, # on every OS the runtime itself supports. --config=werror gates the # consumer's own code (hand-written and generated alike) at @@ -187,7 +187,7 @@ jobs: working-directory: examples/bazel-consumer run: ./model-evolution-check.sh # The consumer's resolved boringssl must be exactly the version - # smithy_cpp pins — MVS would silently select anything higher that a + # opal_cpp pins — MVS would silently select anything higher that a # transitive dep requests, and every leg above stays green while # consumers link a TLS library no job tested. Resolution is # platform-independent, so one OS suffices. diff --git a/CHANGELOG.md b/CHANGELOG.md index a98ff0ae..a78198e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,20 @@ policy in [docs/versioning.md](docs/versioning.md). ### Breaking +- **The Bazel module is `opal_cpp`, not `smithy_cpp`** (#201, ADR-0024; the + third and last surface, which closes the issue). `bazel_dep(name = + "smithy_cpp")` is now `bazel_dep(name = "opal_cpp")`, the runtime labels + are `@opal_cpp//runtime:…`, the codegen plugin's default `runtimeTarget` + is `@opal_cpp//runtime:core`, and the copts constant hand-written BUILD + files load from `//bazel:copts.bzl` is `OPAL_COPTS`. Migration: `smithy_cpp` + → `opal_cpp` in `MODULE.bazel` (the `bazel_dep` and any + `local_path_override`/`git_override` naming it) and in every `@smithy_cpp//` + label; `SMITHY_COPTS` → `OPAL_COPTS` if you load it. The rules keep their + names — `smithy_cpp_types_library`, `smithy_cpp_client_library`, + `smithy_cpp_server_library` take a Smithy model as input and are named for + it — so `load("@opal_cpp//bazel:defs.bzl", "smithy_cpp_server_library")` + is the spelling after this change. The repository URL is unchanged by this + entry. - **The runtime's include root is `opal/`, not `smithy/`** (#201, ADR-0024; the second of three surfaces). `#include "smithy/http/transport.h"` is now `#include "opal/http/transport.h"`, for every runtime header and for the @@ -21,8 +35,7 @@ policy in [docs/versioning.md](docs/versioning.md). stays, so if you have one, constrain the substitution to the runtime's directories: `smithy/{core,http,json,cbor,client,server,eventstream,compression,testing}/`. Anything that greps a log for `smithy: ` now looks for `opal: `. The Bazel - module (`@smithy_cpp`) and `SMITHY_COPTS` are unchanged here and move in - the PR that follows. + module (`@smithy_cpp`) and `SMITHY_COPTS` moved in the entry above. - **The runtime namespace is `opal`, not `smithy`** (#201, ADR-0024; the first of three surfaces). Smithy is the IDL a service is described in, not a property of its JSON codec or its HTTP transport, so `smithy::Outcome`, @@ -43,8 +56,8 @@ policy in [docs/versioning.md](docs/versioning.md). `smithy::protocoltests::`, and the top-level runtime types such as `smithy::Outcome`. Smithy namespaces in `.smithy` files and the `smithy_cpp_*_library` rules name the model and are unchanged. The - include root moved in the entry above; the Bazel module (`@smithy_cpp`) - moves in the PR that follows. + include root and the Bazel module (`@smithy_cpp`) moved in the two + entries above. ### Added diff --git a/MODULE.bazel b/MODULE.bazel index 21c90881..b652f3e5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,7 +4,7 @@ # version consumers actually observe is opal::Version() / the client # User-Agent ("0.2.0"). See docs/versioning.md. module( - name = "smithy_cpp", + name = "opal_cpp", version = "0.0.0", ) diff --git a/bazel/copts.bzl b/bazel/copts.bzl index 1103841b..1ec29b26 100644 --- a/bazel/copts.bzl +++ b/bazel/copts.bzl @@ -1,6 +1,6 @@ """Warning flags for every first-party C++ target (issue #65). -Hand-written BUILD files load SMITHY_COPTS; the generated modules' BUILD +Hand-written BUILD files load OPAL_COPTS; the generated modules' BUILD files (BuildFileGenerator / TestsBuildFileGenerator) and the consumer macros in defs.bzl carry the same flags as literals, so generated code compiles at the same warning level in-tree and in consumers. @@ -10,7 +10,7 @@ only via --config=werror (see .bazelrc), so a new compiler version's new warnings never break consumers building from source. """ -SMITHY_COPTS = [ +OPAL_COPTS = [ "-Wall", "-Wextra", ] diff --git a/bazel/defs.bzl b/bazel/defs.bzl index a0206d06..ca252542 100644 --- a/bazel/defs.bzl +++ b/bazel/defs.bzl @@ -1,8 +1,8 @@ """Consumer-facing rules: generate Smithy C++ clients/servers inside the build graph. -Usage (from any Bazel 8/9 module that depends on smithy_cpp): +Usage (from any Bazel 8/9 module that depends on opal_cpp): - load("@smithy_cpp//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library") + load("@opal_cpp//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library") smithy_cpp_client_library( name = "weather_client", diff --git a/bazel/tests/BUILD.bazel b/bazel/tests/BUILD.bazel index 50692b35..82684d36 100644 --- a/bazel/tests/BUILD.bazel +++ b/bazel/tests/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:cc_test.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") load("//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library", "smithy_cpp_types_library") load(":defs_test.bzl", "defs_test_suite") @@ -73,7 +73,7 @@ cc_test( name = "greeter_roundtrip_test", size = "small", srcs = ["greeter_roundtrip_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":greeter_client", ":greeter_server", diff --git a/benchmarks/BUILD.bazel b/benchmarks/BUILD.bazel index 49826a2d..29d53547 100644 --- a/benchmarks/BUILD.bazel +++ b/benchmarks/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_binary") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # Performance benchmarks (PLAN Phase 7): run with -c opt; CI runs them as an # informational job (no pass/fail threshold yet — publish numbers first). @@ -8,7 +8,7 @@ cc_binary( name = "serde_benchmark", testonly = True, srcs = ["serde_benchmark.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/rest/generated:serde", "//examples/roundtrip/rest/generated:types", @@ -23,7 +23,7 @@ cc_binary( name = "beast_benchmark", testonly = True, srcs = ["beast_benchmark.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/rest/generated:client", "//examples/roundtrip/rest/generated:server", @@ -39,7 +39,7 @@ cc_binary( name = "request_benchmark", testonly = True, srcs = ["request_benchmark.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/jsonrpc/generated:client", "//examples/roundtrip/jsonrpc/generated:server", diff --git a/codegen/compile-tests/BUILD.bazel b/codegen/compile-tests/BUILD.bazel index b28a6bfa..e68d3363 100644 --- a/codegen/compile-tests/BUILD.bazel +++ b/codegen/compile-tests/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") load("//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library") # The compile-the-output harness (issue #48): run the real generator on the @@ -113,7 +113,7 @@ cc_test( name = "gauntlet_compile_test", size = "small", srcs = ["gauntlet_compile_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":gauntlet_cbor_client", ":gauntlet_cbor_server", @@ -142,7 +142,7 @@ cc_test( name = "streaming_compile_test", size = "small", srcs = ["streaming_compile_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":streaming_cbor_client", ":streaming_cbor_server", diff --git a/codegen/smithy-cpp-codegen/src/main/java/io/smithycpp/codegen/CppCodegenRunner.java b/codegen/smithy-cpp-codegen/src/main/java/io/smithycpp/codegen/CppCodegenRunner.java index ca5ca853..e74b7316 100644 --- a/codegen/smithy-cpp-codegen/src/main/java/io/smithycpp/codegen/CppCodegenRunner.java +++ b/codegen/smithy-cpp-codegen/src/main/java/io/smithycpp/codegen/CppCodegenRunner.java @@ -73,7 +73,7 @@ static void run(String[] args) { List modelPaths = new ArrayList<>(); String service = null; String namespace = null; - String runtimeTarget = "@smithy_cpp//runtime:core"; + String runtimeTarget = "@opal_cpp//runtime:core"; String output = null; String testsPackage = null; boolean malformedTests = false; diff --git a/codegen/smithy-cpp-codegen/src/main/java/io/smithycpp/codegen/CppSettings.java b/codegen/smithy-cpp-codegen/src/main/java/io/smithycpp/codegen/CppSettings.java index 684eee40..bbd85355 100644 --- a/codegen/smithy-cpp-codegen/src/main/java/io/smithycpp/codegen/CppSettings.java +++ b/codegen/smithy-cpp-codegen/src/main/java/io/smithycpp/codegen/CppSettings.java @@ -11,7 +11,7 @@ * "cpp-codegen": { * "service": "example.weather#Weather", * "namespace": "example::weather", - * "runtimeTarget": "@smithy_cpp//runtime:core" + * "runtimeTarget": "@opal_cpp//runtime:core" * } * } */ @@ -49,7 +49,7 @@ public static CppSettings fromNode(ObjectNode node) { ShapeId service = ShapeId.from(node.expectStringMember("service").getValue()); String namespace = node.expectStringMember("namespace").getValue(); String runtimeTarget = - node.getStringMemberOrDefault("runtimeTarget", "@smithy_cpp//runtime:core"); + node.getStringMemberOrDefault("runtimeTarget", "@opal_cpp//runtime:core"); String testsPackage = node.getStringMemberOrDefault("testsPackage", null); boolean malformedTests = node.getBooleanMemberOrDefault("malformedTests", false); boolean integrationTests = node.getBooleanMemberOrDefault("integrationTests", false); @@ -110,7 +110,7 @@ public String serverHeaderFile() { return "include/" + includePrefix() + "/server.h"; } - /** Bazel package of the runtime, e.g. {@code //runtime} or {@code @smithy_cpp//runtime}. */ + /** Bazel package of the runtime, e.g. {@code //runtime} or {@code @opal_cpp//runtime}. */ public String runtimePackage() { int colon = runtimeTarget.lastIndexOf(':'); return colon < 0 ? runtimeTarget : runtimeTarget.substring(0, colon); diff --git a/codegen/smithy-cpp-codegen/src/test/java/io/smithycpp/codegen/BuildFileGeneratorTest.java b/codegen/smithy-cpp-codegen/src/test/java/io/smithycpp/codegen/BuildFileGeneratorTest.java index a7d37bb3..712b26cd 100644 --- a/codegen/smithy-cpp-codegen/src/test/java/io/smithycpp/codegen/BuildFileGeneratorTest.java +++ b/codegen/smithy-cpp-codegen/src/test/java/io/smithycpp/codegen/BuildFileGeneratorTest.java @@ -70,7 +70,7 @@ void runtimeDepsPointAtTheConfiguredTarget() { String external = PluginTestHarness.generate(MODEL, "test.build#Svc", "test::build") .expectFileString("/BUILD.bazel"); - assertTrue(external.contains("\"@smithy_cpp//runtime:core\""), external); + assertTrue(external.contains("\"@opal_cpp//runtime:core\""), external); } @Test diff --git a/codegen/smithy-cpp-codegen/src/test/java/io/smithycpp/codegen/CppSettingsTest.java b/codegen/smithy-cpp-codegen/src/test/java/io/smithycpp/codegen/CppSettingsTest.java index db57b14e..e4345795 100644 --- a/codegen/smithy-cpp-codegen/src/test/java/io/smithycpp/codegen/CppSettingsTest.java +++ b/codegen/smithy-cpp-codegen/src/test/java/io/smithycpp/codegen/CppSettingsTest.java @@ -23,7 +23,7 @@ void defaultsApplyWhenOnlyServiceAndNamespaceAreGiven() { CppSettings settings = CppSettings.fromNode(minimal()); assertEquals("example.weather#Weather", settings.service().toString()); assertEquals("example::weather", settings.namespace()); - assertEquals("@smithy_cpp//runtime:core", settings.runtimeTarget()); + assertEquals("@opal_cpp//runtime:core", settings.runtimeTarget()); } @Test diff --git a/docs/PLAN.md b/docs/PLAN.md index 38220463..3e90c150 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -474,13 +474,13 @@ without reading generator internals or touching Gradle. - The generator runs as a Bazel **toolchain/action** with a hermetic JVM via `rules_java` — generation happens inside the build graph (correct caching, remote-execution compatible), never as a "run this script first" step. - - bzlmod module `smithy_cpp` published to the **Bazel Central Registry**; runtime targets - (`@smithy_cpp//runtime:core`, `:client`, `:server`, …) consumable directly. + - bzlmod module `opal_cpp` published to the **Bazel Central Registry**; runtime targets + (`@opal_cpp//runtime:core`, `:client`, `:server`, …) consumable directly. **Deferred**: BCR (and Maven Central) publishing waits until the project is validated in production; until then consumers use `git_override`/`local_path_override` (see docs/quickstart.md). - Out-of-tree consumer example (`examples/bazel-consumer/`) exercised in CI: a standalone - Bazel 9 module that depends on the released `smithy_cpp` module, defines a model, builds + Bazel 9 module that depends on the released `opal_cpp` module, defines a model, builds client + server, and runs the Phase-5-style integration test — this is the quick-start acceptance test. - **CLI wrapper**: `smithy-cpp generate --model … --mode client|server|both --out …` (thin wrapper diff --git a/docs/adr/0004-bazel-only.md b/docs/adr/0004-bazel-only.md index dd7218bc..41325c8a 100644 --- a/docs/adr/0004-bazel-only.md +++ b/docs/adr/0004-bazel-only.md @@ -12,7 +12,7 @@ parity is a permanent maintenance tax, and the target audience builds with Bazel - **Bazel 9 (bzlmod-only)** is the sole supported build system, for this repository and for consumers. `.bazelversion` tracks `9.x`. -- Consumers use the `smithy_cpp` bzlmod module (published to the Bazel Central Registry from +- Consumers use the `opal_cpp` bzlmod module (published to the Bazel Central Registry from Phase 6) and the `smithy_cpp_*_library` rules, which run the generator hermetically inside the build graph. - No CMake files are provided or accepted. The `smithy-cpp` CLI (Phase 6) can emit plain C++ diff --git a/docs/design/codegen-architecture.md b/docs/design/codegen-architecture.md index dc81cbd8..f2fae7cd 100644 --- a/docs/design/codegen-architecture.md +++ b/docs/design/codegen-architecture.md @@ -9,7 +9,7 @@ smithy-rs's `codegen-core` structure (PLAN §3.2a). | Class | Role | |---|---| | `CppCodegenPlugin` | `SmithyBuildPlugin` entry point; validates settings, rejects (for now) recursive shapes with a clear error, drives `CodegenDirector` | -| `CppSettings` | Plugin settings: `service`, C++ `namespace`, `runtimeTarget` (Bazel label of `//runtime:core` / `@smithy_cpp//runtime:core`) | +| `CppSettings` | Plugin settings: `service`, C++ `namespace`, `runtimeTarget` (Bazel label of `//runtime:core` / `@opal_cpp//runtime:core`) | | `CppSymbolProvider` | Shape → C++ type mapping (docs/generated-types.md). A `Symbol`'s name is the full C++ type text; required `#include`s ride along in a symbol property | | `CppWriter` | `SymbolWriter` per generated file: collects includes while the body is written, renders header comment + `#pragma once` + sorted includes + namespace wrapper. Byte deterministic | | `DirectedCppCodegen` | Implements `DirectedCodegen`; handles structure/error/union/enum/intEnum directives, then (service directive) resolves the protocol and drives serde → client → BUILD generation | diff --git a/docs/model-evolution.md b/docs/model-evolution.md index aab60c89..8293cbaf 100644 --- a/docs/model-evolution.md +++ b/docs/model-evolution.md @@ -53,7 +53,7 @@ are checked in as goldens — so the workflow below is exercised on every commit Out of tree, the same generator runs as a CLI: ```sh - bazel run @smithy_cpp//codegen:generator -- \ + bazel run @opal_cpp//codegen:generator -- \ --model $PWD/model/todo.smithy --service acme.todo#Todo \ --namespace acme::todo --mode both --output $PWD/generated ``` @@ -93,7 +93,7 @@ A consumer vendoring CLI output wants the same job, substituting the CLI invocat - name: check generated code is current run: | rm -rf generated - bazel run @smithy_cpp//codegen:generator -- \ + bazel run @opal_cpp//codegen:generator -- \ --model $PWD/model/todo.smithy --service acme.todo#Todo \ --namespace acme::todo --mode both --output $PWD/generated git diff --exit-code -- generated diff --git a/docs/quickstart.md b/docs/quickstart.md index ac47710c..badb8294 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -47,13 +47,13 @@ or a real socket) → `TodoServer` → your `MyHandler` → back out as a typed ```starlark module(name = "my_service", version = "0.0.0") -bazel_dep(name = "smithy_cpp", version = "0.0.0") +bazel_dep(name = "opal_cpp", version = "0.0.0") -# Until smithy_cpp is published to the Bazel Central Registry (deferred until +# Until opal_cpp is published to the Bazel Central Registry (deferred until # the project is production-validated), consume it by git override, pinning a # release tag. The `version` above is ignored while an override is in effect. git_override( - module_name = "smithy_cpp", + module_name = "opal_cpp", remote = "https://github.com/muchq/smithy-cpp.git", tag = "v0.2.0", ) @@ -90,10 +90,10 @@ common --experimental_repository_downloader_retries=5 # Warnings are errors for this module's own code (smithy-cpp issue #65): the # ^// label filter covers the hand-written mains/tests and the generated # acme/* libraries (already compiled at -Wall -Wextra by the smithy_cpp_* -# macros), while @smithy_cpp and every other external module keep their own +# macros), while @opal_cpp and every other external module keep their own # warning posture. CI runs with --config=werror; optional for your builds. # external_include_paths compiles external headers as system headers, so a -# diagnostic inside a googletest or @smithy_cpp header cannot fail the +# diagnostic inside a googletest or @opal_cpp header cannot fail the # including first-party TU on a newer compiler. build:werror --per_file_copt=^//@-Werror build:werror --features=external_include_paths @@ -231,7 +231,7 @@ example binds all three side by side.) `BUILD.bazel` — pass the base model plus the overlay that picks the protocol: ```starlark -load("@smithy_cpp//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library") +load("@opal_cpp//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library") smithy_cpp_client_library( name = "todo_client", @@ -335,7 +335,7 @@ bazel test //... ``` For production serving, plug `server.Handler()` into `opal::http::BeastServerTransport` -(`@smithy_cpp//runtime:http_beast`, ADR-0006) — the +(`@opal_cpp//runtime:http_beast`, ADR-0006) — the [Serving lifecycle](production-guide.md#serving-lifecycle) walkthrough and its compiled example ([`examples/simplerestjson/serve_main.cc`](../examples/simplerestjson/serve_main.cc)) wire SIGTERM → drain → clean exit. @@ -435,7 +435,7 @@ don't parse as C++ at all. If you hit one of these: The generator is also a plain CLI for inspecting output or vendoring generated sources: ```sh -bazel run @smithy_cpp//codegen:generator -- \ +bazel run @opal_cpp//codegen:generator -- \ --model $PWD/model/todo.smithy --service acme.todo#Todo \ --namespace acme::todo --mode both --output /tmp/generated ``` diff --git a/docs/superpowers/plans/2026-07-08-server-middleware.md b/docs/superpowers/plans/2026-07-08-server-middleware.md index d65d285d..46173a47 100644 --- a/docs/superpowers/plans/2026-07-08-server-middleware.md +++ b/docs/superpowers/plans/2026-07-08-server-middleware.md @@ -580,7 +580,7 @@ TEST(TodoMiddlewareTest, GuardObserveAndHealthComposeAroundTheServer) { } ``` -In `examples/bazel-consumer/BUILD.bazel`, add `"@smithy_cpp//runtime:server",` to the `todo_integration_test` deps (keep the list sorted): +In `examples/bazel-consumer/BUILD.bazel`, add `"@opal_cpp//runtime:server",` to the `todo_integration_test` deps (keep the list sorted): ```starlark deps = [ @@ -591,9 +591,9 @@ In `examples/bazel-consumer/BUILD.bazel`, add `"@smithy_cpp//runtime:server",` t ":todo_jsonrpc_server", ":todo_server", "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:server", ], ``` diff --git a/examples/bazel-consumer/.bazelrc b/examples/bazel-consumer/.bazelrc index e65308c2..2eee642a 100644 --- a/examples/bazel-consumer/.bazelrc +++ b/examples/bazel-consumer/.bazelrc @@ -20,10 +20,10 @@ common --experimental_repository_downloader_retries=5 # Warnings are errors for this module's own code (smithy-cpp issue #65): the # ^// label filter covers the hand-written mains/tests and the generated # acme/* libraries (already compiled at -Wall -Wextra by the smithy_cpp_* -# macros), while @smithy_cpp and every other external module keep their own +# macros), while @opal_cpp and every other external module keep their own # warning posture. CI runs with --config=werror; optional for your builds. # external_include_paths compiles external headers as system headers, so a -# diagnostic inside a googletest or @smithy_cpp header cannot fail the +# diagnostic inside a googletest or @opal_cpp header cannot fail the # including first-party TU on a newer compiler. build:werror --per_file_copt=^//@-Werror build:werror --features=external_include_paths diff --git a/examples/bazel-consumer/BUILD.bazel b/examples/bazel-consumer/BUILD.bazel index 80900473..9d2c95a7 100644 --- a/examples/bazel-consumer/BUILD.bazel +++ b/examples/bazel-consumer/BUILD.bazel @@ -1,7 +1,7 @@ +load("@opal_cpp//bazel:copts.bzl", "OPAL_COPTS") +load("@opal_cpp//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test") load("@rules_shell//shell:sh_test.bzl", "sh_test") -load("@smithy_cpp//bazel:copts.bzl", "SMITHY_COPTS") -load("@smithy_cpp//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library") # The base model is protocol-agnostic (the upstream Smithy way); each pair of # targets binds it to a concrete protocol with an `apply` overlay. The same @@ -95,14 +95,14 @@ cc_test( name = "redirect_e2e_test", size = "small", srcs = ["redirect_e2e_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":redirector_client", ":redirector_server", "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:server", ], ) @@ -114,14 +114,14 @@ cc_test( name = "head_e2e_test", size = "small", srcs = ["head_e2e_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":redirector_client", ":redirector_server", "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:server", ], ) @@ -134,15 +134,15 @@ cc_test( name = "metrics_acceptance_test", size = "small", srcs = ["metrics_acceptance_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":todo_client", ":todo_server", "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:http_beast", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:http_beast", + "@opal_cpp//runtime:server", ], ) @@ -150,15 +150,15 @@ cc_test( name = "access_log_acceptance_test", size = "small", srcs = ["access_log_acceptance_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":todo_client", ":todo_server", "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:http_beast", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:http_beast", + "@opal_cpp//runtime:server", ], ) @@ -166,17 +166,17 @@ cc_test( name = "todo_beast_acceptance_test", size = "small", srcs = ["todo_beast_acceptance_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":todo_client", ":todo_server", "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:connection_event_recorder", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:http_beast", - "@smithy_cpp//runtime:server", - "@smithy_cpp//runtime:test_tls_identity", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:connection_event_recorder", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:http_beast", + "@opal_cpp//runtime:server", + "@opal_cpp//runtime:test_tls_identity", ], ) @@ -186,7 +186,7 @@ cc_test( name = "todo_integration_test", size = "small", srcs = ["todo_integration_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":todo_cbor_client", ":todo_cbor_server", @@ -195,9 +195,9 @@ cc_test( ":todo_jsonrpc_server", ":todo_server", "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:server", ], ) @@ -209,11 +209,11 @@ cc_test( name = "eventstream_consumer_test", size = "small", srcs = ["eventstream_consumer_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "@googletest//:gtest_main", - "@smithy_cpp//runtime:core", - "@smithy_cpp//runtime:eventstream", + "@opal_cpp//runtime:core", + "@opal_cpp//runtime:eventstream", ], ) @@ -227,13 +227,13 @@ cc_test( name = "websocket_contract_consumer_test", size = "small", srcs = ["websocket_contract_consumer_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "@googletest//:gtest_main", - "@smithy_cpp//runtime:core", - "@smithy_cpp//runtime:eventstream", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:websocket_contract_test_support", + "@opal_cpp//runtime:core", + "@opal_cpp//runtime:eventstream", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:websocket_contract_test_support", ], ) @@ -246,12 +246,12 @@ cc_test( name = "websocket_acceptance_test", size = "small", srcs = ["websocket_acceptance_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "@googletest//:gtest_main", - "@smithy_cpp//runtime:eventstream", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:http_beast", + "@opal_cpp//runtime:eventstream", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:http_beast", ], ) @@ -264,13 +264,13 @@ cc_test( name = "exception_safety_acceptance_test", size = "small", srcs = ["exception_safety_acceptance_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:eventstream", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:http_beast", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:eventstream", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:http_beast", ], ) @@ -284,13 +284,13 @@ cc_test( name = "async_acceptance_test", size = "small", srcs = ["async_acceptance_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "@googletest//:gtest_main", - "@smithy_cpp//runtime:eventstream", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:http_beast", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:eventstream", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:http_beast", + "@opal_cpp//runtime:server", ], ) @@ -319,25 +319,25 @@ smithy_cpp_server_library( cc_binary( name = "chat_reconnect_server", srcs = ["chat_reconnect_server_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":chat_stream_server", - "@smithy_cpp//runtime:core", - "@smithy_cpp//runtime:http_beast", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:core", + "@opal_cpp//runtime:http_beast", + "@opal_cpp//runtime:server", ], ) cc_binary( name = "chat_reconnect_client", srcs = ["chat_reconnect_client_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":chat_stream_client", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:core", - "@smithy_cpp//runtime:eventstream", - "@smithy_cpp//runtime:http_beast", # the generated client's default dialer + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:core", + "@opal_cpp//runtime:eventstream", + "@opal_cpp//runtime:http_beast", # the generated client's default dialer ], ) @@ -363,12 +363,12 @@ sh_test( cc_binary( name = "chat_async_reconnect_server", srcs = ["chat_async_reconnect_server_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":chat_stream_server", - "@smithy_cpp//runtime:core", - "@smithy_cpp//runtime:http_beast", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:core", + "@opal_cpp//runtime:http_beast", + "@opal_cpp//runtime:server", ], ) @@ -398,16 +398,16 @@ cc_test( name = "streaming_acceptance_test", size = "small", srcs = ["streaming_acceptance_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":chat_stream_client", ":chat_stream_server", "@googletest//:gtest_main", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:eventstream", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:http_beast", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:eventstream", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:http_beast", + "@opal_cpp//runtime:server", ], ) @@ -436,24 +436,24 @@ smithy_cpp_server_library( cc_binary( name = "jsonrpc_stream_server", srcs = ["jsonrpc_stream_server_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":tally_stream_server", - "@smithy_cpp//runtime:core", - "@smithy_cpp//runtime:http_beast", - "@smithy_cpp//runtime:server", + "@opal_cpp//runtime:core", + "@opal_cpp//runtime:http_beast", + "@opal_cpp//runtime:server", ], ) cc_binary( name = "jsonrpc_stream_client", srcs = ["jsonrpc_stream_client_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":tally_stream_client", - "@smithy_cpp//runtime:client", - "@smithy_cpp//runtime:core", - "@smithy_cpp//runtime:http_beast", # the generated client's default dialer + "@opal_cpp//runtime:client", + "@opal_cpp//runtime:core", + "@opal_cpp//runtime:http_beast", # the generated client's default dialer ], ) @@ -463,12 +463,12 @@ cc_binary( cc_binary( name = "jsonrpc_raw_peer", srcs = ["jsonrpc_raw_peer_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ - "@smithy_cpp//runtime:core", - "@smithy_cpp//runtime:eventstream", - "@smithy_cpp//runtime:http", - "@smithy_cpp//runtime:http_beast", + "@opal_cpp//runtime:core", + "@opal_cpp//runtime:eventstream", + "@opal_cpp//runtime:http", + "@opal_cpp//runtime:http_beast", ], ) diff --git a/examples/bazel-consumer/MODULE.bazel b/examples/bazel-consumer/MODULE.bazel index 78f287cd..0212de89 100644 --- a/examples/bazel-consumer/MODULE.bazel +++ b/examples/bazel-consumer/MODULE.bazel @@ -1,16 +1,16 @@ -# Out-of-tree consumer of smithy_cpp: the quick-start acceptance test. +# Out-of-tree consumer of opal_cpp: the quick-start acceptance test. # CI builds this module standalone (cd examples/bazel-consumer && bazel test //...). module( - name = "smithy_cpp_consumer", + name = "opal_cpp_consumer", version = "0.0.0", ) -bazel_dep(name = "smithy_cpp", version = "0.0.0") +bazel_dep(name = "opal_cpp", version = "0.0.0") -# Until smithy_cpp is published to the Bazel Central Registry (deferred until +# Until opal_cpp is published to the Bazel Central Registry (deferred until # the project is production-validated), consume it by path or git override. local_path_override( - module_name = "smithy_cpp", + module_name = "opal_cpp", path = "../..", ) diff --git a/examples/bazel-consumer/boringssl-resolution-check.sh b/examples/bazel-consumer/boringssl-resolution-check.sh index 7b091fce..afa2dde3 100755 --- a/examples/bazel-consumer/boringssl-resolution-check.sh +++ b/examples/bazel-consumer/boringssl-resolution-check.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -# Asserts the dependency-resolution invariant behind smithy_cpp's boringssl +# Asserts the dependency-resolution invariant behind opal_cpp's boringssl # pin (see the comment above the bazel_dep in ../../MODULE.bazel): the # version this consumer's module graph actually selects for boringssl is -# exactly the version smithy_cpp declares. Bazel's MVS picks the highest +# exactly the version opal_cpp declares. Bazel's MVS picks the highest # version any module in the graph requests, so a transitive dependency could # quietly drag the security-sensitive TLS library past the pinned-and-tested # version — every CI leg would still be green while consumers link a @@ -16,23 +16,23 @@ bazel="${BAZEL:-$(command -v bazelisk || command -v bazel)}" pinned=$(sed -n 's/^bazel_dep(name = "boringssl", version = "\([^"]*\)").*/\1/p' ../../MODULE.bazel) if [[ -z "$pinned" ]]; then - echo "error: no boringssl bazel_dep found in smithy_cpp's MODULE.bazel" >&2 + echo "error: no boringssl bazel_dep found in opal_cpp's MODULE.bazel" >&2 exit 1 fi -resolved=$("$bazel" mod deps smithy_cpp --output json | - jq -r '.dependencies[] | select(.name == "smithy_cpp") +resolved=$("$bazel" mod deps opal_cpp --output json | + jq -r '.dependencies[] | select(.name == "opal_cpp") | .dependencies[] | select(.name == "boringssl") | .version') if [[ -z "$resolved" ]]; then - echo "error: boringssl is not among smithy_cpp's resolved dependencies" >&2 + echo "error: boringssl is not among opal_cpp's resolved dependencies" >&2 exit 1 fi if [[ "$resolved" != "$pinned" ]]; then - echo "error: the module graph resolved boringssl@$resolved, but smithy_cpp pins $pinned" >&2 - echo "MVS selected a version smithy_cpp's own CI never tested; either bump the" >&2 + echo "error: the module graph resolved boringssl@$resolved, but opal_cpp pins $pinned" >&2 + echo "MVS selected a version opal_cpp's own CI never tested; either bump the" >&2 echo "pin deliberately or find the module dragging boringssl forward." >&2 exit 1 fi -echo "OK: resolved boringssl@$resolved matches smithy_cpp's pin" +echo "OK: resolved boringssl@$resolved matches opal_cpp's pin" diff --git a/examples/bazel-consumer/eventstream_consumer_test.cc b/examples/bazel-consumer/eventstream_consumer_test.cc index 24cc73b7..674f0ebe 100644 --- a/examples/bazel-consumer/eventstream_consumer_test.cc +++ b/examples/bazel-consumer/eventstream_consumer_test.cc @@ -2,7 +2,7 @@ // slice 1): the consumer surface exactly as the frame.h contract teaches // it — plain-value headers, the canonical chunked decode loop, FindString // dispatch, and the core-Timestamp interop — consumed through the module -// boundary like any other @smithy_cpp runtime target. +// boundary like any other @opal_cpp runtime target. #include diff --git a/examples/cafe/BUILD.bazel b/examples/cafe/BUILD.bazel index e88068c7..53189db5 100644 --- a/examples/cafe/BUILD.bazel +++ b/examples/cafe/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # Behavior tests for the generated cafe types (rpcv2Cbor fixture model). @@ -7,7 +7,7 @@ cc_test( name = "generated_client_test", size = "small", srcs = ["generated_client_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/cafe/generated:client", "//runtime:cbor", @@ -20,7 +20,7 @@ cc_test( name = "generated_types_test", size = "small", srcs = ["generated_types_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/cafe/generated:types", "@googletest//:gtest_main", diff --git a/examples/chat/BUILD.bazel b/examples/chat/BUILD.bazel index 1de248af..4fe4851a 100644 --- a/examples/chat/BUILD.bazel +++ b/examples/chat/BUILD.bazel @@ -1,6 +1,6 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test") load("@rules_shell//shell:sh_test.bzl", "sh_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # Full-duplex chat example (ADR-0016; PLAN §Phase 8's exit criterion): the # generated client and generated server exercising event streams end to end. @@ -20,7 +20,7 @@ cc_test( "room_handler.h", "stream_test_fixture.h", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/chat/generated:client", "//examples/chat/generated:server", @@ -41,7 +41,7 @@ cc_test( "chat_e2e_beast_test.cc", "room_handler.h", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, tags = ["requires-network"], deps = [ "//examples/chat/generated:client", @@ -67,7 +67,7 @@ cc_test( "chat_browser_e2e_test.cc", "room_handler.h", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, tags = ["requires-network"], deps = [ "//examples/chat/generated:client", @@ -95,7 +95,7 @@ cc_test( "hub_handler.h", "stream_test_fixture.h", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/chat/generated:client", "//examples/chat/generated:server", @@ -114,7 +114,7 @@ cc_binary( "hub_handler.h", "hub_server_main.cc", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/chat/generated:server", "//runtime:core", @@ -129,7 +129,7 @@ cc_binary( cc_binary( name = "hub_client", srcs = ["hub_client_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/chat/generated:client", "//runtime:client", @@ -147,7 +147,7 @@ cc_binary( cc_binary( name = "async_hub_server", srcs = ["async_hub_server_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/chat/generated:server", "//examples/chat/generated:types", diff --git a/examples/jsonrpc2/BUILD.bazel b/examples/jsonrpc2/BUILD.bazel index 5e1d5281..8a18e442 100644 --- a/examples/jsonrpc2/BUILD.bazel +++ b/examples/jsonrpc2/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # The stream wire's in-memory half (ADR-0023): generated client and server # round-tripping through the JSON-RPC envelopes on both serve seams over an @@ -14,7 +14,7 @@ cc_test( "stream_e2e_test.cc", "stream_test_fixture.h", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/jsonrpc2/generated:client", "//examples/jsonrpc2/generated:server", @@ -36,7 +36,7 @@ cc_test( "accumulate_handler.h", "stream_e2e_beast_test.cc", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, tags = ["requires-network"], deps = [ "//examples/jsonrpc2/generated:client", @@ -54,7 +54,7 @@ cc_test( name = "interop_wire_test", size = "small", srcs = ["interop_wire_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/jsonrpc2/generated:client", "//examples/jsonrpc2/generated:server", diff --git a/examples/roundtrip/rest/BUILD.bazel b/examples/roundtrip/rest/BUILD.bazel index 93f1c816..ca9ef4c9 100644 --- a/examples/roundtrip/rest/BUILD.bazel +++ b/examples/roundtrip/rest/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # The typed view over an operation's modeled errors (issue #49): FromError # matching, detail carriage, kind gating, exhaustive visit, wrong-case death. @@ -7,7 +7,7 @@ cc_test( name = "typed_errors_test", size = "small", srcs = ["typed_errors_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/rest/generated:client", "//runtime:core", @@ -22,7 +22,7 @@ cc_test( name = "numeric_bounds_wire_test", size = "small", srcs = ["numeric_bounds_wire_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/rest/generated:client", "//examples/roundtrip/rest/generated:serde", @@ -39,7 +39,7 @@ cc_test( name = "api_key_wire_test", size = "small", srcs = ["api_key_wire_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/rest/generated:client", "//runtime:client", diff --git a/examples/roundtrip/rpc/BUILD.bazel b/examples/roundtrip/rpc/BUILD.bazel index a3873893..dc55d34e 100644 --- a/examples/roundtrip/rpc/BUILD.bazel +++ b/examples/roundtrip/rpc/BUILD.bazel @@ -1,11 +1,11 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") cc_test( name = "no_input_body_wire_test", size = "small", srcs = ["no_input_body_wire_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/rpc/generated:server", "//runtime:http", diff --git a/examples/simplerestjson/BUILD.bazel b/examples/simplerestjson/BUILD.bazel index 6d50278d..cdb870bb 100644 --- a/examples/simplerestjson/BUILD.bazel +++ b/examples/simplerestjson/BUILD.bazel @@ -1,13 +1,13 @@ load("@rules_cc//cc:defs.bzl", "cc_binary") load("@rules_shell//shell:sh_test.bzl", "sh_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # The serving-lifecycle example (issue #49); docs/production-guide.md # § "Serving lifecycle" is the walkthrough. cc_binary( name = "bookstore_server", srcs = ["serve_main.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/simplerestjson/generated:server", "//examples/simplerestjson/generated:types", diff --git a/examples/weather/BUILD.bazel b/examples/weather/BUILD.bazel index a6053546..07f70a36 100644 --- a/examples/weather/BUILD.bazel +++ b/examples/weather/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # Hand-written prototype of the code the Phase 2/3/4 generators will emit for # model/weather.smithy; its e2e test is the Phase 1 exit criterion. @@ -16,7 +16,7 @@ cc_library( "handwritten/weather_server.h", "handwritten/weather_types.h", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, visibility = ["//visibility:public"], deps = [ "//runtime:client", @@ -31,7 +31,7 @@ cc_test( name = "generated_types_test", size = "small", srcs = ["generated_types_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/weather/generated:types", "@googletest//:gtest_main", @@ -42,7 +42,7 @@ cc_test( name = "generated_client_e2e_test", size = "small", srcs = ["generated_client_e2e_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, tags = ["requires-network"], deps = [ ":weather_handwritten", @@ -55,7 +55,7 @@ cc_test( name = "generated_server_e2e_test", size = "small", srcs = ["generated_server_e2e_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":weather_handwritten", "//examples/weather/generated:client", @@ -70,7 +70,7 @@ cc_test( name = "weather_e2e_test", size = "small", srcs = ["handwritten/weather_e2e_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, tags = ["requires-network"], deps = [ ":weather_handwritten", @@ -84,7 +84,7 @@ cc_test( name = "weather_e2e_beast_test", size = "small", srcs = ["handwritten/weather_e2e_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, defines = ["OPAL_E2E_HAVE_BEAST"], tags = ["requires-network"], deps = [ diff --git a/fuzz/BUILD.bazel b/fuzz/BUILD.bazel index 0e72fabf..4aa2e0f5 100644 --- a/fuzz/BUILD.bazel +++ b/fuzz/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # Each harness builds two ways: as an ordinary test through the deterministic # driver (runs in every CI matrix job, including ASan/UBSan), and as a real @@ -46,7 +46,7 @@ FUZZ_TARGETS = { "fuzz_driver_main.cc", name + "_fuzz.cc", ], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = deps, ) for name, deps in FUZZ_TARGETS.items() @@ -56,7 +56,7 @@ FUZZ_TARGETS = { cc_binary( name = name + "_fuzz", srcs = [name + "_fuzz.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, tags = ["manual"], deps = deps, ) diff --git a/protocol-tests/jsonrpc2/BUILD.bazel b/protocol-tests/jsonrpc2/BUILD.bazel index 0b10582f..f6d23afa 100644 --- a/protocol-tests/jsonrpc2/BUILD.bazel +++ b/protocol-tests/jsonrpc2/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # The authored stream conformance suite (ADR-0023): normative for the # jsonRpc2 stream wire the way the model's trait cases (rendered into @@ -9,7 +9,7 @@ cc_test( name = "stream_conformance_test", size = "small", srcs = ["stream_conformance_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//protocol-tests/jsonrpc2/generated:client", "//protocol-tests/jsonrpc2/generated:server", diff --git a/protocol-tests/rpcv2cbor/malformed/BUILD.bazel b/protocol-tests/rpcv2cbor/malformed/BUILD.bazel index 74df3a98..674b599c 100644 --- a/protocol-tests/rpcv2cbor/malformed/BUILD.bazel +++ b/protocol-tests/rpcv2cbor/malformed/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # Hand-written malformed-server coverage for rpcv2Cbor (issue #48): the # official conformance suite has no httpMalformedRequestTests for this @@ -12,7 +12,7 @@ cc_test( name = "server_malformed_test", size = "small", srcs = ["server_malformed_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//protocol-tests/rpcv2cbor/generated:server", "//runtime:cbor", diff --git a/protocol-tests/simplerestjson/malformed/BUILD.bazel b/protocol-tests/simplerestjson/malformed/BUILD.bazel index 2f6da65c..bba8c017 100644 --- a/protocol-tests/simplerestjson/malformed/BUILD.bazel +++ b/protocol-tests/simplerestjson/malformed/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") # Hand-written malformed-server coverage for simpleRestJson (issue #48): the # alloy conformance suite has no httpMalformedRequestTests, so nothing @@ -11,7 +11,7 @@ cc_test( name = "server_malformed_test", size = "small", srcs = ["server_malformed_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//protocol-tests/simplerestjson/generated:server", "//runtime:http", @@ -27,7 +27,7 @@ cc_test( name = "pattern_violation_test", size = "small", srcs = ["pattern_violation_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/rest/generated:server", "//runtime:http", diff --git a/protocol-tests/unions/BUILD.bazel b/protocol-tests/unions/BUILD.bazel index 8f099481..277189d8 100644 --- a/protocol-tests/unions/BUILD.bazel +++ b/protocol-tests/unions/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//bazel:copts.bzl", "SMITHY_COPTS") +load("//bazel:copts.bzl", "OPAL_COPTS") load("//bazel:defs.bzl", "smithy_cpp_client_library", "smithy_cpp_server_library") # Union x protocol conformance cells (issue #48): union round-tripping was @@ -18,7 +18,7 @@ cc_test( name = "union_accessor_test", size = "small", srcs = ["union_accessor_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/cafe/generated:types", "//runtime:core", @@ -30,7 +30,7 @@ cc_test( name = "union_cbor_test", size = "small", srcs = ["union_cbor_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/rpc/generated:client", "//examples/roundtrip/rpc/generated:server", @@ -46,7 +46,7 @@ cc_test( name = "union_jsonrpc2_test", size = "small", srcs = ["union_jsonrpc2_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ "//examples/roundtrip/jsonrpc/generated:client", "//examples/roundtrip/jsonrpc/generated:server", @@ -97,7 +97,7 @@ cc_test( name = "union_gauntlet_cbor_test", size = "small", srcs = ["union_gauntlet_cbor_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":gauntlet_cbor_client", ":gauntlet_cbor_server", @@ -113,7 +113,7 @@ cc_test( name = "union_gauntlet_jsonrpc2_test", size = "small", srcs = ["union_gauntlet_jsonrpc2_test.cc"], - copts = SMITHY_COPTS, + copts = OPAL_COPTS, deps = [ ":gauntlet_jsonrpc_client", ":gauntlet_jsonrpc_server", diff --git a/renovate.json b/renovate.json index 04d906a2..28bbd459 100644 --- a/renovate.json +++ b/renovate.json @@ -65,9 +65,9 @@ "groupName": "alloy packages" }, { - "description": "smithy_cpp is consumed via local/git override (version 0.0.0 until BCR publication); there is nothing to look up, and the attempt produces a dashboard warning.", + "description": "opal_cpp is consumed via local/git override (version 0.0.0 until BCR publication); there is nothing to look up, and the attempt produces a dashboard warning.", "matchPackageNames": [ - "smithy_cpp" + "opal_cpp" ], "enabled": false } diff --git a/runtime/BUILD.bazel b/runtime/BUILD.bazel index 2190a954..0a438181 100644 --- a/runtime/BUILD.bazel +++ b/runtime/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") -load("//bazel:copts.bzl", COPTS = "SMITHY_COPTS") +load("//bazel:copts.bzl", COPTS = "OPAL_COPTS") package(default_visibility = ["//visibility:public"]) From 9d06a842824762f3c49815ef59b81946c48c3828 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 12:30:31 +0000 Subject: [PATCH 2/2] Name runtimeTarget in the module-rename migration note A consumer that sets runtimeTarget in smithy-build.json has a @smithy_cpp// label outside any BUILD file; say so rather than leaving it to "every label". --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a78198e2..1b55b189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,8 @@ policy in [docs/versioning.md](docs/versioning.md). files load from `//bazel:copts.bzl` is `OPAL_COPTS`. Migration: `smithy_cpp` → `opal_cpp` in `MODULE.bazel` (the `bazel_dep` and any `local_path_override`/`git_override` naming it) and in every `@smithy_cpp//` - label; `SMITHY_COPTS` → `OPAL_COPTS` if you load it. The rules keep their + label, including a `runtimeTarget` you set in `smithy-build.json`; + `SMITHY_COPTS` → `OPAL_COPTS` if you load it. The rules keep their names — `smithy_cpp_types_library`, `smithy_cpp_client_library`, `smithy_cpp_server_library` take a Smithy model as input and are named for it — so `load("@opal_cpp//bazel:defs.bzl", "smithy_cpp_server_library")`