Azure / azure-sdk-for-cpp

This repository is for active development of the Azure SDK for C++. For consumers of the SDK we recommend visiting our versioned developer docs at https://azure.github.io/azure-sdk-for-cpp.
MIT License
179 stars 128 forks source link

Error Building with Azure SDK Dependencies using Clang on Windows #5123

Closed darrienMS closed 11 months ago

darrienMS commented 11 months ago

Describe the bug I am receiving an error when trying to leverage the azure sdk for c++. It seems like Clang is setting compilations options (/wd28204 and /wd28020) that are being processed as directories, which are resulting in errors.

Exception or Stack Trace [50/73] Building CXX object src/samples/CMakeFiles/main.dir/main.cpp.obj FAILED: src/samples/CMakeFiles/main.dir/main.cpp.obj C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DAZ_CORE_DLL -DAZ_IDENTITY_DLL -DAZ_RTTI -DAZ_STORAGE_BLOBS_DLL -DAZ_STORAGE_COMMON_DLL -IC:/Users/darrienhunt/source/OneLakeClient/src -isystem C:/Users/darrienhunt/source/OneLakeClient/build/x64-debug/vcpkg_installed/x64-windows/include -isystem C:/src/vcpkg/installed/x64-windows/include -O0 -g -Xclang -gcodeview -std=gnu++17 -D_DEBUG -D_DLL -DMT -Xclang --dependent-lib=msvcrtd /wd28204 /wd28020 -MD -MT src/samples/CMakeFiles/main.dir/main.cpp.obj -MF src\samples\CMakeFiles\main.dir\main.cpp.obj.d -o src/samples/CMakeFiles/main.dir/main.cpp.obj -c C:/Users/darrienhunt/source/OneLakeClient/src/samples/main.cpp C:\Users\darrienhunt\source\OneLakeClient\build\x64-debug\CLANG~1 : error : no such file or directory: '/wd28204'

C:\Users\darrienhunt\source\OneLakeClient\build\x64-debug\CLANG_~1 : error : no such file or directory: '/wd28020'

To Reproduce Steps to reproduce the behavior: I created a simple C++ project with vcpkg in manifest mode and CMake. I added the azure SDK depencies in both the vcpkg.json file and the CMakeLists.txt and configured the project. Upon build, I received erros:

no such file or directory: '/wd28204' C:\Users\darrienhunt\source\OneLakeClient\build\x64-debug\OneLakeClient C:\Users\darrienhunt\source\OneLakeClient\build\x64-debug\CLANG_~1 1

no such file or directory: '/wd28020' C:\Users\darrienhunt\source\OneLakeClient\build\x64-debug\OneLakeClient C:\Users\darrienhunt\source\OneLakeClient\build\x64-debug\CLANG_~1 1

Code Snippet //CMakeLists.txt add_executable(main "main.cpp")

find_package(azure-storage-blobs-cpp CONFIG REQUIRED) find_package(azure-core-cpp CONFIG REQUIRED) find_package(azure-identity-cpp CONFIG REQUIRED)

target_include_directories(main PUBLIC ${PROJECT_SOURCE_DIR}/src PRIVATE ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include )

List all platform-agnostic library dependencies here

target_link_libraries(main PRIVATE olccppfacade Azure::azure-identity Azure::azure-core Azure::azure-storage-blobs)

//vcpkg.json { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", "name": "onelakeclient", "version": "0.1.0", "dependencies": [ "opentelemetry-cpp", "boost-interprocess", "boost-process", "boost-property-tree", "azure-storage-files-datalake-cpp", "azure-storage-blobs-cpp", "azure-identity-cpp", "azure-core-cpp", { "name": "curl", "features": [ "openssl" ] }, "gtest" ], "builtin-baseline": "962e5e39f8a25f42522f51fffc574e05a3efd26b" }

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

azure cpp adk error

If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

clang version 17.0.1

antkmsft commented 11 months ago

It was fixed in #5109, and was merged into vcpkg: https://github.com/microsoft/vcpkg/pull/34883

Have you updated your vcpkg to the recent? The port version of azure-storage-common-cpp should be displayed as 12.4.0#2 (or later).

antkmsft commented 11 months ago

Try putting "builtin-baseline": "8acbab7a13ce364d6ee48243d43899dc03ba5cfb" in your vcpkg.json, would you still see this error?

PseudoAj commented 11 months ago

+1 seeing this as well.

antkmsft commented 11 months ago

Darrien has told me in Teams that updating the builtin-baseline worked for him, @PseudoAj, can you give it a try?

BTW, if you want the newest releases that were merged into vcpkg just 6 hours ago, you can also set the baseline to cb81acf7b28f13f4c01ef6b8c0e9d481ea33c84c. They also have the fix already incorporated into the release.

darrienMS commented 11 months ago

Updating the built-in baseline has worked for me. Thank you!

antkmsft commented 11 months ago

5111?