azure-sdk-for-cpp icon indicating copy to clipboard operation
azure-sdk-for-cpp copied to clipboard

Cannot configure/use azure-sdk-for-cpp as per README

Open felix-kolbe opened this issue 1 year ago • 17 comments

Describe the bug I followed the README.md to include azure-sdk-for-cpp in my project, but the configuring step fails.

First I used the FetchContent approach to skip any vcpkg. I created a test project for the sample to have and share a MRE: my azure-sdk-for-cpp-demo.

(I also tried to use the vcpkg way, as per README.md, but it was not working, too.)

Exception or Stack Trace Excerpt from build.log:

-- Using vendored uamqp
CMake Error at build/_deps/azuresdk-src/sdk/core/azure-core-amqp/vendor/azure-uamqp-c/CMakeLists.txt:56 (find_package):
   Could not find a package configuration file provided by
   "azure_macro_utils_c" with any of the following names:
 
     azure_macro_utils_cConfig.cmake
     azure_macro_utils_c-config.cmake

To Reproduce Steps to reproduce the behavior:

rm -rf build && cmake -S . -B build 2>&1 | tee logs/build.log

Code Snippet The CMakeLists.txt I used. Includes other variants I tried, as per README.

cmake_minimum_required(VERSION 3.13)

project(azure-sdk-for-cpp-demo LANGUAGES CXX)

include(FetchContent)
FetchContent_Declare(
    azuresdk
    GIT_REPOSITORY      https://github.com/Azure/azure-sdk-for-cpp.git
    GIT_TAG             main
)
FetchContent_GetProperties(azuresdk)
if(NOT azuresdk_POPULATED)
    FetchContent_Populate(azuresdk)
    # Adding all Azure SDK libraries
    add_subdirectory(${azuresdk_SOURCE_DIR} ${azuresdk_BINARY_DIR} EXCLUDE_FROM_ALL)

    # Adding one Azure SDK Library only (Storage blobs)
    # add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/storage/azure-storage-blobs ${azuresdk_BINARY_DIR} EXCLUDE_FROM_ALL)

    # Adding sub components in their own binary dirs
    # add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/core/azure-core ${azuresdk_BINARY_DIR}/azure-core EXCLUDE_FROM_ALL)
    # add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/storage/azure-storage-common ${azuresdk_BINARY_DIR}/azure-storage-common EXCLUDE_FROM_ALL)
    # add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/storage/azure-storage-blobs ${azuresdk_BINARY_DIR}/azure-storage-blobs EXCLUDE_FROM_ALL)

    # Adding the upper level components
    # add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/core EXCLUDE_FROM_ALL)
    # add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/storage EXCLUDE_FROM_ALL)
endif()

add_executable(${PROJECT_NAME} sample.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE Azure::azure-storage)
# target_link_libraries(${PROJECT_NAME} PRIVATE Azure::azure-identity)

Expected behavior A successful CMake configuration pass. And eventually a built sample executable.

Setup (please complete the following information):

  • OS: Ubuntu 22.04 Docker DevContainer (see my MRE's Dockerfile for details)
    $ uname -a
    Linux b9994a31fba2 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
    
  • IDE : none/shell, or VS Code
  • Version of the Library used: Branches main as well as storage-november-release (which equals azure-storage-blobs_12.10.0 and other storage tags)

Additional context I suspect the issue is within the sub component sdk/core/azure-core-amqp which somehow brings its own azure-uamqp-c, but the latter is plainly copied in there, so its submodules from .gitmodules -- which include the missing azure-macro-utils-c -- cannot be initialized and found at all.

Slightly related: #4993

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Bug Description Added
  • [x] Repro Steps Added
  • [x] Setup information Added

felix-kolbe avatar Dec 06 '23 16:12 felix-kolbe