Unable to generate project files from Perforce

Hi There,

I am having an issue with setting up a new project with source control and engine from source build. I setup a new project environment using Alar’s guide (excellent guide btw :wink: ) Populating Perforce With An Unreal Engine Source Build

Everything is fine on my main desktop, I am setting up a laptop to work from when I am remote and have a second user account and new workspace - everything works and can talk to p4 server fine. The issue I have is with my Engine core data. I submitted all the files as required by the guide but am unable to run generateprojectfiles.bat on my Laptop. I get the following error:

Setting up Unreal Engine 4 project files...
Binding IntelliSense data...
D:\[Area51-WSL]\Engine\Source\Runtime\Launch\Launch.Build.cs: warning: Referenced directory 'D:\[Area51-WSL]\Engine\Source\Developer\DerivedDataCache\Public' does not exist.
D:\[Area51-WSL]\Engine\Source\Runtime\Core\Core.Build.cs: warning: Referenced directory 'D:\[Area51-WSL]\Engine\Source\Developer\DerivedDataCache\Public' does not exist.
WARNING: Exception while generating include data for UE4Editor: Could not find definition for module 'DerivedDataCache', (referenced via Target -> Launch.Build.cs -> SessionServices.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for BenchmarkTool: Could not find definition for module 'DerivedDataCache', (referenced via Target -> BenchmarkTool.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for BlankProgram: Could not find definition for module 'DerivedDataCache', (referenced via Target -> BlankProgram.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for BuildPatchTool: Could not find definition for module 'DerivedDataCache', (referenced via Target -> BuildPatchTool.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for CrashReportClient: Could not find definition for module 'DerivedDataCache', (referenced via Target -> CrashReportClient.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for CrashReportClientEditor: Could not find definition for module 'DerivedDataCache', (referenced via Target -> CrashReportClientEditor.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithCADWorker: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithCADWorker.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithFacadeCSharp: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithFacadeCSharp.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithMax2016: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithMax2016.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithMax2017: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithMax2017.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithMax2018: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithMax2018.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithMax2019: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithMax2019.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithMax2020: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithMax2020.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithMax2021: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithMax2021.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithNavisworks2019: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithNavisworks2019.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithNavisworks2020: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithNavisworks2020.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithRevit2018: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithRevit2018.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithRevit2019: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithRevit2019.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithRevit2020: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithRevit2020.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithRevit2021: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithRevit2021.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithRhino6: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithRhino6.Build.cs -> DatasmithFacadeCSharp.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithSDK: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithSDK.Build.cs -> DatasmithCore.Build.cs -> Cbor.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithSketchUp2017: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithSketchUp2017.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithSketchUp2018: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithSketchUp2018.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithSketchUp2019: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithSketchUp2019.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for DatasmithSketchUp2020: Could not find definition for module 'DerivedDataCache', (referenced via Target -> DatasmithSketchUp2020.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for HeadlessChaos: Could not find definition for module 'DerivedDataCache', (referenced via Target -> HeadlessChaos.Build.cs -> PhysicsCore.Build.cs -> DeveloperSettings.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for LiveCodingConsole: Could not find definition for module 'DerivedDataCache', (referenced via Target -> LiveCodingConsole.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for ShaderCompileWorker: Could not find definition for module 'DerivedDataCache', (referenced via Target -> ShaderCompileWorker.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for SlateViewer: Could not find definition for module 'DerivedDataCache', (referenced via Target -> SlateViewer.Build.cs -> AppFramework.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for SwitchboardListener: Could not find definition for module 'DerivedDataCache', (referenced via Target -> SwitchboardListener.Build.cs -> ApplicationCore.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for TestPAL: Could not find definition for module 'DerivedDataCache', (referenced via Target -> TestPAL.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for TextureShareSDK: Could not find definition for module 'DerivedDataCache', (referenced via Target -> TextureShareSDK.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealCEFSubProcess: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealCEFSubProcess.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealFileServer: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealFileServer.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealFrontend: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealFrontend.Build.cs -> AutomationController.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealHeaderTool: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealHeaderTool.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealInsights: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealInsights.Build.cs -> AppFramework.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealLightmass: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealLightmass.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealMultiUserServer: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealMultiUserServer.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealPak: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealPak.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealRecoverySvc: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealRecoverySvc.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for UnrealVersionSelector: Could not find definition for module 'DerivedDataCache', (referenced via Target -> UnrealVersionSelector.Build.cs -> Core.Build.cs)
WARNING: Exception while generating include data for ProjectPilotEditor: Could not find definition for module 'DerivedDataCache', (referenced via Target -> Launch.Build.cs -> SessionServices.Build.cs -> Core.Build.cs)
Binding IntelliSense data... 100%
Writing project files... 100%
ERROR: Unhandled exception: System.UnauthorizedAccessException: Access to the path 'D:\[Area51-WSL]\Engine\Source\Programs\AutomationTool\AutomationTool.csproj.References' is denied.
          at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
          at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
          at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
          at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
          at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName)
          at System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options)
          at UnrealBuildTool.VCProjectFileGenerator.WriteProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators) in D:\[Area51-WSL]\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudio\VCProjectFileGenerator.cs:line 480
          at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments) in D:\[Area51-WSL]\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 1045
          at UnrealBuildTool.GenerateProjectFilesMode.Execute(CommandLineArguments Arguments) in D:\[Area51-WSL]\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 204
          at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\[Area51-WSL]\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 550

GenerateProjectFiles ERROR: UnrealBuildTool was unable to generate project files.

Press any key to continue . . .

I suspect its because some of the buildtool files are read only however I did setup my typemap and p4ignore files BEFORE i submitted my workspace to the depot. So not sure why this is happening - Alar does not mention needed to checkout any buildtool files prior so if anyone can offer a suggestion that would be great :slight_smile:

FYI I have been using Perforce for years but this is the first time I have setup a project using engine source and would love to get this working correctly (have been out of the programming loop for a few years and attempting to get back on the preverbial horse so to speak :slight_smile:

Thank you in advance to you all that take the time to read and offer advice :slight_smile:

I just wanted to also add that I was able to generate the files now by checking out the following file:

\Engine\Source\Programs\AutomationTool\AutomationTool.csproj.references

I was now able to generate the sln file however I cannot build the project :frowning: compains about access to certain log files being denied - I am wondering if there are files missing from the typemap to state that they need to rename read/write for Visual Studio 2019 to write to it? I also wonder if anyone else is having integration issues like this?

It’s probably denied because those files are not checked out in your Control source (Perforce). Try checking out those files first and then build.