Announcement

Collapse
No announcement yet.

Installed Build Fails trying to run pdbcopy.exe ?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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:

    Code:
    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:

    Code:
    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"): C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\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 *C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\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.

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

    Comment


      #3
      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.

      Comment


        #4
        The pdbcopy.exe is expected to be found in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\ 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:

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

        Comment


          #5
          Originally posted by invicticide View Post
          The pdbcopy.exe is expected to be found in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\ 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:

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

          Great tip!! Thanks.

          Comment


            #6
            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:

            Code:
            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"
            kickbomb.us | @kickbomb

            Comment


              #7
              Originally posted by invicticide View Post
              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:

              Code:
              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!
              Last edited by virtualHC; 06-08-2017, 11:47 PM.

              Comment


                #8
                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.
                kickbomb.us | @kickbomb

                Comment


                  #9
                  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.

                  Comment


                    #10
                    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?
                    Last edited by dragon3582; 08-18-2017, 02:07 AM.

                    Comment


                      #11
                      Already got an issue for it, https://issues.unrealengine.com/issue/UE-51362, please do vote to get it a little higher on their priority list!

                      Comment


                        #12
                        If installing VC++ 2015.3 v140 toolset (x86,x64) from vs 2017 didn't solve your issue then check whether you have PDBCopy in "C:\Program Files (x86)\Windows Kits\10".
                        Then can copy it to "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage" folder.

                        If you are missing PDBCopy then download the
                        https://developer.microsoft.com/en-u...windows-10-sdk
                        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.

                        Comment


                          #13
                          Originally posted by ortroll View Post
                          If installing VC++ 2015.3 v140 toolset (x86,x64) from vs 2017 didn't solve your issue then check whether you have PDBCopy in "C:\Program Files (x86)\Windows Kits\10".
                          Then can copy it to "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage" folder.

                          If you are missing PDBCopy then download the
                          https://developer.microsoft.com/en-u...windows-10-sdk
                          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:
                          Code:
                          mkdir -p 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\'
                          cp -p 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\pdbcopy.exe'  'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\'
                          ls -l 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\PDBCopy.exe'

                          Comment


                            #14
                            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 https://developer.microsoft.com/en-u...windows-10-sdk which put a new PDBCopy.exe in C:\Program Files (x86)\Windows Kits\10\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:

                            Code:
                            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:

                            Code:
                            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. :|
                            kickbomb.us | @kickbomb

                            Comment

                            Working...
                            X