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

vcpkg_copy_pdbs() does not work #41400

Open
SHIINASAMA opened this issue Oct 7, 2024 · 9 comments · May be fixed by #41609
Open

vcpkg_copy_pdbs() does not work #41400

SHIINASAMA opened this issue Oct 7, 2024 · 9 comments · May be fixed by #41609
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@SHIINASAMA
Copy link
Contributor

SHIINASAMA commented Oct 7, 2024

Describe the bug
Failed to match the vcpkg_copy_pdbs() string due to a non-English environment.

Environment

  • OS: Windows
  • Compiler: MSVC

To Reproduce
Steps to reproduce the behavior:

  1. visual studio installs non-English language packages
  2. install packages with pdb files

Expected behavior
The vcpkg temporarily changes the locale to English and then correctly identifies the pdb path

Failure logs
I did some simple debugging with message() and extracted the key valid information.
image

Full logs

vcpkg on  master [!⇡]
❯ ./vcpkg install sese
warning: The vcpkg D:\workspaces\vcpkg\vcpkg.exe is using detected vcpkg root D:\workspaces\vcpkg and ignoring mismatched VCPKG_ROOT environment value C:\vcpkg. To suppress this message, unset the environment variable or use the --vcpkg-root command line switch.
Computing installation plan...
The following packages will be built and installed:
    sese[core,sqlite3]:[email protected]
Detecting compiler hash for triplet x64-windows...
-- Automatically setting %HTTP(S)_PROXY% environment variables to "127.0.0.1:7890".
Compiler found: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from D:\vcpkg-archives in 132 us. Use --debug to see more details.
Installing 1/1 sese[core,sqlite3]:[email protected]...
Building sese[core,sqlite3]:[email protected]...
-- Using cached libsese-sese-2.3.0.tar.gz.
-- Cleaning sources at D:/workspaces/vcpkg/buildtrees/sese/src/2.3.0-9f7df747cd.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source D:/workspaces/vcpkg/downloads/libsese-sese-2.3.0.tar.gz
-- Applying patch 001-msvc-pdbs.patch
-- Using source at D:/workspaces/vcpkg/buildtrees/sese/src/2.3.0-9f7df747cd.clean
-- Found external ninja('1.11.0').
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
 找到 PDB 文件(在“D:\workspaces\vcpkg\buildtrees\sese\x64-windows-rel\sese\sese.core.pdb”中)
 = 0
 找到 PDB 文件(在“D:\workspaces\vcpkg\buildtrees\sese\x64-windows-dbg\sese\sese.core.pdb”中)
 = 0
CMake Warning at scripts/cmake/vcpkg_copy_pdbs.cmake:44 (message):
  Could not find a matching pdb file for:

      D:/workspaces/vcpkg/packages/sese_x64-windows/bin/sese.core.dll
      D:/workspaces/vcpkg/packages/sese_x64-windows/debug/bin/sese.core.dll

Call Stack (most recent call first):
  ports/sese/portfile.cmake:43 (vcpkg_copy_pdbs)
  scripts/ports.cmake:192 (include)


-- Installing: D:/workspaces/vcpkg/packages/sese_x64-windows/share/sese/usage
-- Performing post-build validation
Stored binaries in 1 destinations in 1.4 s.
Elapsed time to handle sese:x64-windows: 3.4 min
sese:x64-windows package ABI: 278acb9dc776a932fd813de8323fe6dbdf20ae287ab9766c96487367a741089b
Total install time: 3.4 min
sese provides CMake targets:

    find_package(sese CONFIG REQUIRED)
    # build full features
    target_link_libraries(main PRIVATE Sese::Core)
    # build only plugin
    target_link_libraries(main PRIVATE Sese::Plugin)

Additional context

I found this problem while updating my package, and it can be repeated when other packages are installed (e.g. zlib)

@SHIINASAMA
Copy link
Contributor Author

I found that vcpkg will switch to the English environment, but it seems impossible to tell if the user has installed the English language pack, can output some information in this regard to guide the user to install the language pack?

@autoantwort
Copy link
Contributor

@SHIINASAMA
Copy link
Contributor Author

It was documented, but it seems that they removed it 😅 https://github.com/microsoft/vcpkg/pull/39655/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L64

Well, at least I think it needs to be a more user friendly prompt. Like when vcpkg fails to download it alerts the user that it may be due to a proxy environment variable being set.

@jimwang118 jimwang118 added the category:question This issue is a question label Oct 8, 2024
@autoantwort
Copy link
Contributor

I don't know if there is a good was to detect the installed languages

@dg0yt
Copy link
Contributor

dg0yt commented Oct 8, 2024

Duplicates #25846.

@dg0yt
Copy link
Contributor

dg0yt commented Oct 8, 2024

I don't know if there is a good was to detect the installed languages

Well, bootstrap could run dumpbin on vcpkg.exe and check for a known DLL.

@autoantwort
Copy link
Contributor

I guess the best solution is remove the dependency on dumpbin completely

We already have like 95% of the code necessary to replace dumpbin in https://github.com/BillyONeal/vcpkg-tool/tree/replace-powershell which avoids needing to download separate LLVM stuff. @BillyONeal

@dg0yt
Copy link
Contributor

dg0yt commented Oct 8, 2024

The missing 5% didn't come in 2 years.

@autoantwort
Copy link
Contributor

Right, but implementing that should not be that hard.

@jimwang118 jimwang118 added category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) and removed category:question This issue is a question labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants