Build PDB file for Windows (#1678)

This allows dumping human-readable backtrace symbols with line numbers.

Also limit the maximum link jobs to 1 to avoid OOM in CI.
This commit is contained in:
Younan Zhang 2024-12-02 09:24:14 +08:00 committed by GitHub
parent cb870db274
commit 909659b1ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View File

@ -17,6 +17,9 @@ If you can, provide a minimal chunk of code that shows the problem (either inlin
Please attach the clangd stderr log if you can. (Usually available from the editor) Please attach the clangd stderr log if you can. (Usually available from the editor)
If possible, run with `--log=verbose` - note that the logs will include the contents of open files! If possible, run with `--log=verbose` - note that the logs will include the contents of open files!
If this is a crash, try to put `llvm-symbolizer` on your PATH per the troubleshooting instructions. If this is a crash, try to put `llvm-symbolizer` on your PATH per the troubleshooting instructions.
(If you're using Windows, place the associated PDB file (debug symbols) in the same directory as
clangd.exe and rerun again. For official releases, download symbols from the
[release page](https://github.com/clangd/clangd/releases).)
**System information** **System information**

View File

@ -156,6 +156,8 @@ jobs:
"-DCMAKE_CXX_COMPILER=cl" "-DCMAKE_CXX_COMPILER=cl"
"-DLLVM_ENABLE_ZLIB=OFF" "-DLLVM_ENABLE_ZLIB=OFF"
"-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded" "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded"
"-DLLVM_ENABLE_PDB=ON"
"-DLLVM_PARALLEL_LINK_JOBS=1"
grpc_cmake: >- grpc_cmake: >-
"-DgRPC_MSVC_STATIC_RUNTIME=ON" "-DgRPC_MSVC_STATIC_RUNTIME=ON"
binary_extension: ".exe" binary_extension: ".exe"
@ -309,6 +311,12 @@ jobs:
${{ env.CLANGD_DIR }}/LICENSE.TXT ${{ env.CLANGD_DIR }}/LICENSE.TXT
${{ env.CLANGD_DIR }}/bin/clangd${{ matrix.config.binary_extension }} ${{ env.CLANGD_DIR }}/bin/clangd${{ matrix.config.binary_extension }}
${{ env.CLANGD_DIR }}/lib/clang ${{ env.CLANGD_DIR }}/lib/clang
- name: Archive clangd PDB symbols
if: matrix.config.name == 'windows'
run: >
7z a clangd-pdb.7z -t7z -m0=LZMA2
${{ env.CLANGD_DIR }}/LICENSE.TXT
${{ env.CLANGD_DIR }}/bin/clangd.pdb
- name: Archive indexing-tools - name: Archive indexing-tools
run: > run: >
7z a indexing-tools.zip 7z a indexing-tools.zip
@ -326,6 +334,16 @@ jobs:
asset_name: clangd-${{ matrix.config.name }}-${{ env.TAG_NAME }}.zip asset_name: clangd-${{ matrix.config.name }}-${{ env.TAG_NAME }}.zip
asset_path: clangd.zip asset_path: clangd.zip
asset_content_type: application/zip asset_content_type: application/zip
- name: Upload clangd PDB asset
if: matrix.config.name == 'windows'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_name: clangd-${{ matrix.config.name }}-${{ env.TAG_NAME }}-debug-symbols.7z
asset_path: clangd-pdb.7z
asset_content_type: application/zip
- name: Upload indexing-tools asset - name: Upload indexing-tools asset
uses: actions/upload-release-asset@v1.0.1 uses: actions/upload-release-asset@v1.0.1
env: env: