aws-sdk-cpp
aws-sdk-cpp copied to clipboard
Missing includes
Describe the bug
I am working on bazel build rules for some aws sdk libraries; bazel is more strict about includes than cmake. These files are missing includes, which causes errors.
- aws-cpp-sdk-core/include/aws/core/NoResult.h
- aws-cpp-sdk-core/include/aws/core/utils/stream/StreamBufProtectedWriter.h
- aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h
- aws-cpp-sdk-core/include/aws/core/Globals.h
- aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamEncoder.h
Expected Behavior
No errors.
Current Behavior
Errors on missing includes.
Reproduction Steps
Add BUILD.bazel rules and build.
Possible Solution
- aws-cpp-sdk-core/include/aws/core/NoResult.h
#include <aws/core/AmazonWebServiceResult.h>
- aws-cpp-sdk-core/include/aws/core/utils/stream/StreamBufProtectedWriter.h
#include <cstdint>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/logging/LogMacros.h>
- aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h
include <aws/core/utils/memory/AWSMemory.h>
- aws-cpp-sdk-core/include/aws/core/Globals.h
#include <memory>
- aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamEncoder.h
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/event/EventMessage.h>
Additional Information/Context
No response
AWS CPP SDK version used
67f1aae9c821f8ed061a89423741a16a4723d018
Compiler and Version used
clang
Operating System and version
linux
Hi @laramiel,
I made a PR with your suggested changes here. If this passes all of the tests then we can merge it. We currently don't have any integration tests for bazel and we don't have any plans to add them anytime soon. That being said if you run into any other missing includes please let us know.
How are you trying to build this sdk within bazel? Can you share a minimal bazel build files that reproduce the missing includes?
Sure, I'll try and get that available at some point. For now, this is a variant of a pull request that we received in tensorstore, but updated to use repositories at github head: https://github.com/google/tensorstore/pull/149
My current attempt includes these repositories:
https://github.com/awslabs/aws-c-sdkutils https://github.com/awslabs/aws-checksums https://github.com/awslabs/aws-c-cal https://github.com/awslabs/aws-c-compression https://github.com/aws/s2n-tls https://github.com/awslabs/aws-c-common https://github.com/awslabs/aws-c-event-stream https://github.com/awslabs/aws-c-http https://github.com/awslabs/aws-c-s3 https://github.com/awslabs/aws-c-auth https://github.com/awslabs/aws-c-mqtt https://github.com/awslabs/aws-c-io https://github.com/awslabs/aws-crt-cpp https://github.com/aws/aws-sdk-cpp
Only a subset of the aws-sdk-cpp repositories are included in the build, and ,ost of the BAZEL.build files are pretty simple, something like:
cc_library(
name = "aws_c_compression",
srcs = glob(
include = [
"source/*.c",
],
exclude = ["source/huffman_testing.c"],
),
hdrs = glob([
"include/aws/compression/*.h",
]),
includes = ["include/"],
deps = [ "@aws_c_common//:aws_c_common" ],
)
Did you have a minimal bazel build files yet?
I have them for almost all dependencies of aws-sdk-cpp. See the BUILD.bazel files under the aws directories here: https://github.com/google/tensorstore/tree/master/third_party
@laramiel I would also like to use aws-sdk via Bazel. Would be nice if would could bring it to the Bazel Central Registry https://registry.bazel.build/
I have noticed similar build issues within the conan build, see https://github.com/aws/aws-sdk-cpp/issues/3466.
FWIW, I have some preliminary bazel registry modules stashed in a repo here: https://github.com/laramiel/tensorstore-registry Over time I hope to migrate them someplace generally useful like bcr. If anyone else migrated them I'd be happy. :)
When would it be possible to bring this into bazel registry as I have faced numerous issues building this library into bazel. It feel very brittle when used by anything other than cmake and especially if you attempt to make a more hermetic envrionment rather than relying solely on system libraries.
I'm working towards that. Until then I have a snapshot of it here: https://github.com/laramiel/tensorstore-registry
On Sat, Nov 22, 2025 at 10:48 AM IYanakiev34 @.***> wrote:
IYanakiev34 left a comment (aws/aws-sdk-cpp#3002) https://github.com/aws/aws-sdk-cpp/issues/3002#issuecomment-3566962901
When would it be possible to bring this into bazel registry as I have faced numerous issues building this library into bazel. It feel very brittle when used by anything other than cmake and especially if you attempt to make a more hermetic envrionment rather than relying solely on system libraries.
— Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-cpp/issues/3002#issuecomment-3566962901, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACK2PS6IHLK4PA3UEWFHLSD36CVZTAVCNFSM6AAAAAB6S3WRJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNRWHE3DEOJQGE . You are receiving this because you were mentioned.Message ID: @.***>