Installed Build Fails trying to run pdbcopy.exe?

Howdy!

I’ve successfully used BuildGraph previously but for some reason when trying to run a build recently on a new machine it isn’t able to complete. This is a fresh machine with visual studio 2017 only.

The command I used was:


Engine\Binaries\DotNET\AutomationTool.exe BuildGraph -target="Make Installed Build Win64" -script="Engine\Build\InstalledEngineBuild.xml" -clean -set:HostPlatformOnly=true -set:WithDDC=false

After running for a while it fails with the error:



StripTask.Execute: Stripping symbols: C:\Users\photex\Projects\UnrealEngine\Engine\Binaries\Win64\Android\UE4Editor-Android_ASTCTargetPlatform.pdb -> C:\Users\photex\Projects\UnrealEngine\Saved\Engine\Binaries\Win64\Android\UE4Editor-Android_ASTCTargetPlatform.pdb
Program.Main: ERROR: AutomationTool terminated with exception: ERROR: Failed to start local process for action ("The system cannot find the file specified"): \PDBCopy.exe "C:\Users\photex\Projects\UnrealEngine\Engine\Binaries\Win64\Android\UE4Editor-Android_ASTCTargetPlatform.pdb" "C:\Users\photex\Projects\UnrealEngine\Saved\Engine\Binaries\Win64\Android\UE4Editor-Android_ASTCTargetPlatform.pdb" -p
Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)


I have no idea why or from where the path \PDBCopy.exe is coming from but it doesn’t exist on my machine.

Any advice? I can’t find a copy of pdbcopy.exe anywhere on my machine.

BTW, I’m trying this on the 4.15 branch and went back to the other machine and noticed it stopped working as well.

Discovered the problem. I had removed Visual Studio 2015 from my machines. This breaks the installed build setup as it currently stands in the 4.15 branch. Reinstalling 2015 got me back on track.

The pdbcopy.exe is expected to be found in \ but if 2017 is the only installed version of Visual Studio then it will actually be found in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage.

If you don’t want to install 2015 (which takes forever) you can just symlink a new v12.0 folder to v14.0 in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio:


// Run cmd.exe as administrator!
cd C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio
mklink /J v12.0 v14.0

Great tip!! Thanks.

Hm, correction. That fix was for VS 2017 Pro (installed on my desktop), but the paths are different in VS 2017 Community (installed on my laptop), because… reasons?

If you only have VS 2017 Community installed you may need to do this instead:


C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio>mklink /j v12.0 "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0"

I’m stuck with the same problem. VisualStudio 2017 Community doesn’t include PDBCopy.exe at all. Symlinking doesn’t help and there’s not even an AppxPackage directory in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0. Very frustrating that Google doesn’t reveal any useful information about PDBCopy.exe or it missing in VS2017. Is there another solution?

Thanks!

I think the pdbcopy.exe only gets installed with a certain package(s) which are not necessarily part of the default install. If you run the VS2017 installer again you should be able to add these packages.

I’m not sure exactly which one the pdbcopy.exe comes from, but this is the list of everything I have installed:

Workloads:

  • .NET desktop development
  • Universal Windows Platform development
  • C++ Universal Windows Platform tools (find this in the “optional” list over to the right once “Universal Windows Platform development” has been selected)
  • Desktop development with C++
  • Game development with C++

Individual components:

  • Windows 8.1 SDK
  • VC++ 2015.3 v140 toolset (x86,x64)

I suspect (but this is a guess) that the VC++ 2015.3 v140 toolset is the one that provides the pdbcopy.exe.

For some stuff I’ve had to also go into the installed application list in Settings/ControlPanel of Windows and choose to modify it that way and add features. Primary example being cdb.exe. To get that I had to find the win10 sdk and use it’s own installer to add the optional features. vs_installer.exe seems to try and keep things lightweight as possible.

I actually just had this issue a little while ago and was wondering since I was digging through the source code anyways, if i could find the pathway that it thought the PDBCopy.exe was at (since I had like 5 different folders directories leading to it). I managed to find exactly which line of code is referencing this pathway. However I’m not sure if it could be changed or not. Maybe someone else in here who knows a bit more about this could take a look at the spot and say if it’s ok to change to be the correct pathway or not.

It’s in the WinPlatform.Automation.cs script at line 370.

Like I said before, I’m not sure if changing this would affect anything else, but I guess i managed to find the spot it’s trying to think to reference to. Can I just change this line and be good to go if I save it and go back to trying to build an installed build?

1 Like

Already got an issue for it, Unreal Engine Issues and Bug Tracker (UE-51362), please do vote to get it a little higher on their priority list! :slight_smile:

If installing VC++ 2015.3 v140 toolset (x86,x64) from vs 2017 didn’t solve your issue then check whether you have PDBCopy in “”.
Then can copy it to “” folder.

If you are missing PDBCopy then download the

Make sure that you ticked ‘Debugging tools’ checkbox.
After downloading sdk don’t launch ‘winsdksetup.exe’, instead open folder that you pointed at, navigate to ‘Installers’, and run ‘X64 Debuggers And Tools-x64_en-us.msi’ and ‘X86 Debuggers And Tools-x86_en-us.msi’.
PBDCopy will most likely appear in your windows kits folder.

Thanks, this seems to be the solution.

I have a clean install of VS 2017 Community and installed the “Debugging Tools for Windows” from the “Windows 10 SDK”-download and that worked.

Copying details for clarity, executed from a Git Bash shell as administrator:


mkdir -p '\'
cp -p '\Debuggers\x64\pdbcopy.exe'  '\'
ls -l '\PDBCopy.exe'


The Visual Studio 15.5 update broke all of this again, for me. After installing the update, PDBCopy.exe no longer existed anywhere on my entire machine.

I reinstalled the Windows 10 SDK from which put a new PDBCopy.exe in \Debuggers\x64.

Unfortunately, Unreal’s AutomationTool doesn’t check this location. If you look in WinPlatform.Automation.cs at the **StripSymbols **method, you’ll see it’s only checking VS 2015 and 2013 paths:


ProcessStartInfo StartInfo = new ProcessStartInfo();
string PDBCopyPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "MSBuild", "Microsoft", "VisualStudio", "v14.0", "AppxPackage", "PDBCopy.exe");
if (!File.Exists(PDBCopyPath))
{
    // Fall back on VS2013 version
    PDBCopyPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "MSBuild", "Microsoft", "VisualStudio", "v12.0", "AppxPackage", "PDBCopy.exe");
}

I edited that to look like this instead:


ProcessStartInfo StartInfo = new ProcessStartInfo();
string PDBCopyPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Windows Kits", "10", "Debuggers", "x64", "pdbcopy.exe");
if (!File.Exists(PDBCopyPath))
{
    // Fall back on VS2015 version
    PDBCopyPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "MSBuild", "Microsoft", "VisualStudio", "v14.0", "AppxPackage", "PDBCopy.exe");
    if (!File.Exists(PDBCopyPath))
    {
        // Fall back on VS2013 version
        PDBCopyPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "MSBuild", "Microsoft", "VisualStudio", "v12.0", "AppxPackage", "PDBCopy.exe");
    }
}

After installing the latest Windows 10 SDK and editing WinPlatform.Automation.cs as such, everything works again… for now.

It’s a shame this is so brittle. :expressionless:

Hello, i found an easier solution for those who got that painful issue, hope it can help :wink:

TLDR : If the Windows SDK is already installed, open Settings, navigate to Apps & features, select Windows Software Development Kit, and then click Modify to change the installation to add Debugging Tools for Windows.

found on this link : https://docs.microsoft.com/en-us/win…download-tools

10 Likes

Using the modify option to the Windows Software Development Kit as already installed was the easiest method for me.

VS2019 Community Edition 16.4.5

Thank you @come

1 Like

@come
Thanks a lot for posting this. I have both VS2017 and 2019 installed (w/ all the settings specified in the official VS setup instructions).
Recently merged 4.25.4 release into a custom fork that has new shader models.
Using ryanjon’s UE4 binary builder to build, I got that **PDBCOPY.EXE **error.

I have 3 different Windows SDKs installed.
10.1.17134.12
10.1.17763.132
10.1.18362.1

I modified (added Debugging Tools for Windows) only on 10.1.18362.1, and it went through.

Note: In the UE4 Bindary Builder app, I enabled Use 2019 compiler, because ever since 4.25.3 I haven’t been able to build the engine with VS2017.

1 Like

Learned! thank you

For the lost souls struggling in 2022.
The PDBCOPY is no longer a dependency for the SDK and is no longer installed with it if not specifically selected (which you can’t do when you install it with Visual Studio Installer).
Goto Apps & Features → Search the Windows Software Development Kit → Modify → Add Debugging Tools for Windows.
See here: Download Debugging Tools for Windows - WinDbg - Windows drivers | Microsoft Docs

27 Likes

Creating my first build and after almost 7 hours it failed with this error.
Running VS2022. Have followed the steps you’ve mentioned so running it again over night. Here’s hoping!