We deploy a locked-down (read-only) release version of the engine, as is standard with centrally managed application deployments, so that users can’t inadvertently modify and break applications for others. However, our developers need the ability to create C++ projects so as to build their Unreal plugins. Ideally, they could just use the deployed version of the engine we have available.
It would be great if SetupDotnet.sh would first check if the dotnet binary is executable before just trying to arbitrarily run chmod on it. The dotnet file is already executable, so creating a new C++ project would work fine if this script safely checked before trying to run an illegal chmod operation that it doesn’t have write permissions for. This is the case for Linux AND MacOS, both SetupDotnet.sh files behave the same way.
Ideally, these scripts would generally be aware of the possibility that their install directories may not be writable by the user, but that’s a bigger conversation.
Steps to Reproduce
For this specific issue, simply making the Engine/Binaries/ThirdParty/DotNet directory read-only will work.
Launch the Engine and attempt to create a new blank C++ project.
You should get the following logs:
Running /vol/apps/epic/unrealengine/5.6.0/Engine/Build/BatchFiles/Linux/Build.sh -projectfiles -project="/path/to/new/Project.uproject" -game -rocket -progress Setting up bundled DotNet SDK chmod: changing permissions of '/vol/apps/epic/unrealengine/5.6.0/Engine/Build/BatchFiles/Linux/../../../Binaries/ThirdParty/DotNet/8.0.300/linux-x64/dotnet': Permission denied
Hi Jackson,
I was only able to reproduce this on Linux referencing dotnet from a mounted read only file system in SetupDotnet.sh. However, despite the chmod operation failing with a permission error, the rest of the project generation still proceeded and completed. However, on MacOS, the chmod operation didn’t emit any errors under these conditions if dotnet was already set to executable in the read only file system. We can add a check on existing permissions prior to chmod on Linux, however, are you observing further errors than just the permission error from the chmod command?
Best regards.
Hi Stephane!
Thank you for the quick response! No, that was mainly it. On Linux it completely halts the process of creating a C++ project (and also, I think, the GenerateProjectFiles step, since that also calls SetupDotnet, if I recall correctly). I just assumed that MacOS would fail to, which is why I flagged the code there too, but we don’t currently use MacOS.
To be clear, this is not terribly urgent. On our side, we’ve just manually edited SetupDotnet as a part of deploying a new engine version to get around this issue, but at some point, having that changed for a future release would be one less thing to worry about. 
Thanks!
Jackson
Hi Jackson,
The check has been added at CL#44794742
Best regards.