Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDB files generated for some but not all projects #1936

Open
Mike4Online opened this issue May 28, 2022 · 1 comment
Open

PDB files generated for some but not all projects #1936

Mike4Online opened this issue May 28, 2022 · 1 comment
Labels
bug This issue is a bug. build-problem problems with building this sdk Cmake Cmake related submissions p2 This is a standard priority issue

Comments

@Mike4Online
Copy link

Mike4Online commented May 28, 2022

Describe the bug

When building AWS SDK for C++ version 1.9.267, for Windows, as static libraries, some of the Debug|x64 builds fail to generate a .pdb file along with the .lib file.

Expected Behavior

All .vcxproj files generated by CMake should specify:

<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

within Debug build configurations (also in RelWithDebugInfo build configurations).

.pdb files should be generated by default for all Debug builds on Windows.

Current Behavior

After running the following two commands from the CMake build directory I created...

cmake ..\aws-sdk-cpp -DCMAKE_BUILD_TYPE="Debug" -DBUILD_ONLY="s3" -DBUILD_SHARED_LIBS="OFF" -DFORCE_SHARED_CRT="OFF" -DENABLE_TESTING="OFF"

"C:\Program Files\Microsoft Visual Studio\2022\Professional\Msbuild\Current\Bin\MSBuild.exe" ALL_BUILD.vcxproj -target:Rebuild -property:Configuration=Debug;Platform=x64 -maxCpuCount:7

...I can then find a .pdb file IN ONLY THE LAST of the following three output folders:

..\CodeRepos\sdk_build_debug\aws-cpp-sdk-core\Debug
..\CodeRepos\sdk_build_debug\aws-cpp-sdk-s3\Debug
..\CodeRepos\sdk_build_debug\crt\aws-crt-cpp\Debug

Upon examining the .vcxproj files generated by CMake, only the one for aws-crt-cpp specifies:

<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

..within the ItemDefinitionGroup for Debug|x64. The other two .vcxproj files instead specify:

<DebugInformationFormat>OldStyle</DebugInformationFormat>

and therefore fail to generate a .pdb file.

Reproduction Steps

See "Current Behavior", reported above, for reproduction steps.

Possible Solution

..alter the CMake files for each AWS SDK project, so when a VC++ project is generated by CMake, the ItemDefinitionGroup for each Debug|x64 build in each AWS SDK project will specify:

<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

rather than:

<DebugInformationFormat>OldStyle</DebugInformationFormat>

The same should be done for Debug|Win32 build configurations, as well as all RelWithDebugInfo build configurations.

Since the CMake files which back the aws-crt-cpp project are already doing this properly, they can be used as a model in this regard for other CMake projects within the AWS SDK for C++.

Additional Information/Context

No response

AWS CPP SDK version used

1.9.267

Compiler and Version used

Visual Studio 2022 build 17.2.2 - MSVC 19.29.30143.0

Operating System and version

Windows 10 version 21H2 build 19044.1706

@Mike4Online Mike4Online added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 28, 2022
@jmklix jmklix added needs-reproduction This issue needs reproduction. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 18, 2022
@yasminetalby yasminetalby added the Cmake Cmake related submissions label Sep 20, 2023
@jmklix
Copy link
Member

jmklix commented May 24, 2024

This is still a problem as pointed out in this issue: #2963

A short term work around would be to manually copy over the pdb files.
A long term solution would be to make sure they get copied over in cmake as @nanocom suggests in the duplicate issue:

if (MSVC)
    install(FILES $<TARGET_PDB_FILE:MyExecutable> DESTINATION bin OPTIONAL)
endif()

We are still working on improving the build process, #1888. I'm not sure when this will get fixed

@jmklix jmklix added build-problem problems with building this sdk and removed needs-reproduction This issue needs reproduction. labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. build-problem problems with building this sdk Cmake Cmake related submissions p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants