Qpid
  1. Qpid
  2. QPID-2689

Cpp build on Windows does not produce debug symbol PDB file

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: Packaging
    • Labels:
      None
    • Environment:

      Windows version ANY

      Description

      A Windows package produced by win-bldsdk.ps1 PowerShell script skips installing any .PDB files in the final kit. Debug symbols are necessary for developers who use this package.

      1. qpid-2689-install-windows-pdbs.patch
        9 kB
        Chuck Rolke
      2. qpid_cpp_install-windows-pdb-files.patch
        9 kB
        Chuck Rolke
      3. qpid_cpp_build-with-pdbs.patch
        8 kB
        Chuck Rolke

        Activity

        Chuck Rolke created issue -
        Hide
        Chuck Rolke added a comment -

        This patch produces PDB files for both Release and Debug builds.

        In the bld-windsk.ps1 script:
        1. Change the Release build to RelWithDebInfo to create release pdb files.
        2. After the build, move the release and debug pdb files into symbols-release.zip and symbols-debug.zip. Customers may unzip them as they wish.

        In cpp/CMakeLists.txt:
        1. Change the RelWithDebInfo c++ and linker switches to equal the Release switches, except that now the linker produces pdb files.
        2. For each shared library emit the install-copy commands that put the pdb files into the /bin directory.
        3. Note that the install-copy does not have to deal with absent pdb files - the files are present for both builds. Also, the procedure deals with the fact that the debug and release files have different names.

        Show
        Chuck Rolke added a comment - This patch produces PDB files for both Release and Debug builds. In the bld-windsk.ps1 script: 1. Change the Release build to RelWithDebInfo to create release pdb files. 2. After the build, move the release and debug pdb files into symbols-release.zip and symbols-debug.zip. Customers may unzip them as they wish. In cpp/CMakeLists.txt: 1. Change the RelWithDebInfo c++ and linker switches to equal the Release switches, except that now the linker produces pdb files. 2. For each shared library emit the install-copy commands that put the pdb files into the /bin directory. 3. Note that the install-copy does not have to deal with absent pdb files - the files are present for both builds. Also, the procedure deals with the fact that the debug and release files have different names.
        Chuck Rolke made changes -
        Field Original Value New Value
        Attachment qpid_cpp_build-with-pdbs.patch [ 12447824 ]
        Hide
        Steve Huston added a comment -

        Hi Chuck,
        I'm not familiar with the bld-winsdk.ps1 script, but I have concerns with the proposed CMakeLists.txt change. In particular, assuming the 'd' suffix, as well as the presence of a variant you may not have built, in the install_pdb macro. I'd rather see an install of the pdb with the dll/lib and just using the target's name - no assuming a 'd' suffix (which is an addition elsewhere in CMakeLists.txt and may not forever be true) and no assuming a build that may not have been done. The Windows installer script takes care of this by building and staging multiple variants (Release and Debug).

        Show
        Steve Huston added a comment - Hi Chuck, I'm not familiar with the bld-winsdk.ps1 script, but I have concerns with the proposed CMakeLists.txt change. In particular, assuming the 'd' suffix, as well as the presence of a variant you may not have built, in the install_pdb macro. I'd rather see an install of the pdb with the dll/lib and just using the target's name - no assuming a 'd' suffix (which is an addition elsewhere in CMakeLists.txt and may not forever be true) and no assuming a build that may not have been done. The Windows installer script takes care of this by building and staging multiple variants (Release and Debug).
        Hide
        Chuck Rolke added a comment -

        Steve,

        Thanks for the comments. Here's another pass.

        CMakeLists.txt
        1. Get rid of hard coded changes to the build and link switches for configuration RelWithDebInfo. Hard-coding those values was a bad idea.

        2. The user now specifies which configurations get their PDB files exported. This is most useful to build with Release and Debug when only Debug has PDBs. The script won't fail because there's no PDB files to copy. Define a switch variable QPID_WIN_INSTALL_PDB_<configname>=1 to get that config's PDBs installed. For example:

        1. cmake '-DQPID_WIN_INSTALL_PDB_DEBUG=1'

        3. The script uses the same rules to create the PDB file name that cmake uses to create the dll names through Visual Studio. This is a great logical improvement and should answer your concern. It checks CMAKE_<configname>_POSTFIX and if defined then adds it to the file name. There's no more 'd' assumption and there's an automatic adaptation to any suffix.

        The bld-winsdk.ps1 script is updated to:
        1. Specify the c++ and link switches on the cmake command line for configuration RelWithDebInfo. This compensates for #1 in cmakelists file not being hard coded any more yet achieves the same effect.

        2. Specify which configurations have PDB files to be installed on the cmake command line.

        Show
        Chuck Rolke added a comment - Steve, Thanks for the comments. Here's another pass. CMakeLists.txt 1. Get rid of hard coded changes to the build and link switches for configuration RelWithDebInfo. Hard-coding those values was a bad idea. 2. The user now specifies which configurations get their PDB files exported. This is most useful to build with Release and Debug when only Debug has PDBs. The script won't fail because there's no PDB files to copy. Define a switch variable QPID_WIN_INSTALL_PDB_<configname>=1 to get that config's PDBs installed. For example: cmake '-DQPID_WIN_INSTALL_PDB_DEBUG=1' 3. The script uses the same rules to create the PDB file name that cmake uses to create the dll names through Visual Studio. This is a great logical improvement and should answer your concern. It checks CMAKE_<configname>_POSTFIX and if defined then adds it to the file name. There's no more 'd' assumption and there's an automatic adaptation to any suffix. The bld-winsdk.ps1 script is updated to: 1. Specify the c++ and link switches on the cmake command line for configuration RelWithDebInfo. This compensates for #1 in cmakelists file not being hard coded any more yet achieves the same effect. 2. Specify which configurations have PDB files to be installed on the cmake command line.
        Chuck Rolke made changes -
        Hide
        Chuck Rolke added a comment -

        This patch has a minor addition to yesterday's patch: It compiles and installs the .NET Binding for C++ messaging. This work is all done in the bld-winsdk.ps1 file and does not depend on or use the CMakeLists file.

        Show
        Chuck Rolke added a comment - This patch has a minor addition to yesterday's patch: It compiles and installs the .NET Binding for C++ messaging. This work is all done in the bld-winsdk.ps1 file and does not depend on or use the CMakeLists file.
        Chuck Rolke made changes -
        Attachment qpid-2689-install-windows-pdbs.patch [ 12448076 ]
        Andrew Stitcher made changes -
        Assignee Andrew Stitcher [ astitcher ]
        Hide
        Andrew Stitcher added a comment -

        The pdbs are now generated and put in the zip file with the sdk.

        Show
        Andrew Stitcher added a comment - The pdbs are now generated and put in the zip file with the sdk.
        Andrew Stitcher made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 0.7 [ 12314455 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Andrew Stitcher
            Reporter:
            Chuck Rolke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development