aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.96k stars 1.05k forks source link

IAMClient::GetServiceName invalid during Cmake #2851

Closed largisundavan closed 7 months ago

largisundavan commented 7 months ago

Describe the bug

When attempting to cmake the AWS files (macOS, Sonoma) to call Lambda functions, I get 2 errors from IAMClient saying it can't find the function GetServiceName.

Expected Behavior

When building the project, I expected all of the objects and libraries to build correctly. This error is seen when using cmake or make and needing the IAMClient, such as the command I used: cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_ONLY="s3;core;lambda"

Current Behavior

[ 78%] Building CXX object generated/src/aws-cpp-sdk-iam/CMakeFiles/aws-cpp-sdk-iam.dir/ub_IAM.cpp.o
In file included from /Users/jasonbuzzell/sdk_build/generated/src/aws-cpp-sdk-iam/ub_IAM.cpp:324:
In file included from /Users/jasonbuzzell/aws-sdk-cpp/generated/src/aws-cpp-sdk-iam/source/IAMClient.cpp:21:
In file included from /Users/jasonbuzzell/aws-sdk-cpp/generated/src/aws-cpp-sdk-iam/include/aws/iam/IAMClient.h:11:
/Users/jasonbuzzell/aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/client/AWSClientAsyncCRTP.h:50:81: error: no member named 'GetServiceName' in 'Aws::IAM::IAMClient'
            Aws::Utils::ComponentRegistry::RegisterComponent(AwsServiceClientT::GetServiceName(),
                                                                                ^
/Users/jasonbuzzell/aws-sdk-cpp/generated/src/aws-cpp-sdk-iam/source/IAMClient.cpp:201:12: note: in instantiation of member function 'Aws::Client::ClientWithAsyncTemplateMethods<Aws::IAM::IAMClient>::ClientWithAsyncTemplateMethods' requested here
IAMClient::IAMClient(const IAM::IAMClientConfiguration& clientConfiguration,
           ^
In file included from /Users/jasonbuzzell/sdk_build/generated/src/aws-cpp-sdk-iam/ub_IAM.cpp:324:
In file included from /Users/jasonbuzzell/aws-sdk-cpp/generated/src/aws-cpp-sdk-iam/source/IAMClient.cpp:21:
In file included from /Users/jasonbuzzell/aws-sdk-cpp/generated/src/aws-cpp-sdk-iam/include/aws/iam/IAMClient.h:11:
/Users/jasonbuzzell/aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/client/AWSClientAsyncCRTP.h:91:46: error: no member named 'GetServiceName' in 'Aws::IAM::IAMClient'
            AWS_CHECK_PTR(AwsServiceClientT::GetServiceName(), pClient);
                          ~~~~~~~~~~~~~~~~~~~^
/Users/jasonbuzzell/aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/utils/logging/ErrorMacros.h:38:25: note: expanded from macro 'AWS_CHECK_PTR'
    AWS_LOGSTREAM_FATAL(LOG_TAG, "Unexpected nullptr: " #PTR); \
                        ^~~~~~~
/Users/jasonbuzzell/aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h:79:109: note: expanded from macro 'AWS_LOGSTREAM_FATAL'
    #define AWS_LOGSTREAM_FATAL(tag, streamExpression)  AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Fatal, tag, streamExpression)
                                                                                                            ^~~
/Users/jasonbuzzell/aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h:75:46: note: expanded from macro 'AWS_LOGSTREAM'
                logSystem->LogStream( level, tag, logStream ); \
                                             ^~~
/Users/jasonbuzzell/aws-sdk-cpp/generated/src/aws-cpp-sdk-iam/source/IAMClient.cpp:296:3: note: in instantiation of member function 'Aws::Client::ClientWithAsyncTemplateMethods<Aws::IAM::IAMClient>::ShutdownSdkClient' requested here
  ShutdownSdkClient(this, -1);

Reproduction Steps

On macOS (hopefully not just Sonoma), following the standard guide: https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup-linux.html

git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp mkdir sdk_build cd sdk_build cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_ONLY="s3;core;lambda;iam"

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

0.24.11

Compiler and Version used

N/A

Operating System and version

macOS Sonoma 14.1.2

SergeyRyabinin commented 7 months ago

Hi, please use the latest tagged release: https://github.com/aws/aws-sdk-cpp/tree/1.11.261

The issue you are observing will be fixed in a next release tomorrow by a code re-generation.

Best regards, Sergey

SergeyRyabinin commented 7 months ago

It should be build-able now from main too. Please sorry from the inconvenience.

"The latest released tag version" should be considered as last official stable released version. I agree that we must not break build on HEAD main too.

github-actions[bot] commented 7 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.